Tuesday, September 14, 2010

Tutorial: BackTrack Basics

Setting-up IP addresses

Option 1: Static IP addresses

Note: Ensure that all your Network Interface card (VM) was set to Host-only.

root@bt:~# ifconfig eth0 up

root@bt:~# ifconfig eth0 131.107.1.252/24
root@bt:~# ifconfig eth1 up
root@bt:~# ifconfig eth1 192.168.1.252/24
root@bt:~# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0c:29:5d:6a:2f
inet addr:131.107.1.252 Bcast:131.107.1.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe5d:6a2f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:64717 errors:0 dropped:0 overruns:0 frame:0
TX packets:301639 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:9873166 (9.8 MB) TX bytes:15566403 (15.5 MB)
Interrupt:19 Base address:0x2000

eth1 Link encap:Ethernet HWaddr 00:0c:29:5d:6a:39
inet addr:192.168.1.252 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe5d:6a39/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:248732 errors:0 dropped:0 overruns:0 frame:0
TX packets:6227 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:15234469 (15.2 MB) TX bytes:332024 (332.0 KB)
Interrupt:16 Base address:0x2080

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:29254 errors:0 dropped:0 overruns:0 frame:0
TX packets:29254 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:7105201 (7.1 MB) TX bytes:7105201 (7.1 MB)

Option 2: Static & Dynamic IP addresses

Note: Ensure that your 2nd Network Interface card (VM) was set to NAT or Bridge.

root@bt:~# ifconfig eth0 up
root@bt:~# ifconfig eth0 131.107.1.252/24
root@bt:~# ifconfig eth1 up

NAT configuration

root@bt:~# dhclient eth1
sniff...
Internet Systems Consortium DHCP Client V3.1.1
Copyright 2004-2008 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

Listening on LPF/eth1/00:0c:29:5d:6a:39
Sending on LPF/eth1/00:0c:29:5d:6a:39
Sending on Socket/fallback
DHCPREQUEST of 192.168.252.63 on eth1 to 255.255.255.255 port 67
DHCPNAK from 192.168.162.254
DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 6
DHCPOFFER of 192.168.162.128 from 192.168.162.254
DHCPREQUEST of 192.168.162.128 on eth1 to 255.255.255.255 port 67
DHCPACK of 192.168.162.128 from 192.168.162.254
bound to 192.168.162.128 -- renewal in 712 seconds.

Bridge configuration with Gateway and Name Servers

root@bt:~# dhclient eth1
sniff..
Internet Systems Consortium DHCP Client V3.1.1
Copyright 2004-2008 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

Listening on LPF/eth1/00:0c:29:5d:6a:39
Sending on LPF/eth1/00:0c:29:5d:6a:39
Sending on Socket/fallback
DHCPREQUEST of 192.168.162.128 on eth1 to 255.255.255.255 port 67
DHCPNAK from 192.168.252.37
DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 6
DHCPOFFER of 192.168.252.154 from 192.168.252.37
DHCPREQUEST of 192.168.252.154 on eth1 to 255.255.255.255 port 67
DHCPACK of 192.168.252.154 from 192.168.252.37
bound to 192.168.252.154 -- renewal in 320827 seconds.
root@bt:~# route add default gw 192.168.252.1
root@bt:~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default etserver.execut 255.255.255.0 UG 0 0 0 eth1
192.168.101.0 * 255.255.255.0 U 0 0 0 eth0
192.168.252.0 * 255.255.255.0 U 0 0 0 eth1

root@bt:~# nano /etc/resolv.conf

nameserver 192.168.252.1
nameserver 208.67.222.222
nameserver 208.67.220.220

root@bt:~# ping 192.168.252.1
PING 192.168.252.1 (192.168.252.1) 56(84) bytes of data.
64 bytes from 192.168.252.1: icmp_seq=1 ttl=128 time=0.741 ms
64 bytes from 192.168.252.1: icmp_seq=2 ttl=128 time=0.729 ms
64 bytes from 192.168.252.1: icmp_seq=3 ttl=128 time=0.689 ms
^C
--- 192.168.252.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 0.689/0.719/0.741/0.038 ms

root@bt:~# ping www.yahoo.com
PING any-fp.wa1.b.yahoo.com (72.30.2.43) 56(84) bytes of data.
64 bytes from ir1.fp.vip.sk1.yahoo.com (72.30.2.43): icmp_seq=1 ttl=44 time=308 ms
sniff..

1 comment:

  1. Your information for the basic language in the computers.It may be very helpful for the student.
    Thanks...
    regards, saad from
    Education

    ReplyDelete