offensive-security / kali-nethunter

The Kali NetHunter Project
https://github.com/offensive-security/kali-nethunter/wiki
3.48k stars 890 forks source link

TP LINK WN722N v1 not detected #1274

Closed shakim24 closed 5 years ago

shakim24 commented 5 years ago

Device:

Samsung Galaxy s5

OS version (KitKat/Lollipop/Marshmallow/Nougat):

Nougat

Built from repo (date and build command) or downloaded from website (links):

Installed from magisk module

Output of cat /proc/version in adb shell or NetHunter Terminal:

N/A

Issue:

So my TP LINK WN722N v1 gets recognized when I type the command lsusb in nethunter, but I can't put it in monitor mode. when I ran wifite I don't see wlan1 which should be for my adapter. All I see is wlan0 and that's for my actual WiFi connection. Iwconfig comes up empty also. My adapter firmware is installed so I'm not sure what else I can do. My device is Samsung Galaxy S5. My kernel is edited for my device as well. Here is the dmesg result, https://pastebin.com/ykBHP1QV. I also copied the firmware-atheros from the root of nethunter to the root of my device and got this dmesg result, https://pastebin.com/t981uLsF. When I run lsusb in the root of my device I see the device ID, but it doesnt show I the root of Kali-nethunter. I'm still trying to troubleshoot the issue.

shakim24 commented 5 years ago

Anybody????

0E800 commented 5 years ago

Dude... Too much info.

Turn on device without tplink connected. After device is booted, type dmesg. Then wait 30 seconds and type dmesg again. Hopefully you dont have 1000 lines of messages in 30 seconds. I dont want to read all of your dmesg on my tiny phone screen.

Now plug in your tplink , dont do anything for 5 seconds and type dmesg. Pastebin ONLY the part about your device. It shouldn't be more than 30 lines. Then take out the tplink and after 5 seconds do dmesg again. Only pastebin the lines regarding your device being unconnected.

Do not paste a 300kb log. Just the relevant info and I'll see what I can gleam from it

shakim24 commented 5 years ago

Bro, this is my 1st time running a dmesg from a device so chill.

yesimxev commented 5 years ago

What does the lsusb -t give for you? Also, is it sure that you have a V1? And have you tried the airmon or iwconfig to pit in monitor mode?

0E800 commented 5 years ago

Speaking of the obvious, I am not your bro. The name of your pet fish was apparent from the original post, Think if I was gonna haze a greenie I would have spend the effort to press the keyboard buttons as much offering to help? Instead of doing what I suggested you broke out with your feelings calculator and thought what? Get some sympathy points?

Hackers don't work for feelings, just code.

shakim24 commented 5 years ago

It's not about sympathy points at all, BRO lol. You just feel you can talk to people any kinda way because your behind a keyboard. And how did you know I didn't do as you suggested, you just assumed. Yes it's all about helping people but you can also speak to people with respect as well even if your behind a keyboard, others will probably agree. You didn't have to help, this is a open forum, you chose to help and responded. This conservation is pointless lol 🤷🏽‍♂️🤷🏽‍♂️. Thread closed lol.

yesimxev commented 5 years ago

I'm interested for the solution, I have an S5 too, but not with TP-Link So, what does the lsusb -t give for you? Also, is it sure that you have a V1? And have you tried the airmon or iwconfig to put in monitor mode?

emprise1976 commented 5 years ago

On Nexus 5 I get Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M | Port 1: Dev 2, If 0, Class=, Driver=hub/4p, 12M | Port 1: Dev 3, If 0, Class=, Driver=ath9k_htc, 12M

Attached with powered otg cable

emprise1976 commented 5 years ago

[ 852.360804] hub 2-0:1.0: 1 port detected [ 852.668826] bq24192_external_power_changed: usb host mode = 1 [ 852.669829] bq24192_enable_otg: otg enable = 1 [ 852.676250] usb 1-1: new full-speed USB device number 2 using xhci-hcd [ 852.696471] usb 1-1: New USB device found, idVendor=05e3, idProduct=0606 [ 852.696730] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [ 852.697141] usb 1-1: Product: USB Hub 2.0 [ 852.697369] usb 1-1: Manufacturer: ALCOR [ 852.704340] usb 1-1: ep 0x81 - rounding interval to 1024 microframes, ep desc says 2040 microframes [ 852.751230] hub 1-1:1.0: USB hub found [ 852.753010] hub 1-1:1.0: 4 ports detected [ 853.034928] usb 1-1.1: new full-speed USB device number 3 using xhci-hcd [ 853.067087] usb 1-1.1: not running at top speed; connect to a high speed hub [ 853.069436] usb 1-1.1: New USB device found, idVendor=0cf3, idProduct=9271 [ 853.069871] usb 1-1.1: New USB device strings: Mfr=16, Product=32, SerialNumber=48 [ 853.070289] usb 1-1.1: Product: USB2.0 WLAN [ 853.070516] usb 1-1.1: Manufacturer: ATHEROS [ 853.070745] usb 1-1.1: SerialNumber: 12345 [ 853.132179] usb 1-1.1: ath9k_htc: Firmware htc_9271.fw requested [ 853.587688] usb 1-1.1: ath9k_htc: Transferred FW: htc_9271.fw, size: 51008 [ 854.585494] ath9k_htc 1-1.1:1.0: ath9k_htc: Target is unresponsive [ 854.585808] Failed to initialize the device [ 854.607144] usb 1-1.1: ath9k_htc: USB layer deinitialized[ 856.410308] init: Untracked pid 3767 killed by signal 9 [ 857.405605] init: Untracked pid 3890 killed by signal 1

kimocoder commented 5 years ago

I'll check ny Nexus 6P Android 8.1 status og the adapter shortly. Awaiting on a new OTG as the y-cable required some modifications. tba

yesimxev commented 5 years ago

It seems like the wlan driver is fine, loaded. But the Y cable could be not working with the current kernel. Just to make sure your wlan adapter works, try to unplug the Y cable. Turn off Y cable service. Plug back the cable with the wlan adapter only. It usually works without charging this way.

On my OPO, the feature works only when I unplug the cable, turn the service on, the plug back with the adapter+charger already connected.

emprise1976 commented 5 years ago

If I use an OTG Adapter Only the device will not come up

yesimxev commented 5 years ago

It should come up with that, have you tried other/older kernels? Then make sure Y cable service is off/reboot device maybe to let Y be off all the time. Have you tried the Y calbe disconnecting/service turning on off as I mentioned above?

emprise1976 commented 5 years ago

Same behavior as with the Y-Cable. Kernel is 3.4.0-g6af4dfa Chris from 2017

emprise1976 commented 5 years ago

Which kernel would you recommend for a Nexus 5 with LineageOS 7.1.2?

yesimxev commented 5 years ago

Try this one latest. It is on LineageOS 14.1 I guess https://build.nethunter.com/nightly/2019.03-13-0514/kernel-nethunter-klte-nougat-2019.03-13-0514.zip At the moment, I am using this though, as I didn't update since. https://build.nethunter.com/nightly/2017.11-18-1618/kernel-nethunter-klte-nougat-2017.11-18-1618.zip

pixelwasser commented 5 years ago

@yesimxev Shouldn't it be https://build.nethunter.com/nightly/2019.03-13-0514/kernel-nethunter-hammerhead-nougat-2019.03-13-0514.zip for the NEXUS 5?

What is the difference between hammerheadcafcm-nougat hammerheadcm-nougat and hammerhead-nougat?

yesimxev commented 5 years ago

Yes sorry I messed up, thought about a the S5 in the thread, did't read yours tbh. So yes. Not sure about. If it is not CyanogenMod, then check codenames https://twrp.me/Devices/ I would go with hammerheadcm-nougat as 14.1 is so called CM @pixelwasser but you can try all shouldn't mess up anything

shakim24 commented 5 years ago

@yesimev I'm using v1 of the WN722N model, you might have missed it in the OP. So I noticed something weird. Maybe it's the way I edited my kernel but the module.dep.bin directory that's needed to run modprobe is empty in the system/lib/modules directory. My kernel is lineageOS 7.1.2. I'm going to try a netunter kernel and see if there are any changes. On a side note, for those who are having a hard time getting nethunter to recognize your adapter, I edited macchanger to wlan1, tapped refresh, and all was good.

yesimxev commented 5 years ago

@shakim24 Just wanted to double check the V1. I see. Soo you have atheros as a module. I enable them with *

Anyway, with rfcomm, I had the same, then realised that I need to make the modules in the kernel sources folder with eg.

mkdir ~/modules
make modules_install INSTALL_MOD_PATH=~/modules/ 

then copy the ~/modules/lib/modules folder into the nethunter installer devices/klte folder next to the Image/zImage.dtb to get it included automatically. You can delete build and sources symlink from that folder. There might be a better way to achieve this though but at least works

shakim24 commented 5 years ago

@yesimxev yeah I have the atheros modules installed. So your running the nougat klte nethunter kernel I assume right?

yesimxev commented 5 years ago

Yes, and modprobe works me out of the box from build.nethunter.com/nightly So did you make the kernel modules, and installed into the nethunter kernel zip?

shakim24 commented 5 years ago

Well what I did was I built lineageOS for the s5 with the modified kernel, clearly that didn't work. So I'm just going to start fresh, revert back to stock, and reinstall everything with the nightly nethunter klte kernel and see what happens.

0E800 commented 5 years ago

You got all your drivers built and your firmware? Example:

Imgur

emprise1976 commented 5 years ago

If install the Firmware manually via apt install firmware-ath9k-htc I'll get the message that Firmware 1.4 ist installed and that I should Update to Firmware 1.3

yesimxev commented 5 years ago

What does the following give to you with your kernel? modprobe ath9k_htc

After you have done this: So did you make the kernel modules, and installed into the nethunter kernel zip as I suggested above? That will put the modules into your modules folder on the phone eg. on mine into /lib/modules/3.10.61-yesimxev-g90f94721dfb-dirty/ Even if it doesn't work, modules should be able to enable with modprobe.

Also, why not try to enable the wlan driver with * just for testing?

emprise1976 commented 5 years ago

e# modprobe ath9k_htc modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/3.4.0-g85d04d0/modules.dep.bin' modprobe: FATAL: Module ath9k_htc not found in directory /lib/modules/3.4.0-g85d04d0

yesimxev commented 5 years ago

Do the modules get installed when you install the kernel with twrp? Like this

yesimxev commented 5 years ago

Screenshot_2019-03-29-03-06-58

yesimxev commented 5 years ago

If the above is the same on yours, what does the ls /system/lib/modules mkdir /lib/modules/test do for you?

yesimxev commented 5 years ago

Kind of reproduced the issue, on my phone, the system is not mounter properly. I can see all the modules (and everything in /system) in the TWRP /system/lib/modules but nothing in NH terminal

emprise1976 commented 5 years ago

I didn't compiled a kernel myself therefore I used the prebuild kernel from https://build.nethunter.com/nightly/2019.03-13-0514/ Also I don't have any kind of modules in /System/lib/modules

yesimxev commented 5 years ago

Can you see anything in /system? ls /system

emprise1976 commented 5 years ago

oot@kali:~# ls /system addon.d build.prop fonts lost+found recovery-from-boot.bak vendor app etc framework media tts xbin bin fake-libs lib priv-app usr root@kali:~#

yesimxev commented 5 years ago

And are the modules getting installed as on my screenshot above when you are installing the kernel? Did you also try hammerheadcm-nougat kernel?

emprise1976 commented 5 years ago

Yes, I usesd the hammerheadcm-nougat kernel, but I get the message during install no kernel modules found skipping

yesimxev commented 5 years ago

I see, then that does not have any modules. They should be included in the nethunter-installer/devices/nougat/hammerheadcm next to the Image as I mentioned above. I guess it is not there

On Fri, Mar 29, 2019, 11:58 emprise1976 notifications@github.com wrote:

Yes, I usesd the hammerheadcm-nougat kernel, but I get the message during install no kernel modules found skipping

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/offensive-security/kali-nethunter/issues/1274#issuecomment-477956981, or mute the thread https://github.com/notifications/unsubscribe-auth/AWidlgVEMxY6YqIy9rI1d0yKVzVpiWwrks5vbfHogaJpZM4cJZhq .

emprise1976 commented 5 years ago

Is there an how to to build my own kernel including HID Patch?

yesimxev commented 5 years ago

@emprise1976 https://github.com/offensive-security/kali-nethunter/issues/1212#issuecomment-430357114

The only difference is that your patched kernel source can be found in kernels.txt so you should be ok to make kali_defconfig and does not need to start from 0

shakim24 commented 5 years ago

@yesimxev how did you load the drivers for the s5🤔🤔. The modprobe command is throwing errors saying it can't find the modules.dep.bin but it's in the directory so I'm not sure why it can't find it. The nethunter kernel was flashed fine and all the files are in for etc/firmware directory unlike previously.

yesimxev commented 5 years ago

@shakim24 modules should be in /lib/modules Anything in there? I just put them into the nh installer devices and build an installable zip as shown wayback above. What is your NH app version btw?

shakim24 commented 5 years ago

Yes my modules are in there. My NH version is 2017.10 installed by magisk module. The zip file your referring to that I need to create is this "mkdir /lib/modules/test"? And where is NH installer, what directory?

yesimxev commented 5 years ago

hmm I didn't work with magisk yet Try ln -s /system/lib/modules /lib/modules if that is already there there must be a minor issue. Is it even a module to be loaded? Not a driver with * in menuconfig?

To create the zip. Make the kernel, put the Image and modules folder into the nh-installer/devices/nougat/klte folder and run build.py -k -n -d klte Then flash the created zip file

shakim24 commented 5 years ago

So you flash the nethunter nightly rom then. Every time I try to flash it I get a "updater process error 1" error.

Edit: @yesimxev the previous post you just listed it seems that for building a kernel if I'm mistaken. The kernel I'm using right now is a NH nightly for the s5. The last time built a kernel it wasn't modified correctly so I was kinda screwed. But I've gotten further with the nh nightly kernel. As for the commands you suggested I run, in root@kali nothing showed up. But I did find it in root explorer. I'm still curious as to why I'm getting a error when I run modprobe 🤔🤔.

Edit 2: so all is well. I ran modprobe and my driver's are installed and in monitor mode. I'm not sure what I did to get modprobe to work without errors, probably a bug in nethunter, I'm not sure. But my WN722N light is blinking, all is good.

yesimxev commented 5 years ago

I meant to flash your custom kernel with modules by copying it into nethunter installer devices tree. You did get error still, because it seems that the modules were not included in the nightly.

Great, probably because of they are installed now properly - is it your custom kernel now? If not, then nightly had the modules

shakim24 commented 5 years ago

No it's the nightly kernel. I was also getting a modprobe error with the nightly kernel as well so it's probably a bug. Is there a driver for MT7610U chipset compatible with nethunter? The ones I've seen are for only kernels that are for v4 or higher, mine is 3.14.