PDA

View Full Version : wifi connection on external adapter (nexus 7, android)



m4xx3d0ut
2013-08-11, 12:12
this is for anyone who would like to initiate a network connection in android from a usb wifi adapter instead of the internal bcom of the nexus 7, other android devices should be similar.

your going to need to make a copy of your wpa_supplicant.conf. this, as we know, holds general configuration data for wpa_supplicant as well as informations about your access points and authentication. the path on nexus 7 is /data/misc/wifi/wpa_supplicant.conf. so copy it in root browser and rename it to wlan1_supplicant.conf. or from a terminal as root...

$ cp /data/misc/wifi/wpa_supplicant.conf /data/misc/wifi/wlan1_supplicant.conf

next you have to edit the file for wlan1, so edit it as text file in root browser or from terminal using vi or nano. the first line of the file will look like

ctrl_interface=wlan0

you have to change it but specify the complete path of the socket, like this

ctrl_interface=/data/misc/wifi/sockets/wpa_wlan1 GROUP=system

now plug in your adapter, in this case im using a tl-wn722n, and with you internal wifi off open up a terminal and run this as root (android root, not chroot)

$ wpa_supplicant -iwlan1 -c/data/misc/wifi/wlan1_supplicant.conf

the lights on your adapter should be going crazy now, you wont see a wifi icon in the ui however. now you may need to configure dhcp, so open another terminal window and run as root.

$ dhcpcd wlan1

then to test you can

$ netcfg

this will output your ip address and status of your interfaces, you can also ping your router, something like

$ ping 192.168.1.1

and you will get responses back. the key here is using the explicit path to the socket and specifying the group as system, android secures itself through privilege seperation in which each application uses different user and goup id's. if you were to run wpa_supplicant from chroot you could achieve a connection and ip but it would be unusable (at least in my experience) as it does not have correct permissions. but now you can chroot into kali and go nuts!

three_legs
2013-08-13, 17:47
Are you on a kali chroot or full install? Also, how did you get the drivers for your external wifi device. I am using an ALFA