In seguito ad un richiesta di un’user del forum, Icecool si è messo al lavoro e in un solo giorno ci ha regalato questa
dettagliata guida per impostare in maniera permanente i parametri di connessione lan o wifi sulla nostra amata
Back|Track2. vi rimando alla lettura completa dell’articolo, ricordandovi il nostro ottimo Forum thanks icecool!
Come configurare una connessione ad un Access Point con la nostra scheda di rete su BT2 in maniera permanente .
Ciao a tutti , allora partiamo dal presupposto che abbiate BT2 installato sull’Hd , puoi configurare la tua scheda di rete
per usarla su un Network ( fattibile anche su BT2 installato su PenDrive ). Si puo fare anche sè usi una distro live ma
dovrai riconfigurare il tutto ad ogni riavvio , ci sono molti modi per configurare una scheda ma quello che vedremo quì e
quello più comune per tutte le distro .
Per accedere alla tua scheda ethernet (LAN):
ifconfig eth0 up
eth0 è il nome della scheda , questo può però essere diverso a seconda dell’ hardware che hai installato .
Per avere una lista delle schede digita :
ifconfig -a
In questo modo potrai vedere tutte le schede (-a) .
Per avere assegnato un indirizzo automatico DHCP dal DHCP server:
dhcpcd eth0
Questo funzionerà solo sè è presente un unica scheda e la tua scheda è eth0 o qualsiasi essa sia , sè nò configurerà tutte
le schede compatibili presenti allo stesso modo .
NOTA: Auditor ha uno script chiamato ‘pump’ che genera lo stesso processo .
Ora controlla sè hai un indirizzo ip:
ifconfig eth0
Dovresti vedere un indirizzo ip , da qualche parte .
Sè vuoi impostare un ip statico al posto di uno dinamico :
ifconfig eth0 192.168.1.2
O qualunque ip tu voglia ! Sè vuoi una subnet mask diversa :
ifconfig eth0 192.168.1.2 netmask 255.255.255.224
Adesso associamo la scheda all’ ip default gateway:
route add default gw 192.168.1.1 eth0
Naturalmente l’ip del Access Point deve essere quello giusto , così come specificare la scheda non è sempre necessario
.
Assegnare manualmente il DNS servers:
echo nomeserver 192.168.1.1 > /etc/resolv.conf
echo nomeserver 212.135.1.36 >> /etc/resolv.conf
Nota il primo comando riscriverà (>) il resolv.conf file, il secondo comando attaccherà (>>) ‘nomeserver 212.135.1.36’ alla
fine dello stesso!
Tutto questo come già detto potrebbe essere fatto automaticamente con DHCP comunque, verificalo:
cat /etc/resolv.conf
..:: http://www.WiFi-ita.com – La prima Community Italiana sul WiFi! ::..
http://www.wifi-ita.com Realizzata con Joomla! Generata: 12 May, 2009, 19:39
Questo comando ti fà vedere il contenuto di /etc/resolv.conf file.
Per cambiare il tuo indirizzo ip DHCP sè è stato già assegnato ad un’altra scheda , devi cancellare il DHCP file assegnato
alla scheda:
rm /etc/dhcpc/dhcpcd-eth0.pid
Attravesro questo potrai fare dei cambiamenti di impostazioni base sulla tua scheda !
Schede Wireless.
Le schede wireless sono molto differenti tra loro a seconda del chipset che hanno e non tutte si prestano a tutti i tipi di
attacco .
Adesso andremo a vedere i comandi generici per settare e configurare un’interfaccia wireless .
Usiamo un termine generico per la nostra interfaccia , nel nostro caso eth0 anche sè potremo trovarla con un nome
diverso a seconda del chipset che monta , di seguito una lista di possibili interfacce che possiamo trovare :
ath0
wlan0
wifi0
eth0
Abbiamo bisogno di capire quale è la nostra e quindi inviamo il seguente comando :
iwconfig -a
Questo ci fara vedere tutte le interfacce presenti nel nostro pc ma solo quelle wireless avranno al loro seguito delle
informazioni dettagliate .
” Accendiamo la nostra interfaccia :
ifconfig eth0 up
Come connettersi ad un Acces Point ‘open’ wireless access point (Access Point):
iwconfig eth0 essid ‘nomenetwork’
Il ‘nomenetwork’ è il tuo Service Set IDentifer (SSID).
Per configurare una chiave Wep :
iwconfig eth0 key 3B5D3C7D207E37DCEEEDD301E3 ( chiave scritta a caso , ognuno metterà la chiave wep giusta
naturalmente )
Per connettersi ad un Acces Point :
iwconfig eth0 Access Point ff:ff:ff:ff:ff:ff
Dove ‘ff:ff:ff:ff:ff:ff’ è il MAC address dell’ Access Point, meglio conosciuto come Basic Service Set IDentifier (BSSID).
Una volta settata la connessione , puoi avere il tuo DHCP address:
dhcpcd eth0
Quindi puoi verificare sè ti viene attribuita un Ip dal wireless network.
Cosa facciamo invece sè il nostro network utilizza il WPA ?
Dobbiamo riassegnare l’ ESSID e il MAC dell’ Access Point , Quindi :
Creiamo un file di testo chiamandolo wpa_supplicant.conf , tutto quello che segue dovrà essere scritto all’interno del file di
testo così com’è , oppure un copia incolla , onde evitare errori di battitura , abbiamo due possibili opzioni :
..:: http://www.WiFi-ita.com – La prima Community Italiana sul WiFi! ::..
http://www.wifi-ita.com Realizzata con Joomla! Generata: 12 May, 2009, 19:39
Questa è la prima :
network={
essid=”nomenetwork”
key_mgmt=WPA-PSK
proto=WPA
pairwise=TKIP
group=TKIP
psk=”WPApassphrase”
}
Dove il nomenetwork è il tuo essid e psk è la tua chiave WPA pre-shared key!
Questa è la seconda : PERMANENTE !
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
eapol_version=1
# ap_scan=2 was the one for me you may try 0 or 1 indstead of 2
ap_scan=2
fast_reauth=1
network={
ssid=”NimeNetwork”
proto=WPA
key_mgmt=WPA-PSK
pairwise=TKIP
group=TKIP
psk=”Chiave”
}
Quindi lanciamo il wpa_supplicant tool.
wpa_supplicant -D madwifi -i eth0 -c wpa_supplicant.conf
Questa stringa necessita di alcune piccole modifiche a seconda del chipset della scheda usata in questo caso il
comando è per un chipset Atheros.
Questi comando che seguono ci danno la possibilita di salvare all’interno del nostro BT2 l’autenticazione alla rete WPA
quindi procediamo come segue : ( PERMANENTE )
Copia il file di testo wpa_supplicant.conf appena creato in /etc directory ,
nella stessa directory c’è una cartella chiamata dhcpc , la locazione è la medesima , /etc/dhcpc folder e CANCELLATE
TUTTO !
Ora mandiamo questi comandi :
bt ~ # chmod 777 /etc/wpa_supplicant.conf
bt ~ # wpa_supplicant -w -Dwext -eth0 -c/etc/wpa_supplicant.conf
Adesso dovremo vedere qualcosa tipo :
bt ~ # wpa_supplicant -w -Dwext -eth0 -c/etc/wpa_supplicant.conf
Trying to associate with SSID ‘NomeNetwork’
Associated with FF:FF:FF:FF:FF:FF
WPA: Key negotiation completed with FF:FF:FF:FF:FF:FF [PTK=TKIP GTK=TKIP]
CTRL-EVENT-CONNECTED – Connection to FF:FF:FF:FF:FF:FF completed (auth) [id=0 id_str=]
Digitiamo poi di seguito :
dhcpcd eth0 ( o qualsiasi sia la tua scheda )
Dovremo vedere un “pop-up” da qualche parte nel monitor che ci dice “KDE Network Monitoring…Connection
Established!”
..:: http://www.WiFi-ita.com – La prima Community Italiana sul WiFi! ::..
http://www.wifi-ita.com Realizzata con Joomla! Generata: 12 May, 2009, 19:39
Possiamo anche usare l’opzione -b nella stringa :
bt ~ # wpa_supplicant -w -Dwext -eth0 -c/etc/wpa_supplicant.conf
Che diventerà :
bt ~ # wpa_supplicant -w -Dwext -iath0 -B -c/etc/wpa_supplicant.conf
Il programma lavorerà in background e quindi avremo una risposta immediata dalla shell tipo :
bt ~ #
nonostante il programma stia ancora lavorando
Mettere la scheda in monitor mode:
iwconfig eth0 mode monitor
Per assegnargli un canale di connessione specifico :
iwconfig eth0 channel XX
Qualche volta sempre a seconda del chipset è possibile che assegnando un canale di una cifra si venga dirottati
automaticamente sul canale 11 .
Guida in inglese
Network Interfaces
So you have Backtrack running installed on a HDD, you can now configure your cards to use the network. You can also do this exactly the same if you are running the distro from the CD, but your settings will not be saved as the CD is a read only medium. There are plenty of different ways to configure these wired cards and plenty of tools to do it. What I am showing here is the generic Linux commands which should be the same for other distro’s.
To turn on your ethernet network card (LAN):
ifconfig eth0 up
The eth0 is the name of the card, this could change depending on what hardware you have installed. To get a list of all adapters: ifconfig -a
This will list all (-a) interfaces.
To get DHCP to assign a network address automatically from the DHCP server:
dhcpcd eth0
This will run it only on eth0, if you omitted the interface you would run the DHCP discovery process on all compatible cards.
Then check if you have an address:
ifconfig eth0
You should see an IP address in there somewhere.
If you want a static IP address instead of a dynamic one:
ifconfig eth0 192.168.1.2
Or whatever IP you want! If you want a variable subnet mask (beyond the scope of this thread!):
ifconfig eth0 192.168.1.2 netmask 255.255.255.224
To manually add a default gateway:
route add default gw 192.168.1.1 eth0
Of course you would replace the IP address with your default gateways, also the eth0 interface is not always needed!
To manually assign your DNS servers:
echo nameserver 192.168.1.1 > /etc/resolv.conf echo nameserver 212.135.1.36 >> /etc/resolv.conf
Note that the first line will OVERWRITE (>) the resolv.conf file, the second command will APPEND (>>) ‘nameserver 212.135.1.36’ onto the end of it!
All of this may have been done for you automatically with DHCP anyway, so to check:
cat /etc/resolv.conf
This will display to you the contents of the /etc/resolv.conf file.
To change your DHCP address if it has already been assigned you need to delete the DHCP file assigned to the card:
rm /etc/dhcpc/dhcpcd-eth0.pid
Although that may change based on the interfaces you have!
Then run the dhcpcd command again.
Howto: How to configure your Network Card
WIRELESS CARDS
Wireless cards.
Wireless cards are very different based upon what chipset you have. I personally use Atheros chipset cards which has screwed me up a bit with BackTrack as it has problems with using them for certain attacks.
What I will again show is generic commands for setting up and configuring your wireless interfaces.
The interface name (ath0 below) is entirely dependant on what chipset you are using, you may have any of the following:
ath0 wlan0 wifi0 eth0
You need to find out what you have. To do this you should execute the following bash command:
iwconfig -a
This will show all wireless extension on your machine. You should see all of your network interfaces, but only the wireless ones will have detailed information next to it. Now you know what your wireless cards name is…
Switch on your wireless card:
ifconfig ath0 up
To connect to an ‘open’ wireless access point (AP):
iwconfig ath0 essid ‘nameofnetwork’
The ‘nameofnetwork’ is your Service Set IDentifer (SSID). That is the name of your network.
To configure a WEP key:
iwconfig ath0 key 3B5D3C7D207E37DCEEEDD301E3
To connect to a specific AP:
iwconfig ath0 ap 03:27:A8:BC:0F:F1
Where ’03:27:A8:BC:0F:F1′ is the MAC address of your AP, also known as the Basic Service Set IDentifier (BSSID).
Once you have setup your connection, you can get a DHCP address:
dhcpcd ath0
Then check that you have an IP from the wireless network.
To Configure a WPA key:
But what if the network uses WPA? Again you need to assign the essid and maybe an AP MAC, then:
Create a text based file called wpa_supplicant.conf
Enter the following:
“”network={ ssid=”nameofnetwork” key_mgmt=WPA-PSK proto=WPA pairwise=TKIP group=TKIP psk=”WPApassphrase” }
Where nameofnetwork is your ssid and psk is your WPA pre-shared key!
Then run the wpa_supplicant tool.
wpa_supplicant -D madwifi -i ath0 -c wpa_supplicant.conf
This will need altering depending on what chipset and drivers you are using. The above should work for an Atheros card.
Saying all of the above about WPA configurations, I have had many problems with it on BackTrack. If someone else has other suggestions, please post here. Also, please post setup commands for other types of wireless cards.
Alternate Method for WPA key use:
As a pre-thought I have a Dell wireless adapter that uses a Broadcom chipset. I’m using BT2 Final on a USB key.
Create the text based file called wpa_supplicant.conf
Enter the Following: network={
ssid=”nameofnetwork”
key_mgmt=WPA-PSK
psk=”passkey”
}
where nameofnetwork is the ssid of your network, and passkey is your password.
Make sure your wireless adapter is enabled, and assign your IP, etc addresses if needed. Then run wpa_supplicant. You don’t need to assign an essid or MAC AP to your wireless adaptor.
I used wpa_supplicant -ieth0 -cwpa_supplicant.conf -B
Again, replace eth0 with your wireless adapter. If you run iwconfig you should see a key associated with your adapter card.
If you didn’t assign any static addresses run your dhcpcd.
dhcpcd eth0
This should have you on the internet in no time. 🙂
All in all, it turned out with the previous method I was providing too much information at specific points, and that just dumbing down the commands I used made it work consistently. Hopefully, if you’ve been having problems, this helps.
To put your wireless card into monitor mode:
iwconfig ath0 mode monitor
To restrict it to one specific channel:
iwconfig ath0 channel XX
Make sure you use a two figure number, channel 1 tends to put you on channel 11 for some reason!
Again, they are for Atheros cards, other cards have other commands.
I hope this has helped people in understanding a little more about the configuration settings for their wireless cards. Don’t forget the wlassisstant tool on BackTrack too.
Originally posted by Xatar @ http://forums.remote-exploit.org/showthread.php?t=1489
Filed under: 1 | Tagged: backtrack2, backtrack3, backtrack4, card, configurare, configure, dhcp, Lan, Lan/wifi, network, periferiche | Leave a comment »