2 Attachment(s)
Getting RTL8188 to work with Kali in monitor mode
tldr: RTL8188 now works in Kali 2017.2 with monitor mode support. "Some assembly required" (although not that kind of assembly)
The Realtek RTL8188EU(S) chipset is featured in quite a few USB WiFi adapters, including the TP LINK TL-WN722N v2 (but not v1). Until recently, this chipset has not worked well with Kali, but a solution for older kernels was posted on github a while back:
https://github.com/mfruba/kernel
Unfortunately, this solution only works on kernel version 4.9 and 4.10 (and possibly 4.11), whereas the latest Kali (2017.2) uses the 4.12 kernel.
I have now managed to get that driver compiled and running on the 4.12 kernel and can confirm that monitor mode absolutely works. In order to do so, two source files must be changed, but it really isn't difficult for anyone who knows their way around an editor.
Please note that the code snippets below aren't original. They were pretty much pulled straight from other github Realtek WiFi driver projects after going sifting through their bug fixes for kernel 4.12 related issues (several projects with more or less identical changes, seemingly independent). Attribution: https://patchwork.kernel.org/patch/9714419/
Don't be discouraged by the superficial complexity. This really is only a matter of changing a few lines of code and typing in a handful of commands in the terminal. If there are any questions, please ask and I'll do my best to help.
Steps to get RTL8188EUS working on linux kernel 4.12
1. Download source from https://github.com/mfruba/kernel and cd to kernel-master/drivers/TL-WN722N_v2.0-Ralink/rtl8188EUS_linux_v4.3.0.8_13968.20150417
2. Install kernel headers (if you don't, you'll get the errors paladin gets above)
Code:
# apt-get install linux-headers-amd64
3. MODIFY CODE for 4.12 kernel. This may sound intimidating, but in reality it consists of just a few lines in two files (use whatever editor you wish):
Makefile --> Add the following line somewhere among the other EXTRA_CFLAGS
(Or patch with this diff: Attachment 2823)
Code:
EXTRA_CFLAGS += -Wno-incompatible-pointer-types
os_dep/linux/ioctl_cfg80211.c --> Find the section that starts with:
(Or patch with this diff: Attachment 2822)
Code:
if (rtw_to_roam(padapter) > 0) {
(line 854)
and ADD the following line of code
Code:
struct cfg80211_roam_info roam_info = {};
(good practice would be to add it among the other definitions, so e.g. after the u16 channel = .... line)
finally, a bit of code a few lines further down in the same file needs to be replaced.
DELETE (or comment out) the following lines of code:
Code:
cfg80211_roamed(padapter->pnetdev
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39) || defined(COMPAT_KERNEL_RELEASE)
, notify_channel
#endif
, cur_network->network.MacAddress
, pmlmepriv->assoc_req+sizeof(struct rtw_ieee80211_hdr_3addr)+2
, pmlmepriv->assoc_req_len-sizeof(struct rtw_ieee80211_hdr_3addr)-2
, pmlmepriv->assoc_rsp+sizeof(struct rtw_ieee80211_hdr_3addr)+6
, pmlmepriv->assoc_rsp_len-sizeof(struct rtw_ieee80211_hdr_3addr)-6
, GFP_ATOMIC);
and ADD the following lines instead:
Code:
roam_info.channel = notify_channel;
roam_info.channel = notify_channel;
roam_info.bssid = cur_network->network.MacAddress;
roam_info.req_ie = pmlmepriv->assoc_req+sizeof(struct ieee80211_hdr_3addr)+2;
roam_info.req_ie_len = pmlmepriv->assoc_req_len-sizeof(struct ieee80211_hdr_3addr)-2;
roam_info.resp_ie = pmlmepriv->assoc_rsp+sizeof(struct ieee80211_hdr_3addr)+6;
roam_info.resp_ie_len = pmlmepriv->assoc_rsp_len-sizeof(struct ieee80211_hdr_3addr)-6;
cfg80211_roamed(padapter->pnetdev, &roam_info, GFP_ATOMIC);
4. Compile and install:
Code:
# make
# make install
There should be no errors, although there are a few warnings. It does take a little bit of time, so be patient.
5. Load dependent modules, as per the original instructions (won't hurt, but these should already be loaded).
Code:
# modprobe lib80211
# modprobe cfg80211
6. Insert the newly compiled module into the kernel:
7. If there was already a driver loaded for the RTL8188EUS device, remove it. This could possibly be done before inserting the module into the kernel, in which case you might not have to remove and reinsert the device to get the newly compiled module bound to the device. To verify which kernel module (driver) is being used, you can install and use lshw:
Code:
# apt-get install lshw
# lshw -c net
Find the right networking device and look under "configuration". It should say "driver=rtl8188eu". If it says "r8188eu" that's the old one. Remove it:
Code:
# modprobe -r r8188eu
Removing and reinserting the device might be necessary to get the kernel to bind the new driver. There are other ways to do it, but this is fairly foolproof. Verify with lshw that the correct driver is being used.
THAT'S IT!
Tested on a clean install of "Kali 64 bit 2017.2" dd'ed to a USB drive with an additional partition added for persistence and booted in persistence mode. Switching to monitor mode works and functions as intended. Changes, settings, and full functionality survive boot.[/quote]
Attachment 2823
Hhhhhhhheeeelllllpppppp!!!!!!!!!
can someone please please PLEASE help me i brought a thinkpad e545 with a broadcom chipset, after three weeks of trying to get the driver to send packets (not possible sfter so many people saying it was and so many people saying it wasnt) i found out that yeah its not possible. So i brought a TP-LINK TL-WN722N witch forums say its plau and play so after three weeks of faffing about it sounded like a good bet. after 5 operating systems later (ubuntu, fedora 27, elementary, mint and now kali) i have found out it is not plug and play. i can get the internet but no monitor mode. i have tried every tutorial word for word but still no joy. when i try and install ther master driver given in the discription i still have errors about fail to create module files and this is what i get when trying to put the device in monitor mode
lewis@kali:~$ iwconfig
eth0 no wireless extensions.
wlan1 unassociated ESSID:"" Nickname:"<WIFI@REALTEK>"
Mode:Managed Frequency=2.412 GHz Access Point: Not-Associated
Sensitivity:0/0
Retry:off RTS thr:off Fragment thr:off
Power Management:off
Link Quality:0 Signal level:0 Noise level:0
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
wlan0 IEEE 802.11 ESSID:"VM8555177"
Mode:Managed Frequency:2.412 GHz Access Point: 40:0D:10:FA:AB:21
Bit Rate=72 Mb/s Tx-Power=200 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Power Management:off
Link Quality=70/70 Signal level=-40 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
lo no wireless extensions.
lewis@kali:~$ airmon-ng
Run it as root
lewis@kali:~$ sudo su
root@kali:/home/lewis# cd
root@kali:~# airmon-ng
PHY Interface Driver Chipset
phy0 wlan0 wl Broadcom Limited BCM43142 802.11b/g/n (rev 01)
null wlan1 r8188eu
root@kali:~# ifconfig wlan1 down
root@kali:~# iwconfig wlan1 mode monitor
Error for wireless request "Set Mode" (8B06) :
SET failed on device wlan1 ; Invalid argument.
root@kali:~# uname -r
4.15.0-kali2-amd64
root@kali:~#
can anyone give me a step by step guide including a guide inserting the EXTRA_FLAGS many thanks i'm very much looking forward to the help