Good evening friends. We have seen how to create a virtual pentest lab both in Oracle VirtualBox (see here) and Vmware Workstation(see here). Although both penetration testing labs were almost similar, there is a small difference between them . As the title of this howto already implies it is the absence of DHCP server in the pentest lab we created using Virtualbox. VirtualBox provides a DHCP server but it can’t be turned on using the GUI feature unlike Vmware Workstation. So let’s see how to enable DHCP server in Virtualbox networks. I am going to assign DHCP server to my pentest lab I created above. I will assume that virtualbox is installed on Windows. Open CMD and navigate to the directory where Virtualbox is installed. By default it will be “C:Program Files OracleVirtualBox”. Type the command “vboxmanage dhcpserver add –ip 10.10.10.1 –netmask 255.0.0.0 –lowerip 10.10.10.2 –upperip 10.10.10.10 –netname pentestlab”. Hit Enter.
In the above command, “vboxmanage dhcpserver add –ip 10.10.10.1” starts a DHCP server with IP address 10.10.10.1 . The “–netmask 255.0.0.0″ assigns subnet mask for the network. The “–lowerip” and “–upperip” options assign a lower ip address and upper ip address respectively. The “–enable” option enables the DHCP server we just created. The “–netname” option assigns a name to the network. Now we have successfully created an internal network named pentest lab with its own DHCP server. Now change the network adapter settings of the attacker machine ( Kali Linux ) to pentest lab.
Similarly change the network settings of the victim machine.
Now start the attacker machine (Kali Linux) to see if the IP address is automatically assigned. If the IP address has not been assigned, disable the adapter using command “ifdown eth0″ and re enable it by typing command “ifup eth0″. Now check if the IP address has been assigned or not by typing command “ifconfig”.
Similarly check on the victim machine.
We can see that the IP addresses have been automatically assigned successfully starting from the range of 10.10.10.2. Hope this was helpful.
Understanding subnetting is very important not only for those preparing for CCNA exam but also network administrators. Today, I am going to teach you how to create a subnet in a network. For this, I will use Packet Tracer software. To know what is subnetting and why we need it go here. So let’s start.
Imagine I formed a small software company named shunya whose network looks like below. I hired one Java developer, one software tester, one HR and one network administrator. I have been assigned the IP address range from 192.168.10.1 to 192.168.10.255.
I have enabled DHCP on my router as below.
After one year, imagine my company has received Abrahamic blessings from GOD and has seen rapid growth. Now the company has three Java developers, three software testers and a dedicated HR team. Not only that, my company now has moved into Remote Infrastructure Management(RIM) and has a Network Operation Center(NOC) and Security Operation Center(SOC). Total I have 15 computers in my network which looks like below.
Now see the image below. Here the machine “JD1″ sends a packet to machine “Testing3″. We can see here that for communication between machines “JD1: and “Testing3″ other machines have also been disturbed.
So for this reason, I decided to subnet the network. I decide to divide the network into three subnets as shown below.
To create a subnet, first we need to have proper planning as to how many subnets we need and how many we may need in the future. Presently, I need three subnets. The number of subnets should always be calculated in the powers of 2.
2 to the power of 1 = 2
This doesn’t satisfy our requirement as we need three subnets.
2 to the power of 2 = 4
This satisfies our requirement. So we need to take two bits from the host portion of the IP address. 192.168.10.1 to 192.168.10.255 is the address range available to us with subnet mask 255.255.255.0, Writing the subnet mask in the binary notation, it is
11111111 11111111 11111111 00000000
255 255 255 0
The first 24 bits are network bits and the last eight bits are host bits. To create three subnets, we need to take two bits from the host portion of the address as explained above.
11111111 111111111 11111111 11000000
255 255 255 192
Four subnets which can be created from the above subnet mask are,
192.168.10.0 to 192.168.10.63 ( with host bits 00000000 )
192.168.10.64 to 192.168.10.127 ( with host bits 01000000 )
192.168.10.128 to 192.168.10.191 ( with host bits 10000000 )
192.168.10.192 to 192.168.10.255 ( with host bits 11000000 )
Since we require only three subnets, we will create the first three subnets. The first subnet ( 192.168.10.1 to 192.168.10.63 ) comprises of Java Developers and Software testers. The commands are as below on the interface.
If you go to any machine on this subnet and look at its IP address, it will be like below.
Now the subnet for the Human Resource Department ( 192.168.10.128 to 192.168.10.191 ) . This will be like below.
The third subnet ( 192.168.10.64 to 192.168.10.127 ) comprises of NOC and SOC.
Now our network has been successfully sub netted into three subnets and we still have another subnet to use for future use.
Hope this was helpful. If you have any doubts regarding this article please comment below. Thank you.
I am self learning for CCNA. A few months back, I got a thought if we can simulate routers in Vmware Workstation. While I was searching for it I found a different solution, GNS3. After simulating routers in GNS3 and practicing CLI interface, I had another idea if we can simulate CISCO Graphical User Interface on our PC. This article is result of that.
In this article, we are not only going to see how to connect Vmware with GNS3 but also see how to simulate CISCO Graphical user Interface (GUI). For this I use,
1. Vmware Workstation .
2. Windows XP as Guest OS.
3. Cisco Security Device Manager v25.
5. C7200 Router Image.
Open Vmware Workstation. On the menu Select “Edit>Virtual Network Editor”. On the Virtual network editor, click on “Vmnet1″ network. It is a default Host-only type network adapter of Vmware. Observe its settings. Enable DHCP server.
Install Windows XP as a guest. On its virtual machine settings, change the network adapter to “Vmnet1″.
Power on the machine. Install Cisco SDM ( I leave the getting Cisco SDM part to you ). Open CMD and type “ipconfig” to see its IP address. Take note of this.
Open GNS3. Click on “Browse all devices”.
Select Router “c7200″ and drag it to the workspace. Do the same with “Cloud”.
Close the All Devices tab. Right click on the Cloud. Select “Configure”, a ‘node configurator’ window will open. On this window, click on “C1″.
On the NIO Ethernet tab, in the “Generic Ethernet NIO tab” dropdown menu, select our network adapter (Vmnet1) from the dropdown menu and click on “Add”. Click on “OK” to close the window.
Right click on the router. Select “Configure”, click on “R1″. Select slots tab. In the Slot 1 dropdown menu, select “PA-4E”. Click on Apply an close the window. The selection PA-4E creates four Ethernet ports on the router. Right click on the router and start the router.
Add a link from “cloud( Vmnet1)” adapter to the “e1/0″ port on the router.
Hover your mouse over the router. We can see all the ports.
Similarly hover your mouse over the cloud to see its connections.
Right click on the router and select “Console”. In the global configuration mode, type the following commands.
“ip http server”
“ip http secure-server”
These commands set up http and https servers respectively which are needed for Cisco SDM.
Type the command “interface Ethernet 1/0″. We are entering into specific configuration mode of our connected interface. Type the command “ip address 192.168.10.3 255.255.255.0″. This sets the interface IP address and subnet mask. Make sure the router IP address is in the same subnet as that of our guest OS in Vmware workstation. Type “no shut” and exit to the privileged mode.
Let’s ping our guest from the router. to ensure that we are connected to Vmware Guest.
Since success rate is 100% we have successfully connected Vmware and GNS3. Now let’s do the Cisco SDM part. On our Guest machine click on Cisco SDM. A SDM launcher window will open. Type the IP address of the router and click on Launch.
Internet Explorer will open as below. Make sure Internet Explorer is configured to allow pop ups and to allow Activex to run from the computer.
After some time the following popup will open. Don’t close it.
Then we might see a certificate warning. Click on Yes.
After some processing, Cisco SDM will open.
We have successfully simulated Cisco GUI on our PC. Happy practice friends.
There are a few tuts available for Packet tracer on internet but I have made this guide keeping absolute beginners in mind and when I say absolute beginners, I mean really absolute beginners. In this guide we are going to create a star topology and see the difference between hub and a switch.
To those people who don’t know what Packet Tracer is, it is a software developed by Cisco that can simulate networks and can be really helpful for people preparing for CCNA. See How to install Packet Tracer in Windows and Linux.
So Let’s start our tutorial. Open Packet Tracer. On the lower left corner, there are components required for creating a network. There are routers, switches, End devices, Hubs, Wireless Devices, Connections etc.
Click on “Hubs”. To the right, you should see types of hubs displayed. Click on the first type ‘Generic‘, move your mouse to the workspace above and click on the point you want to place your hub.
Click on the hub we just placed in our workspace. You are shown the physical view of the hub and it is a physical view literally. You can even see the Power button of the hub.
Click on the “Config” tab just beside the “Physical” tab. You are shown the global settings of the hub. You can change the display name of the hub hers. Change it from “Hub0″ to “Hub”. Then close it.
Now we are going to place five computers around the hub to form Hub and Spoke topology. From the components on the lower left corner click on “Enddevices”. From the options displayed, click on the first choice called “Generic” hold “CTRL” key and click on the workspace at five points around the hub where you want to place your computers. This is a shortcut to place many devices.
Click on any “PC”. You should see something similar to “CPU”.This is the physical view of the PC. We can even see the Power button.
Click on the “Config” tab beside “Physical” tab. On the global settings, change the name of the PC to “PC 1″. On gateway/DNS select “DHCP”. We will set up a DHCP server to assign IP addresses to the PC’s. You can have a look at other tabs beside “Config” tab.
Perform this action for other PC’s also and name them differently. Then from “End Devices”select “Server” and place it on the workspace as below.
Click on “Server”. Go to “Config” tab. We can see the services which can be configured on our servers HTTP, DHCP etc etc.
Click on “DHCP”. Keep the Pool name, default gateway and DNS server same. Give “starting IP address” as “192.168.0.1″ and “subnet mask” as “255.255.255.0″. Turn on DHCP service if it is OFF. Click on “Save”.
Click on the interface “FastEthernet” to the left. Set IP configuration as static and give “IP address” as 192.168.0.1 and “subnet mask” as “255.255.255.0″. Close the window.
Now we are going to connect our devices. In the components to the lower left corner, Click on “Connections”.
Different types of cabling are displayed. Here’s where Packet tracer assists in our learning abilities. If you are not sure what type of wiring to use, click on the first choice ‘automatic‘. Then on the workspace, click on “Server” and then click on the “Hub”. A connection is established. If the connection end points are red, then there is some problem with your wiring. If end points show green, then your wiring is alright.( We learn that we have to use copper straight through cabling in Star Topology.)
Do the same for all connections.
After some time, IP addresses are assigned to all systems by the DHCP server. Hover the mouse over the systems to check if IP addresses are assigned or not.
Now let’s see the functioning of the hub. Click on “Simulation” beside “Realtime” as shown below.
The Event List window will open. Click on “Edit Filters”. We will see various protocols.
Deselect “Show All/None” option. All options are deselected. Then Select ICMP option. What we are doing is trying to ping the machine.
Close the Event List window.
Click on “Add Simple PDU” as shown below. When we move the mouse on the workspace we can see a white envelope moving along with the mouse.
First click on the sending device( Click on “PC0″). Then select the receiving device( Click on the “Server”). It should be clear to you that we are pinging the server from PC0. Our screen would like this.
We will now see how packets travel from PC0 to the Server. Click on “Capture/Forward” as shown below.
Click on “Capture/Forward”again. The ping travels from PC0 to the hub.
Click on “Capture/Forward” again. The hub forwards the frame on all the ports, except the port through which the frame came in. All hosts except Server discard the frame since it is not addressed to them.
Click on “Capture/Forward”. The server forwards a frame to the hub.
Click on “Capture/Forward”. The hub once again forwards the frame on all ports except the input port. All hosts except PC0 discard it since it is not addressed to them. The simulation success message is shown as below.
To see the list of complete events undergone in this communication, Click on “Event List” as shown below.
As already seen Hubs forward a frame they receive on all the outbound ports except the port through which it received the frame. When connected using hubs, the host devices share same bandwidth of the medium. Since they share the same bandwidth, hosts can send frames at the same time on the medium which can result in collisions. In order to prevent frame collisions, Ethernet uses “Carrier Sense Multiple Access/Collision detect(CSMA?CD)”. Of course this prevents collisions but it still consumes a lot of bandwidth. The only solution is to this problem is to make the collision domain as small as possible.
Let’s see how.
Click on “Delete” as shown below.
Click on the hub. This will delete the hub and also the connections.
Replace it with a “2960″ switch and make the connections in the same way as done previously.
Add a simple ICMP PDU as done previously.
Click on “Capture/Forward”. The first frame travels to the switch.
Click on “Capture/Forward” again. The switch forwards the frame only to the Server, it’s intended destination.
Subsequently the frame is forwarded to switch which forwards it to PC0 thus completing the communication.
Now How does this happen?
This happens because a switch creates only one collision domain per port forwarding frames only on the outbound port that reaches the destination of the frame. Since the hosts work in their own isolated collision domain, frames will never collide thus solving the problem of collisions.
Microsoft has always been recommending the Server Core Installation for its servers over the full server installation. As is well known, Server Core Installation which is the minimal install of the server version reduces the space for attack vector by hackers. It also reduces the usage of resources. But the Server Core Installation makes administration intimidating as it requires the administrators to be a PowerShell expert.
With Windows Server 2012, Microsoft has introduced a new feature that would allow switching from Server GUI to Server Core Installation and vice versa. This enables administrators to install and configure the server in GUI and then switch to Server Core installation. Although there are many ways to switch from Server GUI to Server Core installation, the easiest way to perform this switching is by simple PowerShell commands. I am gonna show you how. For this, I have installed Windows Server 2012 standard GUI installation in Vmware workstation.
Then open PowerShell and type the command
“Remove-windowsfeature Server-gui-shell,Server-gui-mgmt-infra” and hit Enter.
The process of disabling the GUI starts and the display is as same as below.
After a short time, the process is completed and it prompts you for a restart.
Restart the machine by typing “shutdown –R –T 0″ and hit ENTER.
After the reboot, the system asks for administrator password on entering which it switches to Server Core Installation.
To enable back the GUI, enter into PowerShell by typing command “powershell.exe” in the cmd and hit ENTER. In PowerShell, type the same command as above replacing Remove with Install and hit ENTER.