Author Topic: Connect To Net via cli BB3  (Read 6222 times)

ltdan

  • Guest
on: April 27, 2013, 10:55:52 PM
CLI - Connect to a wireless network via command line.

You may have to:
service network-manager stop

For wep:
if using eth0, wlan0 or wlan1 substitute

ifconfig wlan0 down
iwconfig wlan0 essid AP_NAME
iwconfig wlan0 key AP_KEY
ifconfig wlan0 up
dhclient wlan0
check status:
iwconfig wlan0
or
ping -c3 www.google.com

to scan:
iwlist scan
check hardware:
lspci | grep -i net

For WPA:
go to /etc/dbus-1/system.d
make a copy of wpa_supplicant file
then go back to that file and config like this:
Code: [Select]
network={
            ssid="ssid_name"
             psk="password"
}

leave the "" just enter yer AP and pass, delete everything else
save exit
from cli:
wpa_supplicant -B -Dwext -iwlan0 -c/etc/dbus-1/system.d/wpa_supplicant.conf -dd
then: dhclient wlan0
use the commands above to check status etc.

lt

Note: while ifconfig wlan0 down you can also do:
macchanger -r wlan0
ifconfig wlan0 promisc
or
ifconfig wlan0 hw ether 00:11:22:33:44:55


thanx ZEROF  :)

Another update 05.08.13
if you are connecting to a hidden ssid,
you need to add ssid_scan=1 to the wpa_supplicant.conf file
i went into my router, took my ssid off broadcasting, didn't realize it'd
mess the wpa_supplicant up, coz couldn't get dhclient to connect
so added the scan to the config was good to go
« Last Edit: May 08, 2013, 07:50:59 PM by ltdan »



ZEROF

  • Hero Member
  • *****
  • Posts: 1247
    • View Profile
    • Pen Tester
Reply #1 on: April 27, 2013, 11:30:36 PM
Hi bro,

Thanks for share. I made small update of your post for new users. CLI is used by advanced Linux users, and as we can see new Linux users using BBox too, i want to make more clear meaning of CLI to them.

Cheers !


Don't ask, read : http://wiki.backbox.org
or just run sudo rm -rf /*


b4d_bl0ck

  • Sr. Member
  • ****
  • Posts: 285
    • View Profile
Reply #2 on: April 28, 2013, 06:15:36 PM
Hey ltdan, nice one... ;)
just a couple of things:

I don't understand why you make a copy and then edit /etc/dbus-1/system.d/wpa_supplicant.conf... you can create your wpa_supplicant.conf file in /etc/ directory and edit it from scratch. Also that one looks like an automatically generated file.

Then in your /etc/wpa_supplicant.conf you can store your password encrypted, for security reasons (i guess you'd not be happy if someone browsing your files could read your password in clear text). To do this we can use wpa_passphrase tool, which will return the commented string of your password and its hashed value:
Code: [Select]
$ wpa_passphrase "Wireless_Network_Name" "Password"
network={
ssid="Wireless_Network_Name"
#psk="Password"
psk=a94c1f8015236cbd5e859c2aa0023dfb2dcc3d6a2fafff8d348588230ebb828e
}
We see in the second line the clear text password, and at the last line the string we will use in wpa_supplicant.conf file... notice the string now has no quotes.
What we need to do now is to copy the whole output into our configuration file (obviously we delete the line starting with "#") and we are done! :)
Maybe we could need to specify more options... some common ones are:
Code: [Select]
network={
   ssid="Wireless_Network_Name"
   psk=a94c1f8015236cbd5e859c2aa0023dfb2dcc3d6a2fafff8d348588230ebb828e
   key_mgmt=WPA-PSK
   proto=WPA
   pairwise=CCMP TKIP
   group=CCMP TKIP
}

Sorry for the intrusion ;D
Have fun guys!

bool secure = check_paranoia() ? true : false;


ltdan

  • Guest
Reply #3 on: April 29, 2013, 12:15:14 AM
Thanx for the info b4d_bl0ck.  Good stuff.   :)

lt