If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

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:

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.

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: Makefile.diff.txt)

(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:

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:

Code:

# insmod 8188eu.ko

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]Makefile.diff.txt

I tried also installing another linux image, but couldn't make kali boot it, although it showed on the list of images. Whatever I did, I kept getting

Code:

# uname -r
4.12.0-kali1-amd64

I don't understand if I did something wrong or it isn't possible to upgrade kernel with live USB, but I guess I'll make another post to find that out...

Anyways, after failing to update kernel I made another live USB with weekly release W43, where headers corresponded the kernel version, and I did manage to compile and insert the module but WN722N won't go to monitor mode. So, I guess it doesn't work with v 4.13 ?

In the meantime I ordered another WiFi card, but I'm still curious to know if it is possible to make WN722N work and if I did something wrong for the sake of learning

I simply added the "working" driver to https://github.com/kimocoder/rtl8188eu for simple patching reasons.
Supports kernel v4.13 + Makefile addition added, but as I've said in the bugtracker, this is a dirty driver.

Hey guys, could use your help on this one. I usually try to solve everything myself and i've been successful until now, linux.. and this driver, man it drives me crazy :P

So i've been trying to follow everything you've said and i tried like every method there is on youtube. But i feel like this one is the one, except. I can't make anything out of it.

How do i even enter the conf file for the kernel? Or applying the patch?

Looked around for tutorials and guides but i don't know. I just don't get it, but i can't give up either, so.. help a brother out?
Going to get the v1 from ebay, but it will take a couple of weeks i could've learned alot more about this.

I feel dumb, but I've gotten pretty far I think I'll be ok if someone could kindly explain just a little bit more in depth WHERE I would find the file that I can open to edit for this part:

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

airmon-ng still had problems with monitor mode, but I was able to enter monitor mode via

ifconfig wlan0 down
iwconfig wlan0 mode monitor
ifconfig wlan0 up

airodump worked fine.

uname -r
4.14.0-kali3-amd64

lshw showed the weird ??? at driver but whatever.

Thank you kimocoder at this point.

At this point the Mode is "Auto," and no programs or scripts recognize the adapter as being in Monitor mode. Albeit, this process you gave DID allow my adapter to be recognized as an interface, but the problem i described was unchanged.

Hi, everybody. I have TP-LINK WN722N V.3.0, and this manual is working for it. But I have a question. After changing of driver, the device works in monitor mode. And does it support injections after such upgrade? Will be thankful for answer.

It worked for a moment.
I could set monitor mode and even scan signals with airodump, but it crashed after some minutes and I couldn't get it back again (maybe I could, resetting the VM, but I decided to return the product and buy another device).