Home Networking-and-servers Learning Metasploit Exploitation and Development

Learning Metasploit Exploitation and Development

By Aditya Balapure
books-svg-icon Book
Subscription
$10 p/m for first 3 months. $15.99 p/m after that. Cancel Anytime!
What do you get with a Packt Subscription?
This book & 7000+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats, plus a monthly download credit
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with video?
Stream this video
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
What do you get with Exam Trainer?
Flashcards, Mock exams, Exam Tips, Practice Questions
Access these resources with our interactive certification platform
Mobile compatible-Practice whenever, wherever, however you want
BUY NOW $10 p/m for first 3 months. $15.99 p/m after that. Cancel Anytime!
Subscription
What do you get with a Packt Subscription?
This book & 7000+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats, plus a monthly download credit
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with video?
Stream this video
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
What do you get with Exam Trainer?
Flashcards, Mock exams, Exam Tips, Practice Questions
Access these resources with our interactive certification platform
Mobile compatible-Practice whenever, wherever, however you want
  1. Free Chapter
    Lab Setup
About this book

Metasploit is an open source exploit framework that provides you with heaps of exploits, as well as tools to assist you in creating your own exploits. This includes the ability to generate a large range of shellcodes for different purposes and platforms that can be customized to attack your target. The recent improvements in network security mechanisms have given rise to new trends and techniques of compromising a network. This book deals with these recent trends and attack tips to compromise the weakest to the strongest of networks. Metasploit Exploitation and Development describes actual penetration testing skills and ways to penetrate and assess different types of networks.

Metasploit Exploitation and Development is a perfect fit for hackers who want to develop some real exploitation skills. This book has been designed with a practical approach which emphasizes hands-on rather than theoretical reading. It covers all the new exploits for new operating systems and tips from the experience of real hackers. This is a best buy book for learning the art of exploitation and skills of a penetration tester.

Metasploit Exploitation and Development is a guide to real network hacking with the best tricks to master the art of exploitation.


This book has been designed in well-defined stages so the reader learns more effectively. From the actual setup to vulnerability assessment, this book provides an individual with in-depth knowledge of an expert penetration tester. The book deals with vulnerability assessment exercises with some of the industrially-used tools and report-making tips. It covers topics such as client exploitation, backdoors, post exploitation, and also exploitation development with Metasploit.
This book has been developed with a practical hands-on approach so that readers can effectively try and test what they actually read.


Metasploit Exploitation and Development covers the experience of real network hacking with some of the latest operating systems. The readers will go through a journey in which they will learn from basic to advanced levels of the art of exploitation.


This book covers real hacking and exploitation of the current vulnerabilities in some of the latest operating systems.

Publication date:
July 2013
Publisher
Packt
Pages
294
ISBN
9781782163589

 

Chapter 1. Lab Setup

In this chapter we are going to demonstrate the complete lab setup needed for the practical, hands-on working experience with this book. To set up the lab we need three things: Oracle VM VirtualBox, Microsoft Windows XP SP2, and BackTrack 5 R2.

Oracle VM VirtualBox is a product of Sun Microsystems. It is a software virtualization application and is used for running multiple operating systems on a single computer. It supports many operating systems including Linux, Macintosh, Sun Solaris, BSD, and OS/2. Each virtual machine can execute its own operating system in parallel with the host operating system. It also supports Network adapters, USB devices, and Physical disk drives within a virtual machine.

Microsoft Windows XP is an operating system produced by the Microsoft Corporation. It is primarily used for personal computers and laptops.

BackTrack is a Linux-based freeware operating system. It is widely used by security professionals and penetration testers. It consists of a lot of open source tools for penetration testing and digital forensics.

Now we will install both operating systems in Oracle VM VirtualBox, and use BackTrack as an attacker machine and Windows XP as the victim machine.

 

Installing Oracle VM VirtualBox


The steps for installing Oracle VM VirtualBox are:

  1. First, run the setup file to start the installation procedure and then click on Next >.

  2. Now choose the installation directory where you want to install and click on Next >.

  3. Select the shortcut option if you want to create a shortcut icon on the desktop or in the launch bar and then click on Next >.

  4. It will then reset the network connectivity and display a warning sign; click on Yes and continue the installation of the wizard.

  5. The setup wizard is ready for the installation, click on Install to continue.

  6. The setup has started the installation and it will take several minutes to complete.

  7. Now it will ask to install the USB device driver, click on Install to install the driver software.

  8. After a few minutes the installation wizard is finished and Oracle VM VirtualBox is ready for use. Click on Finish.

 

Installing WindowsXP on Oracle VM VirtualBox


Now we are going to install Windows XP SP2 in VirtualBox. Just perform the following steps for successful installation:

  1. First, launch your VirtualBox and click on New.

  2. You will get a new window with the message Welcome to the New Virtual Machine Wizard; click on Next.

  3. You will get a new window showing memory options, here we will need to specify the amount of base memory (RAM) for our virtual machine. Select the amount of memory and then click on Next.

  4. After this we will get a new window with the option to create a virtual hard disk. Here we will select Create new hard disk and click on Next.

  5. We then get a new window with the message Welcome to the Virtual disk creation wizard. Here we have some options for the hard disk file type; we select VDI (VirtualBox Disk Image). You may select another type of file, but VDI is recommended for best performance. After selecting the file type, click on Next.

  6. We then see a new window named Virtual disk storage details. In this window we can see details of the two types of storage: Dynamically allocated and Fixed size. The details of these two types of storage are mentioned in this window. So it depends upon the user as to what kind of storage he may prefer. In this case we will select Dynamically allocated; click on Next to continue.

  7. Now we will get a new window with options for the Location and Size of the virtual disk file. We choose the location where we want to create the file for the virtual disk. After that, select the size for your virtual disk. In this case we are specifying 10 GB space for virtual disk. Then click on Next to continue.

  8. We then get a new window with the summary of our virtual machine settings. In this window we can check the settings we previously provided for our virtual machine, such as the file type of our hard disk, storage details, location details, and the size of our hard disk. After checking the settings we then click Create.

  9. We get the Summary window which will show us that it is going to create our virtual machine with the following parameters: name of the virtual machine, type of operating system, base memory (RAM), and the size of the hard disk. After verifying all of the settings, click on Create to create the virtual machine.

  10. Now Oracle VM VirtualBox Manager will open, and it will show the virtual machine in the right pane. Select that virtual machine and click on Start to start the installation process for Windows XP.

  11. A new window will appear with the message Welcome to the First Run Wizard! Click on Next to begin.

  12. Now a new window will appear with the option of selecting the source installation media. This option allows us to select the ISO image of Windows XP or the DVD-ROM drive to install from the CD/DVD. Select the appropriate option and then click on Next.

  13. A new Summary window will open and it will show the type of media that was selected for installation, the media source, and the type of device. Click on Start.

  14. Windows XP installation will start and a blue screen appears with the message Windows Setup on the upper-left side.

  15. Now we will get a new window with the message Welcome to setup. Here we can see three options, the first option is To set up Windows XP now, press ENTER.

  16. We will then be prompted to agree to the Windows XP license; press F8 to accept.

  17. After accepting the agreement we will see the unpartitioned space dialog. We will need to create partitions from this unpartitioned space. Select the second option To create partition in the unpartitioned space, press C.

  18. After pressing C, the next step is to set the size of the new partition and then press Enter.

  19. After creating the new partition, we can now see three options here; select the first option To set up Windows XP on the selected item, press ENTER to continue.

  20. Now we have to format the selected partition before continuing the installation process. Here we see four options for formatting and select the first option which is Format the partition using the NTFS file system (Quick) and press Enter.

  21. Now setup will format the partition.

  22. After formatting the partition, the setup will copy the Windows files.

  23. After copying the Windows files it will restart your virtual machine after 10 seconds, or press ENTER for immediate restart.

  24. After restarting the virtual machine you will see the Windows XP boot screen.

  25. The Windows installation process will start and will take approximately 40 minutes to complete.

  26. Now a new window will appear for Regional and language Options, just click on Next >.

  27. After that a new window will appear asking for your Name and Organization name; enter these details and click on Next >.

  28. A new window will appear asking for the Product Key; enter the key and click on Next >.

  29. The next wizard will ask for a Computer name and Administrator password, enter these details and click on Next >.

  30. This will be followed by a screen to enter the date, time, and time zone settings. Select the time zone according to your country, enter the date and time, and then click on Next >.

  31. We will see the installation screen again, with Installing Network settings.

  32. A new window will prompt us to choose the network settings. Select Typical settings. If we want to configure our network settings manually, we can select Custom settings and then click on Next >.

  33. The wizard will ask if we want to make the computer a member of the workgroup or domain. For our lab we select WORKGROUP and click on Next >.

  34. We will then see the Windows XP boot screen.

  35. After Windows XP has booted, we will see a message Welcome to Microsoft Windows. To continue, click on Next.

  36. The wizard will ask us whether or not to turn on the automatic updates. Make the selection according to your preference and then click on Next.

  37. The next wizard will ask about internet connectivity; we suggest you skip it by clicking on Skip.

  38. Now the wizard will ask about online registration; we do not want to register, so we select the second option and click on Next.

  39. Next the wizard will ask for the usernames of the people who will use this computer. Enter the names and click on Next.

  40. You will see a Thank You message; click on Finish.

  41. Now your Windows XP installation is ready for use.

 

Installing BackTrack5 R2 on Oracle VM Virtual Box


Now we are going to install BackTrack 5 R2 on Virtual Box. Perform the following steps:

  1. First, launch your Oracle VM Virtual Box.

  2. A new window will appear with the message Welcome to the New Virtual Machine Wizard; click on Next.

  3. We follow the same process which we followed during our Windows XP virtual machine creation for the BackTrack virtual machine setup. Our BackTrack machine will be set up and the summary displayed as shown in the following screenshot. Click on Create:

  4. Now Oracle VM VirtualBox Manager will open and will show the new virtual machine in the right pane. Select that virtual machine and click on Start to start the installation process of BackTrack 5.

  5. A new window will appear with the message Welcome to the First Run Wizard!; click on Next to begin.

  6. A new window will appear with options for selecting source installation media. Select the ISO image of BackTrack 5 or the DVD Rom drive to install from CD/DVD, and then click on Next.

  7. A new Summary window will open, and it will show the type of media that was selected for installation, the media source, and the type of device; now click on Start.

  8. We will see a black boot screen; just press Enter.

  9. The BackTrack boot screen with a command-line interface will appear, showing the prompt: root@bt:~#; type startx as the value of this command and press Enter.

  10. Now the BackTrack GUI interface will start and we will see an icon named Install BackTrack. We will have to click on that icon to continue the installation process.

  11. After that, the installation wizard will start. Select the language and click on Forward.

  12. The installation wizard will automatically set the time from the network time server.

  13. Select the Time Zone and Region, and click on Forward.

  14. The next wizard will ask for the Keyboard layout. Select the appropriate layout according to your language and click on Forward.

  15. The disk partition wizard will appear. Just use the default settings and click on Forward.

  16. Now click on Install.

  17. The setup will start copying files. It will take approximately 40 minutes to complete the installation.

  18. After finishing the installation, just click on Restart, and now the BackTrack installation is ready for use.

 

Summary


In this lab setup we have set up the victim and attacker machines, which we will use for our practical sessions. The next chapter will cover the Metasploit framework organization, the basics, architecture, and a brief introduction to it.

About the Author
  • Aditya Balapure

    Aditya Balapure is an information security researcher, consultant, and an author with expertise in the fields of Web Application Penetration Testing and Enterprise Server Security. Aditya has 3 years' of practical experience in the field of information security. He has quite a few credentials to his name, such as Associate of ISC2 (CISSP), CEH, ECSA, MCP, a few international publications, as well as a few research articles. His deep interest in vulnerability assessment and offensive penetration testing groups him among the white hats of the information security arena. Aditya is extensively involved in conducting corporate trainings in addition to his constant hobby of vulnerability disclosure and security research.

    Browse publications by this author
Latest Reviews (1 reviews total)
Muy completo. Un buen trabajo del autor con ejemplos para probar y practicar.
Learning Metasploit Exploitation and Development
Unlock this book and the full library FREE for 7 days
Start now