Image
 
linkedin_logo.png rss_logo.jpg
twitter_logo.png youtube_logo.jpg
Latest Additions
 
EH-Net Login
Welcome Guest.






Lost Password?
No account yet? Register
Who's Online
We have 54 guests and 3 members online
 
Advertisement

You are here: Home arrow Ethical Hacking Discussions and Related Certificationsarrow Network Pen Testingarrow Setting up Vitrual Lab
EH-Net
May 21, 2013, 11:02:45 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Go back to The Ethical Hacker Network Online Magazine Home Page
 
   Home   Help Calendar Login Register  
Pages: 1 [2]   Go Down
  Print  
Author Topic: Setting up Vitrual Lab  (Read 18715 times)
0 Members and 1 Guest are viewing this topic.
vp75
Jr. Member
**
Offline Offline

Posts: 78


View Profile
« Reply #15 on: June 13, 2007, 05:52:16 AM »

Hi Blackzarro

As you said in reply, i manually configured the vmnet8 & vmnet1, was not sure exactly and was trying it. After i posted the netstat & ifconfig,ipconfig result to posting, i restarted the host pc, and now it was able to access router admin by 192.168.0.1, by this if i start using the virtual pc after it boots , i start getting ipaddress conflict in my host pc, i tried looking at the event viewer , it reported as 192.168.0.1 is been assigned to vmnet8 adapter....

From my previous posting you can see that there is no value assigned to vmnet8 &vmnet 1 as 192.168.0.1. So something in my manual configuration is wrong. iam investigating the same.

By the way, why does ipconfig/all shows no ipaddress in host for vmnet8 (i understand vmnet8 is used to connect to internet), so i disabled vmnet1.

Do you find where iam lagging.... conceptually in configuring....!

I hope on looking at your virtual lab setup i will be get some idea...

Cheers
Vp75
Logged

eCPPT
nebu10uz
Sr. Member
****
Offline Offline

Posts: 368



View Profile WWW
« Reply #16 on: June 13, 2007, 12:13:55 PM »

Here's how I have my virtual lab setup. I'm just going to show my host and one guest configuration.

My LAN consist of few machines so I assigned a subnet of 192.168.1.33/29. My SOHO router (192.168.1.33) dynamically assigns IP addresses to the local machines. Currently the host machine (Windows) has an IP address of (192.168.1.37):

Code:
Ethernet adapter Wireless Network Connection:

        Connection-specific DNS Suffix  . :
        Description . . . . . . . . . . . : Intel(R) PRO/Wireless LAN 2100 3B Mini PCI Adapter
        Physical Address. . . . . . . . . : XX-XX-XX-XX-XX-XX
        Dhcp Enabled. . . . . . . . . . . : No
        IP Address. . . . . . . . . . . . : 192.168.1.37
        Subnet Mask . . . . . . . . . . . : 255.255.255.248
        Default Gateway . . . . . . . . . : 192.168.1.33
        DNS Servers . . . . . . . . . . . : 10.0.0.138

When I installed the VMware player it automatically created 2 virtual interfaces (VMnet1 & VMnet8)  in my host machine. It randomly assigned IP address to both virtual NIC. As I also understand the VMnet8 is used to connect the Internet:

Code:
Ethernet adapter VMware Network Adapter VMnet8:

       Connection-specific DNS Suffix  . :
       Description . . . . . . . . . . . : VMware Virtual Ethernet Adapter for VMnet8
       Physical Address. . . . . . . . . : 00-50-56-C0-00-08
       Dhcp Enabled. . . . . . . . . . . : No
       IP Address. . . . . . . . . . . . : 192.168.214.1
       Subnet Mask . . . . . . . . . . . : 255.255.255.0
       Default Gateway . . . . . . . . . :

Ethernet adapter VMware Network Adapter VMnet1:

        Connection-specific DNS Suffix  . :
        Description . . . . . . . . . . . : VMware Virtual Ethernet Adapter for VMnet1
        Physical Address. . . . . . . . . : 00-50-56-C0-00-01
        Dhcp Enabled. . . . . . . . . . . : No
        IP Address. . . . . . . . . . . . : 192.168.87.1
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        Default Gateway . . . . . . . . . :

Then I downloaded VMX Builder to create virtual machines which will be my guests to the host machine. For this example I used BackTrack to install it as a virtual machine and did the following steps below so that it can have access to my other physical machines in the LAN and the Internet:

Code:
slax ~ # ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:0C:29:93:BB:00
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Interrupt:18 Base address:0x1080

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:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

sit0      Link encap:UNSPEC  HWaddr 00-00-00-00-31-00-00-00-00-00-00-00-00-00-00-00
          NOARP  MTU:1480  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 ( 0.0 b)  TX bytes:0 (0.0 b)

Notice that my guest OS has no IP address. I statically assigned an IP address of (192.168.214.3). Remember that VMnet8 in my host machine has IP (192.168.214.1) since this virtual NIC is used to access the Internet I assigned an IP within that subnet to my guest OS. I did not use IP (192.168.214.2) because VMware use this as a virtual gateway:

Code:
slax ~ # ifconfig eth0 192.168.214.3
slax ~ # clear
slax ~ # ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:93:BB:00
          inet addr: 192.168.214.3  Bcast:192.168.214.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe93:bb00/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:308 (308.0 b)
          Interrupt:18 Base address:0x1080

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:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

Let's check the routing table for this guest machine:

Code:
slax ~ # netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS  Window  irtt  Iface
192.168.214.0   0.0.0.0         255.255.255.0   U         0            0          0 eth0
127.0.0.0            0.0.0.0          255.0.0.0            U         0            0          0 lo

Looking at the routing table I can see that I can send packets to (192.168.214.0) subnet via the eth0 interface. If I create additional virtual machines and statically assigned IP address within this subnet then my packets will reach them. However, I see there's no way for my packets to reach the Internet. Need to add an entry to the routing table:

Code:
slax ~ # route add default gw 192.168.214.2 eth0

slax ~ # clear
slax ~ # netstat -nr

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS  Window  irtt Iface
192.168.214.0   0.0.0.0         255.255.255.0   U         0            0          0 eth0
127.0.0.0            0.0.0.0         255.0.0.0             U         0            0          0 lo
0.0.0.0         192.168.214.2   0.0.0.0                UG       0             0          0 eth0

I added a default gateway which is (192.168.214.2) the virtual VMware gateway. Now any packets destined to (0.0.0.0-what ever IP) but not 192.168.214.0/24 and 127.0.0.0/8 will be routed to (192.168.214.2) gateway via eth0 then from there to my host machine which will NAT (my VMware is set to NAT) the source IP with the IP of my host machine. If the packet is intended for the Internet then this packet will be routed to my SOHO router and off it goes.

Lets test by pinging my router:

Code:
slax ~ # ping 192.168.1.33
PING 192.168.1.33 (192.168.1.33) 56(84) bytes of data.
64 bytes from 192.168.1.33: icmp_seq=1 ttl=128 time=15.4 ms
64 bytes from 192.168.1.33: icmp_seq=2 ttl=128 time=6.93 ms
64 bytes from 192.168.1.33: icmp_seq=3 ttl=128 time= 4.25 ms

Awesome it works : )

Now when I fired up my browser to request this site's page, I was receiving connection errors. I used tcpdump to see what was happening and noticed that my guest OS was trying to resolve the domain name to IP using an non-existing  DNS server so I configured the resolv.conf to add my DNS server IP (10.0.0.138). I got this IP from my host (Windows) configuration:

Code:
slax ~ # cat /etc/resolv.conf
nameserver 10.0.0.138

And boom it worked. Now I can access to the Internet from my virtual OS.

I hope this helps.
« Last Edit: June 13, 2007, 12:49:24 PM by blackazarro » Logged

Security+, OSCP, CEH
Pages: 1 [2]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!
Page created in 0.062 seconds with 22 queries.
 
Exclusive Deal

sansfire13_245x90_cw90.jpg
SANSFIRE 2013
June 15 - 22

5% Off w/ Code: EHN_5

SANS Deals 4 EH-Netters
5% OFF Any SANS Course in Any Format!
Coupon Code: EHN_5 Including SANS Rocky Mountain 2013 & SANS Boston 2013
Polls
Compared to this year, 2013 will be:
 
Recent Forum Topics
EH-Net News Feeds
Latest Additions
 
         
Advertisement

© 2013 The Ethical Hacker Network
Joomla! is Free Software released under the GNU/GPL License.