Kali Linux – Modprobe wl Fatal Error: Module wl Not Found

drivermacbook prounixwifi

I have a MacBook Air 2015 11" with Kali GNU/Rolling 64-bit Gnome ver 3.20.2 and Linux kernel: Linux 4.6.0 -kali1-amd64, dual booted side by side with macOS and windows, live mode with persistence and I've been trying to install the wireless drivers for this Mac with a BRCM4360 (14e4:43a0) chip.

What I've done:

Followed instructions on: (EACH ONE OF THEM)

How to install Broadcom BCM4360 on Debian on MacBook Pro

Debian/wl

and a lot of other goggles. But couldn't get it solved with either.

It goes easy through :

apt-get update    
apt-get install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,') broadcom-sta-dkms

and

modprobe -r b44 b43 b43legacy ssb brcmsmac

but whenever i try:

modprobe wl

terminal returns:

root@kali:~# modprobe wl
modprobe: FATAL: Module wl not found in directory /lib/modules/4.6.0-kali1-amd64

Also I'm a newbie to Linux, kernels, networking and modules/drivers and stuff also the only way I could run Kali on this machine was to live boot with persistence as mentioned in PENTESTMAC forums. Actually I could get my wireless driver working about a year earlier just by following all those steps on the forum without any issues (late 2016). But now it doesn't work at the modprobe wl section.

So, any help from scratch would be highly appreciated. It's been weeks. Vigorously SMH.

edit:

I even tried this automated script on https://gist.github.com/stevenmirabito/31a6bf9e5bfe4128b0a9

But still the same thing it gave this output:

./broadcom-wl-dkms.sh
--2017-07-19 14:11:47--  http://www.broadcm.com/docs/linux_sta/hybrid-v35_64-nodebug-pcoem-6_30_223_271.tar.gz
Resolving www.broadcm.com (www.broadcm.com)... 185.26.230.129
Connecting to www.broadcm.com (www.broadcm.com)|185.26.230.129|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://www.broadcom.com/docs/linux_sta/hybrid-v35_64-nodebug-pcoem-6_30_223_271.tar.gz [following]
--2017-07-19 14:11:49--  http://www.broadcom.com/docs/linux_sta/hybrid-v35_64-nodebug-pcoem-6_30_223_271.tar.gz
Resolving www.broadcom.com (www.broadcom.com)... 68.142.68.26, 68.142.70.26
Connecting to www.broadcom.com (www.broadcom.com)|68.142.68.26|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://docs.broadcom.com/docs/linux_sta/hybrid-v35_64-nodebug-pcoem-6_30_223_271.tar.gz [following]
--2017-07-19 14:11:49--  https://docs.broadcom.com/docs/linux_sta/hybrid-v35_64-nodebug-pcoem-6_30_223_271.tar.gz
Resolving docs.broadcom.com (docs.broadcom.com)... 68.142.70.26, 68.142.68.26
Connecting to docs.broadcom.com (docs.broadcom.com)|68.142.70.26|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 102 [text/html]
Saving to: ‘broadcom.tar.gz’

broadcom.tar.gz     100%[===================>]     102  --.-KB/s    in 0s      

2017-07-19 14:11:51 (77.3 MB/s) - ‘broadcom.tar.gz’ saved [102/102]

./broadcom-wl-dkms.sh: line 15: https://aur.archlinux.org/cgit/aur.git/snapshot/broadcom-wl-dkms.tar.gz: No such file or directory

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
tar (child): broadcom-wl-dkms.tar.gz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
sed: can't read src/wl/sys/wl_linux.c: No such file or directory
./broadcom-wl-dkms.sh: line 23: 001-null-pointer-fix.patch: No such file or directory
sed: can't read dkms.conf.in: No such file or directory
cp: cannot stat 'src': No such file or directory
cp: cannot stat 'lib': No such file or directory
cp: cannot stat 'Makefile': No such file or directory
chmod: cannot access '/usr/src/broadcom-wl-6.30.223.271/lib/LICENSE.txt': No such file or directory
ln: failed to create symbolic link '/usr/share/licenses/broadcom-wl-dkms/LICENSE': File exists
install: cannot stat 'broadcom-wl-dkms.conf': No such file or directory
dkms.conf: Error! No 'DEST_MODULE_LOCATION' directive specified.
dkms.conf: Error! No 'PACKAGE_NAME' directive specified.
dkms.conf: Error! No 'PACKAGE_VERSION' directive specified.
Error! Bad conf file.
File: /usr/src/broadcom-wl-6.30.223.271/dkms.conf
does not represent a valid dkms.conf file.
rmmod: ERROR: Module b43 is not currently loaded
rmmod: ERROR: Module b43legacy is not currently loaded
rmmod: ERROR: Module ssb is not currently loaded
rmmod: ERROR: Module bcm43xx is not currently loaded
rmmod: ERROR: Module brcm80211 is not currently loaded
rmmod: ERROR: Module brcmfmac is not currently loaded
rmmod: ERROR: Module brcmsmac is not currently loaded
rmmod: ERROR: Module bcma is not currently loaded
rmmod: ERROR: Module wl is not currently loaded
modprobe: FATAL: Module wl not found in directory /lib/modules/4.6.0-kali1-amd64

edit:
I was however able to remake the script and get those packages downloaded and extracted as this:

#!/bin/bash
# Installs the broadcom-wl kernel module with DKMS
# Tested under Fedora 23, will likely work with other versions/distros
# Author: Steven Mirabito <smirabito@csh.rit.edu>

# Create a work directory
mkdir -p /tmp/broadcom
cd /tmp/broadcom

# Download the module from Broadcom (http://www.broadcom.com/support/?gid=1)
# Remove '_64' from the URL for a 32-bit system
cp ~/Downloads/hybrid-v35_64-nodebug-pcoem-6_30_223_271.tar.gz /tmp/broadcom/broadcom.tar.gz

# Download some support files from the Arch package
cp -r ~/Downloads/usr /tmp/broadcom/broadcom-wl-dkms

# Untar the archives
tar -zxvf broadcom.tar.gz

# Patch the module
sed -i -e "/BRCM_WLAN_IFNAME/s:eth:wlan:" src/wl/sys/wl_linux.c
patch -p1 < 001-null-pointer-fix.patch

# Add the module version number to the dkms config file
sed -e "s/@PACKAGE_VERSION@/6.30.223.271/" dkms.conf.in > dkms.conf

# Create the destination directory
mkdir -p /usr/src/broadcom-wl-6.30.223.271

# Move files into place
cp -RL src lib Makefile dkms.conf /usr/src/broadcom-wl-6.30.223.271

# Fix permissions and link the license in the appropriate place
chmod a-x "/usr/src/broadcom-wl-6.30.223.271/lib/LICENSE.txt"
mkdir -p "/usr/share/licenses/broadcom-wl-dkms"
ln -rs "/usr/src/broadcom-wl-6.30.223.271/lib/LICENSE.txt" "/usr/share/licenses/broadcom-wl-dkms/LICENSE"

# Install the modprobe config to blacklist the other Broadcom modules
install -D -m 644 broadcom-wl-dkms.conf "/etc/modprobe.d/broadcom-wl-dkms.conf"

# Install and build the module
dkms install -m broadcom-wl -v 6.30.223.271

# Activate the module
rmmod b43 b43legacy ssb bcm43xx brcm80211 brcmfmac brcmsmac bcma wl
modprobe wl

# Clean up
cd ~
rm -rf /tmp/broadcom

But still: As soon as I get to the patching it returns this error:

root@kali:~/Desktop# sudo ./broadcom-wl-dkms.sh
Makefile
lib/
lib/wlc_hybrid.o_shipped
lib/LICENSE.txt
src/
src/include/
src/include/typedefs.h
src/include/linuxver.h
src/include/bcmutils.h
src/include/siutils.h
src/include/packed_section_start.h
src/include/epivers.h
src/include/linux_osl.h
src/include/bcmendian.h
src/include/packed_section_end.h
src/include/pcicfg.h
src/include/bcmdefs.h
src/include/bcmcrypto/
src/include/bcmcrypto/tkhash.h
src/include/wlioctl.h
src/include/osl.h
src/shared/
src/shared/bcmwifi/
src/shared/bcmwifi/include/
src/shared/bcmwifi/include/bcmwifi_channels.h
src/shared/bcmwifi/include/bcmwifi_rates.h
src/shared/linux_osl.c
src/wl/
src/wl/sys/
src/wl/sys/wl_dbg.h
src/wl/sys/wlc_key.h
src/wl/sys/wl_linux.h
src/wl/sys/wl_linux.c
src/wl/sys/wlc_wowl.h
src/wl/sys/wl_iw.c
src/wl/sys/wlc_pub.h
src/wl/sys/wl_iw.h
src/wl/sys/wl_export.h
src/wl/sys/wl_cfg80211_hybrid.h
src/wl/sys/wlc_ethereal.h
src/wl/sys/wl_cfg80211_hybrid.c
src/wl/sys/wlc_utils.h
src/wl/sys/wlc_types.h
src/common/
src/common/include/
src/common/include/proto/
src/common/include/proto/bcmeth.h
src/common/include/proto/ieee80211_radiotap.h
src/common/include/proto/ethernet.h
src/common/include/proto/802.1d.h
src/common/include/proto/bcmip.h
src/common/include/proto/bcmevent.h
src/common/include/proto/802.11.h
src/common/include/proto/wpa.h
./broadcom-wl-dkms.sh: line 22: 001-null-pointer-fix.patch: No such file or directory
sed: can't read dkms.conf.in: No such file or directory
ln: failed to create symbolic link '/usr/share/licenses/broadcom-wl-dkms/LICENSE': File exists
install: cannot stat 'broadcom-wl-dkms.conf': No such file or directory
./broadcom-wl-dkms.sh: line 42: dkms: command not found
rmmod: ERROR: Module b43 is not currently loaded
rmmod: ERROR: Module b43legacy is not currently loaded
rmmod: ERROR: Module ssb is not currently loaded
rmmod: ERROR: Module bcm43xx is not currently loaded
rmmod: ERROR: Module brcm80211 is not currently loaded
rmmod: ERROR: Module brcmfmac is not currently loaded
rmmod: ERROR: Module brcmsmac is not currently loaded
rmmod: ERROR: Module bcma is not currently loaded
rmmod: ERROR: Module wl is not currently loaded
modprobe: FATAL: Module wl not found in directory /lib/modules/4.6.0-kali1-amd64

Sorry Im way too noob.Maybe I need to contact the author and ask him if he would upgrade this as of now?

edit 3

klanomath's script did compile succesfully but while trying to rmmod the conflictig modules and enabling wl at last the terminal returns:

root@kali:~# ./install-broadcom.sh
Makefile
lib/
lib/wlc_hybrid.o_shipped
lib/LICENSE.txt
src/
src/include/
src/include/typedefs.h
src/include/linuxver.h
src/include/bcmutils.h
src/include/siutils.h
src/include/packed_section_start.h
src/include/epivers.h
src/include/linux_osl.h
src/include/bcmendian.h
src/include/packed_section_end.h
src/include/pcicfg.h
src/include/bcmdefs.h
src/include/bcmcrypto/
src/include/bcmcrypto/tkhash.h
src/include/wlioctl.h
src/include/osl.h
src/shared/
src/shared/bcmwifi/
src/shared/bcmwifi/include/
src/shared/bcmwifi/include/bcmwifi_channels.h
src/shared/bcmwifi/include/bcmwifi_rates.h
src/shared/linux_osl.c
src/wl/
src/wl/sys/
src/wl/sys/wl_dbg.h
src/wl/sys/wlc_key.h
src/wl/sys/wl_linux.h
src/wl/sys/wl_linux.c
src/wl/sys/wlc_wowl.h
src/wl/sys/wl_iw.c
src/wl/sys/wlc_pub.h
src/wl/sys/wl_iw.h
src/wl/sys/wl_export.h
src/wl/sys/wl_cfg80211_hybrid.h
src/wl/sys/wlc_ethereal.h
src/wl/sys/wl_cfg80211_hybrid.c
src/wl/sys/wlc_utils.h
src/wl/sys/wlc_types.h
src/common/
src/common/include/
src/common/include/proto/
src/common/include/proto/bcmeth.h
src/common/include/proto/ieee80211_radiotap.h
src/common/include/proto/ethernet.h
src/common/include/proto/802.1d.h
src/common/include/proto/bcmip.h
src/common/include/proto/bcmevent.h
src/common/include/proto/802.11.h
src/common/include/proto/wpa.h
broadcom-wl-dkms/
broadcom-wl-dkms/.SRCINFO
broadcom-wl-dkms/.gitignore
broadcom-wl-dkms/001-null-pointer-fix.patch
broadcom-wl-dkms/002-rdtscl.patch
broadcom-wl-dkms/003-linux47.patch
broadcom-wl-dkms/004-linux48.patch
broadcom-wl-dkms/005-debian-fix-kernel-warnings.patch
broadcom-wl-dkms/PKGBUILD
broadcom-wl-dkms/broadcom-wl-dkms.conf
broadcom-wl-dkms/broadcom-wl-dkms.install
broadcom-wl-dkms/dkms.conf.in
ln: failed to create symbolic link '/usr/share/licenses/broadcom-wl-dkms/LICENSE': File exists

Creating symlink /var/lib/dkms/broadcom-wl/6.30.223.271/source ->
                 /usr/src/broadcom-wl-6.30.223.271

DKMS: add completed.

Kernel preparation unnecessary for this kernel.  Skipping...
applying patch 001-null-pointer-fix.patch...patching file src/wl/sys/wl_linux.c
Hunk #1 succeeded at 2165 (offset 8 lines).

applying patch 002-rdtscl.patch...patching file src/shared/linux_osl.c

applying patch 003-linux47.patch...patching file src/wl/sys/wl_cfg80211_hybrid.c

applying patch 004-linux48.patch...patching file src/wl/sys/wl_cfg80211_hybrid.c
Hunk #1 succeeded at 2386 (offset -2 lines).
Hunk #2 succeeded at 2496 (offset -2 lines).
Hunk #3 succeeded at 2928 (offset 4 lines).

applying patch 005-debian-fix-kernel-warnings.patch...patching file src/wl/sys/wl_cfg80211_hybrid.c


Building module:
cleaning build area...
make -j4 KERNELRELEASE=4.6.0-kali1-amd64 -C /lib/modules/4.6.0-kali1-amd64/build M=/var/lib/dkms/broadcom-wl/6.30.223.271/build...
cleaning build area...

DKMS: build completed.

wl.ko:
Running module version sanity check.
 - Original module
   - Found /lib/modules/4.6.0-kali1-amd64/kernel/drivers/net/wireless/wl.ko
   - Storing in /var/lib/dkms/broadcom-wl/original_module/4.6.0-kali1-amd64/x86_64/
   - Archiving for uninstallation purposes
 - Installation
   - Installing to /lib/modules/4.6.0-kali1-amd64/kernel/drivers/net/wireless/

depmod....

DKMS: install completed.
rmmod: ERROR: Module b43 is not currently loaded
rmmod: ERROR: Module b43legacy is not currently loaded
rmmod: ERROR: Module ssb is not currently loaded
rmmod: ERROR: Module bcm43xx is not currently loaded
rmmod: ERROR: Module brcm80211 is not currently loaded
rmmod: ERROR: Module brcmfmac is not currently loaded
rmmod: ERROR: Module brcmsmac is not currently loaded
rmmod: ERROR: Module bcma is not currently loaded
rmmod: ERROR: Module wl is not currently loaded
modprobe: ERROR: could not insert 'wl': Exec format error
root@kali:~# 

also the dmesg output returns:

12.767741] wl: disagrees about version of symbol module_layout

somewhere in the middle. IS this the element creating the problem ?

and modprobe --force wl 's log under dmesg:

[   18.862399] usbcore: registered new interface driver rndis_host
[   18.878990] IPv6: ADDRCONF(NETDEV_UP): usb0: link is not ready
[   19.533537] fuse init (API version 7.24)
[  685.317127] wl: disagrees about version of symbol module_layout
[  690.440257] wl: disagrees about version of symbol module_layout
[  965.367764] wl: disagrees about version of symbol module_layout
[ 1244.818590] wl: module_layout: kernel tainted.
[ 1244.818593] Disabling lock debugging due to kernel taint
[ 1244.818597] wl: module license 'MIXED/Proprietary' taints kernel.
[ 1244.820857] wl: Unknown symbol __check_object_size (err 0)
[ 1244.820901] wl: Unknown symbol cfg80211_connect_bss (err 0)
[ 1244.820925] wl: Unknown symbol page_offset_base (err 0)
[ 1244.820964] wl: Unknown symbol vmemmap_base (err 0)

also

insmod: ERROR: could not insert module /lib/modules/4.6.0-kali1-amd64/kernel/drivers/net/wireless/wl.ko: Invalid module format

Best Answer

The following method should work:

  • Change to the root user in Kali.

  • Remove all remnants of your previous attempts to install the Broadcom driver wl.

  • Install dkms in Kali:

    apt-get update
    apt-get install dkms
    
  • Download the Broadcom driver manually to your Downloads folder
  • Download the patch manually to your Downloads folder
  • Create (nano ~/install-broadcom.sh, copy and paste the lines below, write to disk and quit with ctrlO and ctrlX) and afterwards execute the script:

    #!/bin/bash
    # Installs the broadcom-wl kernel module with DKMS
    # Tested under Fedora 23, will likely work with other versions/distros
    # Author: Steven Mirabito <smirabito@csh.rit.edu>
    
    # Create a work directory
    mkdir -p /tmp/broadcom
    cd /tmp/broadcom
    
    # Download the module from Broadcom (http://www.broadcom.com/support/?gid=1) manually to ~/Downloads
    # https://docs.broadcom.com/docs/12358410
    
    # Download some support files from the Arch package manually ~/Downloads
    # https://aur.archlinux.org/cgit/aur.git/snapshot/broadcom-wl-dkms.tar.gz
    
    cp ~/Downloads/broadcom-wl-dkms.tar.gz /tmp/broadcom/
    cp ~/Downloads/hybrid-v35_64-nodebug-pcoem-6_30_223_271.tar.gz /tmp/broadcom/broadcom.tar.gz
    
    
    # Untar the archives
    tar -zxvf broadcom.tar.gz
    tar -zxvf broadcom-wl-dkms.tar.gz
    
    # Patch the module
    sed -i -e "/BRCM_WLAN_IFNAME/s:eth:wlan:" src/wl/sys/wl_linux.c
    
    # Add the module version number to the dkms config file
    sed -e "s/@PACKAGE_VERSION@/6.30.223.271/" broadcom-wl-dkms/dkms.conf.in > dkms.conf
    
    # Create the destination directory
    mkdir -p /usr/src/broadcom-wl-6.30.223.271
    
    # Move files into place
    cp -RL src lib Makefile dkms.conf /usr/src/broadcom-wl-6.30.223.271
    
    # Fix permissions and link the license in the appropriate place
    chmod a-x "/usr/src/broadcom-wl-6.30.223.271/lib/LICENSE.txt"
    mkdir -p "/usr/share/licenses/broadcom-wl-dkms"
    ln -rs "/usr/src/broadcom-wl-6.30.223.271/lib/LICENSE.txt" "/usr/share/licenses/broadcom-wl-dkms/LICENSE"
    
    # Install the modprobe config to blacklist the other Broadcom modules
    install -D -m 644 broadcom-wl-dkms/broadcom-wl-dkms.conf "/etc/modprobe.d/broadcom-wl-dkms.conf"
    
    # Install and build the module
    dkms add -m broadcom-wl -v 6.30.223.271
    cp -RL /tmp/broadcom/broadcom-wl-dkms /var/lib/dkms/broadcom-wl/6.30.223.271/source/patches
    dkms install -m broadcom-wl -v 6.30.223.271
    
    # Activate the module
    rmmod b43 b43legacy ssb bcm43xx brcm80211 brcmfmac brcmsmac bcma wl
    modprobe wl
    
    # Clean up
    cd ~
    rm -rf /tmp/broadcom
    

I don't have a WLAN chip in my VM. So I can't prove the commands rmmod ... and modprobe wl. At least I don't get an error executing the last command ;-).