PDA

View Full Version : Cannot connect to ap from command line



nuke_dukem
2013-08-15, 17:21
Hello all. I just installed Kali on my hard drive using a bootable usb stick with the 64 bit iso. I can connect to a wireless router using the graphical interface with no problem. However, when trying to connect from the command line using: iwconfig wlan0 essid <essid of router> key<hex key> , then: dhclient wlan0, the cursor hangs. Eventually the ping statistics show 0 packets received and 100% loss. I've tried setting static ips and I still can't connect from the command line. Once again, using the graphical interface allows me to connect fine. I suspect I need to configure a file. Any advice? Thanks.

charonsecurity
2013-08-17, 07:30
To list available wifi:

iwlist scan

Then connect to the right hotspot:


ifconfig wlan0 up
iwconfig wlan0 essid "mywifiw"
iwconfig wlan0 key xxxxxxxx
dhcpcd wlan0

I don't believe you need to convert your key to the hex equivalent.
Also trying to connect via command line while network manages are running are unlikely to work, so you may want to stop that service beforehand.

system_crash
2013-08-17, 08:06
If you are using WPA/WPA2 encryption that won't work... Try this: http://ubuntuforums.org/showthread.php?t=571188

Rocketballz
2013-08-17, 09:31
Have you plugged your computer directly, boot into kali, open a browser and type your Network address and configure the access point? That helped for me at least

leevai
2013-08-20, 14:12
wep works with # iwconfig wlan0 essid "yourssid" key xxxxx
In case of WPA the matter is more complicated. The iwconfig utility can not be used. You need the tool WPA_supplicant and create a configuration file.
that you will need to invoke