Remote Exploit Forums

Go Back   Remote Exploit Forums > Archives > BackTrack v2.0 Final > Tutorials & Guides


Tutorials & Guides Contributions welcome! Please check the rules & guidelines for posting

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-15-2006, 05:18 PM
Senior Member
 
Join Date: Feb 2006
Location: Edinburgh, Scotland.
Posts: 185
Default Howto: Configure Network Cards

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.

NOTE: Auditor has a script called 'pump' which will do the same process.

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.

I will post generic instructions for wireless cards soon.

Hope this helps the new guys!

later,
__________________
Xatar

000xatar000
Give a man a fire, and he'll be warm for a day. Set the man on fire, and he'll be warm for the rest of his life.

They did give a million monkeys a million typewriters, it's called the internet.
Reply With Quote
  #2 (permalink)  
Old 05-15-2006, 05:19 PM
Senior Member
 
Join Date: Feb 2006
Location: Edinburgh, Scotland.
Posts: 185
Default Howto: Configure Network Cards 2

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.




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={
essid="nameofnetwork"
key_mgmt=WPA-PSK
proto=WPA
pairwise=TKIP
group=TKIP
psk="WPApassphrase"
}


Where nameofnetwork is your essid 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.




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.

If you notice any errors in the above commands, please post.
If you want to post other commands, please do!

later,
__________________
Xatar

000xatar000
Give a man a fire, and he'll be warm for a day. Set the man on fire, and he'll be warm for the rest of his life.

They did give a million monkeys a million typewriters, it's called the internet.
Reply With Quote
  #3 (permalink)  
Old 07-31-2006, 12:40 PM
Member
 
Join Date: Jul 2006
Posts: 74
Default This really needs to be a sticky

Bump

This really helped me when I first started w/ Back Track

Perhaps it will help others


The search button works wonders!
Reply With Quote
  #4 (permalink)  
Old 07-31-2006, 02:31 PM
thorin's Avatar
Senior Member
 
Join Date: Feb 2006
Location: Northern Hemisphere
Posts: 2,445
Default

There are great instructions in this thread:
http://forums.remote-exploit.org/showthread.php?t=1268

for automating DHCP and NIC config. (Make sure you read the whole thread as there's a revised version of the script part way through and a lot of questions are answered).
Reply With Quote
  #5 (permalink)  
Old 01-26-2007, 11:22 PM
renn3r's Avatar
Member
 
Join Date: Jan 2007
Posts: 41
Default

Hi all.
I'am new on this forum and I need some help.
I did evrything as you say, but still having problem.

I did this :

ifconfig eth0 up
ifconfig -a
dhcpcd eth0
ifconfig eth0

than you say : You should see an IP address in there somewhere.

But I get this :


I tryed this on backtrack 2.0 and auditor , and I get same problem, I run it from boot cd , direct and on Parallels.
Evrything is all right till I type in pump (on auditor) or dhcpcd eth0 (in backtrack2) than auditor say Operation failed , on backtrack nothing hapens.
I tryed to input DNS before this command , but still nothing.
When I input ifconfig -a , I get
eth0 (with no IP) and lo (with local ip 127.0.0.1).
When I input ifconfig eth1 up , I get :
eth1:ERROR while getting Interface flags : No such device.
I have dynamic IP , Callisto 821 DSL router and I don't use wireless.
On XP when I connect to Internet I must input PPPoE (username,pass,DNS).

Can you please help me with this ?

Last edited by renn3r; 01-27-2007 at 10:58 AM.
Reply With Quote
  #6 (permalink)  
Old 01-27-2007, 09:23 AM
Member
 
Join Date: Nov 2006
Posts: 55
Default

thanks for this howto pin this plzzzz

Last edited by hyeclass; 01-27-2007 at 02:30 PM.
Reply With Quote
  #7 (permalink)  
Old 01-27-2007, 05:39 PM
renn3r's Avatar
Member
 
Join Date: Jan 2007
Posts: 41
Question

Nobody don't know how to fix this ?
Reply With Quote
  #8 (permalink)  
Old 01-28-2007, 10:25 PM
Member
 
Join Date: Nov 2006
Posts: 55
Default

donno what ur talking about but i also got connected with my dwl-g122 but couldnt surf, so i called dlink they told me somethign about the wpa-supplicant so try that... i havent had time
Reply With Quote
  #9 (permalink)  
Old 01-30-2007, 08:49 AM
renn3r's Avatar
Member
 
Join Date: Jan 2007
Posts: 41
Default

Now I know how to.

To help others with same problem , for DSL connection and dynamic IP.

Input this command : pppoe setup // works 100%

THX for help.
Reply With Quote
  #10 (permalink)  
Old 02-04-2007, 01:32 PM
Senior Member
 
Join Date: Apr 2006
Posts: 155
Default

Just a thing that i didn't understand: i've manually configured my cards, but everytime i reboot, the dhcpd commands are executed (a dhcpd for each card). How can i disable this and make the configurations permanent?

Again...sorry for my english!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 11:49 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2