Friday, April 25, 2014

Installing Broadcom BCM43142 Drivers on Kali Linux

Introduction

I've seen some confusion when it comes to installing the wireless drivers for Broadcom's BCM43142 802.11b/g/n card, specifically with Kali or other Debian based distributions. If you're running Linux kernel < 3.10, then just comment out the lines regarding the wl_3.10 patch. This script has been run on both 32bit and 64bit installations with Kali 1.0.6.

lspci

$ lspci | grep BCM43142
02:00.0 Network controller: Broadcom Corporation BCM43142 802.11b/g/n (rev 01)

Installing the drivers

The script is available through Github using the wget command below, or check the bottom of this article for the full script.

$ wget https://gist.githubusercontent.com/chokepoint/11305606/raw/52109f648c2ad5ec6a65bf8eee78fbda15fa1cfb/bcm43142_drivers.sh
$ chmod +x bcm43142_drivers.sh
$ sudo ./bcm43142_drivers.sh

Resources

Kali Linux
Broadcom Driver Instructions
Original wl_3.10 Patch

Script

#!/bin/bash
# chmod +x broadcom_drivers.sh
# ./broadcom_drivers.sh

mkdir broadcom 
cd broadcom
apt-get install linux-headers-`uname -r` build-essential -y

if [ `uname -m` == "i686" ] ; then
 wget http://www.broadcom.com/docs/linux_sta/hybrid-v35-nodebug-pcoem-6_30_223_141.tar.gz
else
 wget http://www.broadcom.com/docs/linux_sta/hybrid-v35_64-nodebug-pcoem-6_30_223_141.tar.gz
fi
tar -xvf hybrid-v35*
wget http://www.mindwerks.net/wp-content/uploads/2013/10/wl_3.10.patch
patch -p2 < wl_3.10.patch
make
cp wl.ko /lib/modules/`uname -r`/kernel/net/wireless/
depmod
rmmod bcma
echo "blacklist bcma" >> /etc/modprobe.d/blacklist.conf
modprobe wl

10 comments:

  1. Do you think this would work on Tails 1.1, too? I noticed that both Kali and Tails are *extremely* similar.

    ReplyDelete
  2. its working.............................

    ReplyDelete
  3. works on Kali.... Awesome

    ReplyDelete
  4. Superb! Thanks alot bro. I've been trying all the fixes but only this one worked. thanks again. :)

    ReplyDelete
  5. I am having issues with this installation I installed 32 bit Kalilinux OS on a 64 BIt sony VAIO...TECHIESSS please help meee



    root@Backtrack:~/Desktop# ./broadcom.sh


    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    E: Unable to locate package linux-headers-3.7-trunk-686-pae
    E: Couldn't find any package by regex 'linux-headers-3.7-trunk-686-pae'
    --2014-09-24 16:58:53-- http://www.broadcom.com/docs/linux_sta/hybrid-v35-nodebug-pcoem-6_30_223_141.tar.gz
    Resolving www.broadcom.com (www.broadcom.com)... 63.251.216.155
    Connecting to www.broadcom.com (www.broadcom.com)|63.251.216.155|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 1735911 (1.7M) [application/x-gzip]
    Saving to: `hybrid-v35-nodebug-pcoem-6_30_223_141.tar.gz'

    100%[======================================>] 17,35,911 11.6K/s in 2m 29s

    2014-09-24 17:01:25 (11.4 KB/s) - `hybrid-v35-nodebug-pcoem-6_30_223_141.tar.gz' saved [1735911/1735911]

    Makefile
    lib/
    lib/wlc_hybrid.o_shipped
    lib/LICENSE.txt
    src/
    src/shared/
    src/shared/linux_osl.c
    src/shared/bcmwifi/
    src/shared/bcmwifi/include/
    src/shared/bcmwifi/include/bcmwifi_channels.h
    src/shared/bcmwifi/include/bcmwifi_rates.h
    src/include/
    src/include/typedefs.h
    src/include/bcmdefs.h
    src/include/bcmendian.h
    src/include/linuxver.h
    src/include/wlioctl.h
    src/include/bcmutils.h
    src/include/osl.h
    src/include/linux_osl.h
    src/include/packed_section_end.h
    src/include/packed_section_start.h
    src/include/pcicfg.h
    src/include/epivers.h
    src/common/
    src/common/include/
    src/common/include/proto/
    src/common/include/proto/ethernet.h
    src/common/include/proto/bcmeth.h
    src/common/include/proto/bcmip.h
    src/common/include/proto/bcmevent.h
    src/common/include/proto/ieee80211_radiotap.h
    src/common/include/proto/802.11.h
    src/common/include/proto/802.1d.h
    src/common/include/proto/wpa.h
    src/wl/
    src/wl/sys/
    src/wl/sys/wl_cfg80211_hybrid.c
    src/wl/sys/wl_export.h
    src/wl/sys/wl_dbg.h
    src/wl/sys/wlc_key.h
    src/wl/sys/wlc_ethereal.h
    src/wl/sys/wl_linux.c
    src/wl/sys/wl_linux.h
    src/wl/sys/wl_cfg80211_hybrid.h
    src/wl/sys/wl_iw.c
    src/wl/sys/wl_iw.h
    src/wl/sys/wlc_types.h
    src/wl/sys/wlc_pub.h
    src/wl/sys/wlc_utils.h
    --2014-09-24 17:01:25-- http://www.mindwerks.net/wp-content/uploads/2013/10/wl_3.10.patch
    Resolving www.mindwerks.net (www.mindwerks.net)... 192.81.217.188
    Connecting to www.mindwerks.net (www.mindwerks.net)|192.81.217.188|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 2916 (2.8K) [application/octet-stream]
    Saving to: `wl_3.10.patch'

    100%[======================================>] 2,916 18.0K/s in 0.2s

    2014-09-24 17:01:28 (18.0 KB/s) - `wl_3.10.patch' saved [2916/2916]

    patching file src/wl/sys/wl_linux.c
    Hunk #1 succeeded at 3236 (offset 7 lines).
    Hunk #2 succeeded at 3254 (offset 7 lines).
    Hunk #3 succeeded at 3417 (offset 7 lines).
    Hunk #4 succeeded at 3447 (offset 7 lines).
    Hunk #5 succeeded at 3483 (offset 7 lines).
    KBUILD_NOPEDANTIC=1 make -C /lib/modules/`uname -r`/build M=`pwd`
    make: *** /lib/modules/3.7-trunk-686-pae/build: No such file or directory. Stop.
    make: *** [all] Error 2
    cp: cannot stat `wl.ko': No such file or directory
    Error: Module bcma is not currently loaded
    FATAL: Module wl not found.


    root@Backtrack:~/Desktop#

    ReplyDelete
    Replies
    1. Looks like you're on backtrack. Try manually installing the appropriate linux-headers package for your current kernel version and then rerun the script.

      Delete
  6. It is showing as "root@Backtrack:~/Desktop# " because I have named the host as "Backtrack" instead of "Kali" and here is the result for the OS version that i got on running "uname -a"

    Linux Backtrack 3.7-trunk-686-pae #1 SMP Debian 3.7.2-0+kali8 i686 GNU/Linux

    Please let me know the commands and steps needed to be done as I am illiterate in LINUX OS...THANKS IN ADVACE......stderr...

    ReplyDelete
  7. Try using "apt-cache search linux-headers". Find the package that matches your installed kernel version, and then "apt-get install ". Typically it is the result of "echo linux-headers-$(uname -r)" Hope this helps.

    ReplyDelete
  8. Is it the latest driver?
    As per the "broadcom driver instruction" mentioned in RESOURCES the site is showing latest driver as ----223.248 and the script is installing ----223.241
    What should I do? Need advice.......thanks

    ReplyDelete