Archives

All posts for the month July, 2013

Ubuntu server comes default with a Command line interface. Of course we can install GUI in Ubuntu Server if we find command line troublesome. Here are the steps.

First navigate to the “etc/apt” directory and open a file named “sources.list.d” using the command “vi sources.list.d”. 

ugui1

Then check whether software from “universe” ad “multiverse” repositories are allowed.

ugui2

Then type the command “sudo apt-get update” to update all repositories.

ugui3

 

After updating is finished, type the command “sudo apt-get upgrade”.

ugui4

 

Then type the command “sudo apt-get install ubuntu-desktop”. It will take some time to finish all the processes.

ugui5

 

After the installation is finished, restart the server to see your GUI interface.

ugui6

 

Windows provides a property to hide folders. We can set the view property of folder we want to hide to ‘hidden’, then go to “Folder and search” options, go to “view” tab and select Don’t show hidden files,folders and drives option.

The disadvantage with this method is that once we select “Show hidden files,folders and  drives” from the “Folder and Search” options all our hidden files are visible. What if we want to hide our folder completely, completely in the sense that it is not visible even if we set our settings to show all hidden files. Let’s see how to hide a folder completely in Windows.

Here, I want to hide a folder named “Secret”.

hfw1

Go to command line. Navigate to the directory where the folder we want to hide is located. Type the command “attrib +s +h secret” (batch programming is not case sensitive ) and hit Enter.

hfw2

Now we can see that the file we hid is not visible even if we set our properties to show hidden files.

hfw3

 

If you want to unhide your hidden file, go to command line and type the command “attrib -s -h secret.”

Note: This is for educative purposes only.

Have you ever read “Life on Earth” by David Attenborough. It’s a very nice book about the evolution of animals. What is evolution? Wikipedia defines it as the “change in the inherited characteristics of biological populations over successive generations”. Why are we talking about evolution now. Because personally I feel Desktop phishing is an evolution over Phishing. It evolved to overcome the disadvantages in phishing. Let’s see how.

The process in desktop phishing is same as in phishing. The only difference is in the method of uploading our phishing files. Whereas in phishing we upload our files to an external server, in desktop phishing we upload our files to the server on our desktop. Why? Because there are three disadvantages in the former  method.

One, however hard we may try the url always looks suspicious.

dphish1

 

Two, modern day browsers are capable of  detecting phishing sites.

dpish2

 

Three, as soon as the webhosting provider detects that you hosted a phishing site, he will suspend your account. This will most likely happen within 24 hours. Desktop phishing overcomes all these defects. So now, let’s see how to hack a Facebook account with desktop phishing.As already told, this process is same as phishing, until the creation of phishing files which you can find  here. Now Install Wamp Server on your windows machine. To see what wampserver is and how to install it, click here. Next, install a VPN on your system to keep your IP static. See here. We are going to host our phishing files on our desktop and redirect the victim to our site.

Now copy our phishing files to the folder C:/wamp/www. This is the root directory of the wamp server.

dpish3

Here is the script of the “phish.php” we used.

dphish3a

 

Go to folder “C:/wamp/bin/apache/Apache 2.4.4/conf” and make changes to the ‘httpd.conf’ file as below. These changes give permission to external users to access your fake website.

dpish4

 

Start your wamp server, open your browser and type localhost” in the url to see if your phishing site is working. Then open Notepad and create a batch file as shown below.We need to send this file to the victim machine and make him execute it. See how? Make sure you replace the IP address below with one assigned by VPN.

dpish5

 

What the above script does is it changes the hosts file in the victim’s system to redirect to your fake website when user tries to access Facebook. Now, what is hosts file?

Hosts file is a text file located in the folder “C:/windows/system32/drivers/etc” which resolves IP addresses associated with domain names.

dpish6

 

Usually when we try to vist any website say www.google.com our system sends a query for it’s IP address to the DNS server. When we make an entry in the hosts file of our computer, the query is not sent to the DNS server. When the victim clicks on the executable sent by us,it changes the hosts file like below.

dpish7

 

Now when victim types “www.facebook.com” in his browser, he is redirected to our wamp server. Notice that the url looks completely genuine and the browser didn’t detect it as a phishing site.

dpish8

When the unsuspecting victim enters his credentials,

dpish9

 

a text file called pass .txt is created in the www directory.

dpish10

Open the file and we can see the credentials.

dpish11

 

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 practising 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 and GNS3 but also see how to simulate CISCO Graphical user Interface (GUI). For this I use,

1. Vmware Workstation 9.

2. Windows XP as Guest OS.

3. Cisco Security Device Manager v25.

4. GNS3.

5.  C7200 Router Image.

Open Vmware Workstation. On the menu Select “Edit>Virtual Network Editor”. On the Virtal network editor, click on “Vmnet1″ network. It is a default Host-only type network adapter of Vmware. Observe its settings. Enable DHCP server.

vmgns1

 

Install Windows XP as a guest. On its virtual machine settings, change the network adapter to “Vmnet1″.

vmgns2

 

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.

vmgns3

Open GNS3. Click on “Browse all devices”.

vmgns4

 

Select Router “c7200″ and drag it to the workspace. Do the same with “Cloud”.

vmgns5

 

Close the All Devices tab. Right click on the Cloud.  Select “Configure”, a ‘node configurator’ window will open. On this window, click on “C1″.

vmgns6

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.

vmgns7

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.

vmgns8

Add a link from “cloud( Vmnet1)” adapter to the “e1/0″ port on the router.

vmgns9

Hover your mouse over the router. We can see all the ports.

vmgns10

Similarly hover your mouse over the cloud to see its connections.

vmgns11

 

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.

vmgns12

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.

vmgns13

Let’s ping our guest from the router. to ensure that we are connected to Vmware Guest.

vmgns14

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.

n16

 

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.

n17

 

After some time the following popup will open. Don’t close it.

n18

 

Then we might see a certificate warning. Click on Yes.

n19

 

After some processing, Cisco SDM will open.

n20

 

We have successfully simulated Cisco GUI on our PC. Happy practice friends.

I have been searching for a way to send an executable file to someone and make him to execute it. Sending the exe directly is not feasible. So let’s see how to hide an exe file in a jpeg and test its feasibility. First of all, create a new directory named test and download some images and name them similarly. I downloaded images of a popular Tollywood actress. The plan is to lure the victim into falling in the trap. I did this on a Windows 7 machine.

expeg1

 

Go to Folder Options”, go to View tab”deselect ‘ Hide extensions for known file types‘ and select option Show hidden files, folders and drives. This will allow us to see the extensions of the files we are working with.

expeg2

 

Open Notepad, type the following text and save it with the extenson .bat”. What the following code does is it creates a new user named “hacker” with password “abc123″ in the Windows machine this code gets executed.

expeg3

 

Download BAT to EXE converter and convert the batch file we just created to an exe.

expeg4

 

expeg5

 

 

Rename the file “samy.exe” to  “samy_3.jpg”. Windows will prompt a warning. Ignore it.

expeg6

 

Right click on the file “samy_3.jpg”, drag it a little and leave. Select ‘Create Shortcuts here’. We are creating a shortcut for the file samy_3.jpg.

expeg7

 

Rename the shortcut to “samy_0.jpg”. Whatever the name you give make sure that the shortcut is clicked first and not the exe file.

expeg8

 

Right click on “samy_0.jpg” and select Properties. In the “Start in” column delete the entire text. In the “Target:” column type “C:Windowssystem32cmd.exec samy_3.jpg.” This will run the file samy_3.jpg when clicked on the samy_0.jpg.

expeg9

 

Click on “Change Icon” tab. Replace the text inside with “%SystemRoot%system32SHELL32.dll” and click on “OK”.

expeg10

 

Compress all files into zip archive with the name “samy unseen.zip”. Remember that name should be attractive enough to lure the victim into clicking the images.

expeg11

 

OK, package is ready. Now the bigger challenge is to send the package to the victim’s computer. I tried to mail the package to the victim but it didn’t work out.

expeg12

 

 So I suggest you to find your own way of sending it to the victim. To test if the package will work on the victim’s system or not open “CMD” and type the command “net user” before executing the image. It will show us all the users on the system.

expeg13

 

Then click on the image samy_0.jpg. Open “CMD” and type the “net user” command again.

expeg14

 

A new user named hacker has been created. So the trick worked.

Virtual penetration testing lab is a lab created on a single system using any virtualization software. It can be very helpful for people practising for CEH or similar certification. Any penetration testing lab has two machines, attacker and victim. In this lab we will set up Kali Linux as the attacker and Windows XP( most favourite victim machine ) as the victim. I am going to set up this lab in Vmware Workstation 9. Hope this will be helpful.

First of all install Kali Linux and Windows XP in Vmware Workstation.

vpl1

 

vpl2

Shut them down. In the Vmware Workstation menu, Select Edit” and click on Virtual Network editor.

vpl3

The window below will open showing the virtual network adapters. Click on “Add network”.

vpl4

Vmware provides nine virtual networks from 0 to 9. Vmnet0, Vmnet1 and Vmnet8 are automatically assigned for  bridged, Host-only and NAT types of network respectively. Select the network “Vmnet3″.

vpl5

We can see that our network is added as Host-Type with a automatically assigned subnet IP.

vpl6

 

Click on our network. We can see its settings below.

vpl7

 

Deselect the option ‘Connect a host virtual adapter to the network‘.This will make our network a custom type. Change the subnet IP to 10.10.10.0( choice is yours).  Select the ‘Use local DHCP service to distribute IP address to VMs‘ option. This will automatically assign IP addresses to our machines. Click on ‘DHCP settings‘.

vpl8

You will see the below window. Make changes if you like. I am going to leave it default. Click OK twice to exit.

vpl9

 

We have successfully created our custom network. Now let’s add our machines to the network. Open the tab of Kali Linux and click on ‘network adapter‘ setting.

vpl10

In the settings, select the ‘custom radio button and select the network Vmnet3 from the dropdown menu. Click on OK.

vpl11

Do the same for Windows XP. Then let’s boot up our victim machine and check it’s IP address by typing ‘ipconfig‘ in the command line.The DHCP server has automatically assigned it the IP address 10.10.10.129.

vpl12

 

Boot the attacker machine and check it’s ip address by typing ‘ifconfig’ in the terminal. It has been assigned the address 10.10.10.128.

vpl13

Ping the victim IP machine (10.10.10.129) to see whether the two machines can communicate.

vpl14

 

We have successfully created a virtual penetration testing lab. Happy testing.

Cisco IOS is the internetwork operating system of both the Cisco switches and routers. It has two interfaces command line interface(CLI) and Graphical User Interface(GUI). Since CCNA exam will surely test your knowledge on these interfaces, it is important to get familiar with them.

Cisco’s IOS command-line interface (CLI) is a text-based interface integrated with the IOS. When a switch or router boots up, the IOS loads the startup configuration from NVRAM and displays the IOS prompt, waiting for commands. We can enter the IOS commands at the IOS prompt.

In this article, we will see various command line modes on Cisco routers and switches. For this, we are going to use Packet Tracer. To see what is Packet Tracer and how to install it in both Linux and Windows, go here. For a startup guide on Packet Tracer, see here. Open Packet Tracer  and select a Cisco 2960 switch.

cclm1

 

Hover on the switch to see its ports.

cclm2

Select a Computer from the End Devices and connect them with a Console wire. What we are simulating here is connecting to the switch from a PC through console.

cclm3

 

Click on the Host device( Computer ). On the window that opens, click on Desktop tab and Click on Terminal.

cclm4

The console opens with the switch booting. Switch finishes its booting operation and loads  into user EXEC mode.

cclm5

Coming to the modes of Cisco IOS, the Cisco IOS has five command line modes.

  • Setup mode
  • User EXEC mode
  • Privileged EXEC mode
  • Global configuration mode
  • Specific Configuraton mode

Setup mode

Setup mode is the initial configuration mode of Cisco switches and routers. They start in setup mode when no startup configuration exists in NVRAM. After completion of the setup mode,  the Cisco IOS transitions to user EXEC mode.

User EXEC mode

The user EXEC mode is the normal operation mode on Cisco switches and routers. The Cisco IOS user EXEC prompt is the switch or router name followed by the ‘greater than’ character >. See all the commands available in user EXEC prompt by typing ‘?’

cclm6

 

Privileged EXEC mode

Privileged EXEC mode is the advanced operation mode of Cisco IOS. It has been designed to restrict access to IOS commands that can have adverse effects on the Cisco device and its configuration. To enter privileged EXEC mode type “enable” or “en” .Privileged EXEC prompt is comprised of the switch or router name followed by the # character. To exit the privileged EXEC prompt type “disable”.

cclm7

 

To see the commands available in privileged EXEC prompt, type ?.

cclm8

 

Global Configuration mode

The global configuration mode is comprised of commands pertaining to the entire Cisco device. In other words, if we need to execute commands to modify the behavior of either the whole switch or the whole router we need to set the IOS in global configuration
mode. Global configuration mode can only be enabled from  privileged
EXEC mode by typing config t” or “conf t”. The prompt in this mode is comprised of the device name followed by “(config)#”.

cclm9

 

See the commands available in this mode by typing ‘?’. If we need to execute a command not available in the global configuration mode we should prefix the command by “do”.

cclm10

 

Specific configuration mode

The specific configuration mode is used for commands that affect the configuration of either just one part or range of components of the Cisco device. Suppose we want to work on a few interfaces (or ports) on our switch or router we need to enable specific configuration mode. We can enable specific configuration mode only from the global configuration mode by selecting the components we want to work with. The prompt in this mode is comprised of the router or switch host name followed by “(config-<component>)#”.

Let’s select interface fastethernet 0/1 by typing “interface fastethernet 0/1″. 

cclm11

If we want to run a command not available in specific configuration mode prefix the command by do”. For example, run the command “do show running-config” in specific configuration mode.

cclm12

 

We can exit from global configuration mode and specific configuration mode by typing “exit”.

In this article, we are going to see how to set up a web server in Ubuntu Server. Before that, I want to give  credit for this article to Mike of www.funwithlinux.net. I learnt how to install the web server from this article, made some mistakes initially but finally successful.

What is a web server? It is a server which hosts websites. Each and every website has a  server. Most web servers are set up on Linux for the primary reason that it is free. I am going to set up my web server on Ubuntu Server 12.04.

To set up a web server we are going to install four components, Apache (server software), PHP (scripting language used to create webpages), MYSQL (database), PHP-MYSQL (MySQL support in PHP ). Login as root into Ubuntu server.

In the terminal type “apt-get install apache2″ to install Apache package. Type ‘Y’ when system prompts you to continue.

uws1

 

To check whether apache packages have been installed or not type the command “wget localhost index.html” in the terminal. This will download the index.html file to the local directory. Type “ls” to see if the file has been downloaded or not. If it is present, apache has been correctly installed.

uws2

The apache2 config file is located at “/etc/apache2/”. In this same directory we have a directory named ‘conf.d’. Configuration files( files with the suffix .conf ) in this directory will be parsed by apache2 during startup.  If we intend to run multiple sites from the same server, we need to put our config files here. Let’s create a file name “shunya.com.conf”.

uws3

In the file shunya.com.conf, add the following text and save the file. The first line tells  Apache to  listen on port 80. The second line shows the ServerAdmin and is optional. The third line shows our web server’s root directory. The fourth line is host header Apache2 will listen for, as sent by the end user’s browser. The fifith line is the file used for logging errors. This line is also optional but is very helpful.  The settings not configured under <VirtualHost> tags will be inherted from apache2.conf or other configuration files. Close the file by typing “:wq”.

uws4

 

As we created the config file of our host, we need to create our root directory referenced in the config file i.e “/var/www/shunya.com”. Navigate to the directory by typing “cd /var/www/”. Create new direcory named ‘shunya.com’ by typing “mkdir shunya.com”. Make the root user the owner of the directory by typing the command “chown root:www-data /var/www/shunya.com -R”. Make this directory readable and executable by typing the command “chmod 550 /var/www/shunya.com -R”.

uws5

 

Create a file named index.php in our root directory shunya.com.

uws6

 

Edit the file as below. We will echo some Archimedes in our index.php file. Save and exit the file.

uws7

 

Next, we have to install PHP. Type the command “apt-get install php5″. Type Y at appropriate prompts.

uws8

 

Reload the apache config file by typing “service apache2 reload”. Then restart the apache service using “service apache2 restart”.

uws9

 

Let’s see if our website is working. From a remote machine which has access to ur web server open the browser and type the IP address of the web server. If we get “Eureka Eureka” displayed, then our server is working.

uws10

 

Install Mysql server by typing “apt-get install mysql-server”. 

uws11

 

The system will prompt you to set a root user password for MYSQL. Set the password and confirm it again.

uws12

 

uws13

Type the command “apt-get install php5-mysql” to install Mysql support for PHP.

uws14

 

We have set up our web server successfully.

Windows Server 2012 introduced a new configuration option called Minimal Server Interface. Minimal Server Interface is in simple words compromise between Server GUI Full Installation and Server Core installation. Minimal Server Interface installation reduces footprint of the server to some extent thus decreasing security hazards. In the same time it increases deployment scenarios.

Following tools are installed in Minimal Server Interface.

  • Server Manager
  • MMC
  • Some Control Panel Applets

The items which are not installed during Minimal Server Interface are

  • Start Screen
  • Desktop
  • Windows Explorer
  • Internet Explorer

Let’s see how to convert Server GUI full installation to Minimal Server Interface in Windows server 2012. If you want to convert Server GUI full  installation to Server Core installation, read here.

Login as Administrator. Open  “Powershell”. Type the command

“Uninstall-WindowsFeature Server-Gui-Shell -remove” and Press “Enter”.

guimsi1

 

After collecting some data, the system will start removing the Server-Gui-Shell.

guimsi2

After the removal of Server-gui-shell is finished, the system will ask us to restart the system.

guimsi3

 

Restart the system by typing “shutdown -r -t 0″. The system will reboot to Minimal server Interface which will look like below.

guimsi4