Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Metasploit Penetration Testing Cookbook
Metasploit Penetration Testing Cookbook

Metasploit Penetration Testing Cookbook: Over 70 recipes to master the most widely used penetration testing framework with this book and ebook.

Arrow left icon
Profile Icon Abhinav Singh
Arrow right icon
Mex$179.99 Mex$902.99
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.9 (13 Ratings)
eBook Jun 2012 268 pages 1st Edition
eBook
Mex$179.99 Mex$902.99
Paperback
Mex$1128.99
Subscription
Free Trial
Arrow left icon
Profile Icon Abhinav Singh
Arrow right icon
Mex$179.99 Mex$902.99
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.9 (13 Ratings)
eBook Jun 2012 268 pages 1st Edition
eBook
Mex$179.99 Mex$902.99
Paperback
Mex$1128.99
Subscription
Free Trial
eBook
Mex$179.99 Mex$902.99
Paperback
Mex$1128.99
Subscription
Free Trial

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Metasploit Penetration Testing Cookbook

Chapter 2. Information Gathering and Scanning

In this chapter, we will cover:

  • Passive information gathering 1.0 – the traditional way

  • Passive information gathering 2.0 – the next level

  • Port scanning – the Nmap way

  • Exploring auxiliary modules for scanning

  • Target service scanning with auxiliary modules

  • Vulnerability scanning with Nessus

  • Scanning with NeXpose

  • Sharing information with the Dradis framework

Introduction


Information gathering is the first basic step towards penetration testing. This step is carried out to find out as much information about the target machine as possible. The more information we have, the better will be our chances of exploiting the target. During the information gathering phase, our main focus is to collect facts about the target machine, such as the IP address, available services, open ports. This information plays a vital role in the process of penetration testing. There are basically three types of techniques used in information gathering.

  • Passive information gathering

  • Active information gathering

  • Social engineering

Let us take a quick look at these processes:

  • Passive information gathering: This technique is used to gain information about the target without having any physical connectivity or access to it. This means that we use other sources to gain information about the target like using the whois query, Nslookup, and so on. Suppose our target is an online...

Passive information gathering 1.0 – the traditional way


Let us deal with some of the most commonly used techniques for information gathering.

Getting ready

whois, Dig, and Nslookup are the three most basic and simplest steps for gaining initial information about our target. As both are passive techniques of gaining information, hence no connectivity with the target is required. These commands can be executed directly from the terminal of BackTrack. So, launch the terminal window and proceed further.

How to do it...

We will start our information gathering with a simple whois lookup. whois is an in-built command in BackTrack so we can directly invoke it from our terminal.

Let us quickly perform a whois lookup on www.packtpub.com and analyze the output. The output can be big, so here we will only focus on relevant points of the output.

root@bt:~# whois www.packtpub.com	
Domain Name: PACKTPUB.COM
   Registrar: EASYDNS TECHNOLOGIES, INC.
   Whois Server: whois.easydns.com
   Referral URL: http...

Passive information gathering 2.0 – the next level


Every security professional is aware of the information gathering techniques discussed in the previous recipe. But there are some techniques which analysts neglect because of their reduced popularity and awareness, but they can produce results as good as the previous techniques. The techniques we will discuss here will involve a deeper analysis of our target, though we will still be using a passive technique. These techniques do not require the use of Metasploit, but since information gathering is an important field for penetration testing, we will discuss it here.

Getting ready

We will understand three techniques here in this recipe:

  • Zone transfer: This can be performed using the terminal.

  • SMTP header: For this technique, we will require an e-mail that is sent by the target to the penetration tester.

  • Google dork: This is a simple, yet useful, technique of gaining information through a search engine.

Let us start with zone transfer.

How...

Port scanning – the Nmap way


Port scanning is an active information gathering technique in which we will now start dealing with our target directly. Port scanning is an interesting process of information gathering. It involves a deeper search of the target machine. Nmap is the most powerful and preferred scanner for security professionals. The usage of Nmap varies from novice to an advanced level. We will analyze the various scan techniques in detail.

Getting ready

Starting nmap from Metasploit is easy. Launch the msf console and type in nmap to display the list of scan options that Nmap provides.

msf > nmap

How to do it...

We will analyse four different types of Nmap scans which can be very helpful during penetration testing. Nmap provides lots of different modes for scanning the target machine. Here, we will focus on four scan types namely TCP connect scan, SYN stealth scan, UDP scan, and ACK scan. The different scan options of Nmap can also be combined in a single scan in order to perform...

Exploring auxiliary modules for scanning


Auxiliary modules are the in-built modules of a Metasploit that can help us perform a variety of tasks. They are different from exploits as they run on the pen-tester's machine and also it does not provide any shell. There are more than 350 different auxiliary modules present in the Metasploit framework, each having specific tasks. Here we will discuss the scanner auxiliary modules.

Getting ready

To use any auxiliary modules, we will have to follow three simple steps in order to make our module ready to launch. Let us go through the three-step process.

  1. Activating the module: The use command is used to set the particular module active and ready to take commands.

  2. Setting specifications: The set command is used to set up the various parameters that the module requires to execute.

  3. Running the module: After completing the first two steps, the run command is used to finally execute the module and generate the result.

To view the available scanning...

Target service scanning with auxiliary modules


Let us now try out some targeted scanning for specific services running on a range of IP addresses, or on a single target host. Various service-based scans are available; VNC, FTP, SMB, and so on. Auxiliary modules can be really handy in such situations when we are looking for specific types of services on our target.

Getting ready

Let us find out what service-based scanning auxiliary modules are available to us. We can navigate through the following path:

	
root@bt:/pentest/exploits/framework3/modules/auxiliary/scanner# ls
	
backdoor   emc 	ip    	mysql	pop3   	sap   ssh    	vnc
db2    	finger  lotus 	netbios  portscan   sip   telephony voice
dcerpc 	ftp 	misc  	nfs  	postgres   smb   telnet 	vxworks
dect   	http	motorola  ntp  	rogue  	smtp  tftp   	x11
discovery  imap	mssql 	oracle   rservices  snmp  upnp

As we can see, there are lots of options for service scan modules which can be very handy during penetration testing. Let us quickly work...

Vulnerability scanning with Nessus


So far, we have learned the basics of port scanning, along with the practical implementation with Nmap. Port scanning has been extended to several other tools which further enhance the process of scanning and information gathering. In the next few recipes, we will cover those tools which scan the target for available services and open ports and then tries to determine the type of vulnerability that may exist for that particular service or port. Let us begin our journey to vulnerability scanning.

Nessus is one of the most widely used vulnerability scanners. It scans the target for a range of vulnerabilities and produces a detailed report for it. Nessus is a very helpful tool during penetration testing. Either you can use the GUI version of Nessus, or you can also use it from the Metasploit console. In this book, we will primarily focus on using Nessus with msfconsole.

Getting ready

To start working with Nessus in msfconsole, we will have to load Nessus and...

Scanning with NeXpose


In the previous recipe, we discussed Nessus as a potential vulnerability scanner. In this recipe, we will cover another important vulnerability scanner NeXpose.

NeXpose is a popular tool by Rapid7 which performs the task of vulnerability scanning and importing results to the Metasploit database. The usage of NeXpose is similar to Nessus which we learned in the previous recipe, but let's have a quick overlook of how to get started with NeXpose. I will leave the task of exploring it deeper as an assignment for you.

Getting ready

To start the NeXpose from the msf console, we will first have to connect the database to Metasploit, and then load the plugin to connect it with the NeXpose server to start the process of target scanning. Let us execute these steps in the command line.

msf > db_connect msf3:8b826ac0@127.0.0.1:7175/msf3 

msf > load nexpose

msf > nexpose_connect darklord:toor@localhost ok

[*] Connecting to NeXpose instance at 127.0.0.1:3780 with username...

Sharing information with the Dradis framework


In our previous recipes, we learned several techniques for gaining information about our target. While performing penetration tests, we may need to share information with other pen-testers which may be located at other physical locations. In that case, sharing the penetration testing information can be made easier by using the Dradis framework. It is an open source framework for sharing information during security assessments. It has several features which makes it an excellent information-sharing tool. Some of them are:

  • Communicating over SSL

  • Attachment of files and notes

  • Import scan results from Nessus, NeXpose, and so on

  • Can be extended to connect with external systems like a vulnerability database

Although it will not help us in gaining any information about the target, the tool is important for all security professionals in sharing pen-test results and findings.

Getting ready

To launch the Dradis framework in BackTrack, we will have to execute...

Left arrow icon Right arrow icon

Key benefits

  • More than 80 recipes/practicaltasks that will escalate the reader's knowledge from beginner to an advanced level
  • Special focus on the latest operating systems, exploits, and penetration testing techniques
  • Detailed analysis of third party tools based on the Metasploit framework to enhance the penetration testing experience

Description

Metasploit® software helps security and IT professionals identify security issues, verify vulnerability mitigations, and manage expert-driven security assessments. Capabilities include smart exploitation, password auditing, web application scanning, and social engineering. Teams can collaborate in Metasploit and present their findings in consolidated reports. The goal of the software is to provide a clear understanding of the critical vulnerabilities in any environment and to manage those risks.Metasploit Penetration Testing Cookbook targets both professionals and beginners to the framework. The chapters of the book are logically arranged with an increasing level of complexity and cover Metasploit aspects ranging from pre-exploitation to the post-exploitation phase thoroughly. The recipe structure of the book provides a good mix of both theoretical understanding and practical implementation. This book will help readers in thinking from a hacker's perspective to dig out the flaws in target networks and also to leverage the powers of Metasploit to compromise them. It will take your penetration skills to the next level.The book starts with the basics such as gathering information about your target and gradually covers advanced topics like building your own framework scripts and modules. The book goes deep into operating systems-based penetration testing techniques and moves ahead with client-based exploitation methodologies. In the post- exploitation phase, it covers meterpreter, antivirus bypass, ruby wonders, exploit building, porting exploits to framework, and third party tools like armitage, and SET. Metasploit Penetration Testing Cookbook is the required guide to penetration testing and exploitation.

Who is this book for?

This book targets both professional penetration testers as well as new users of Metasploit who wish to gain expertise over the framework. The book requires basic knowledge of scanning, exploitation, and Ruby language.

What you will learn

  • Set up a complete penetration testing environment using metasploit and virtual machines
  • Learn to penetration-test popular operating systems such as Windows7, Windows 2008 Server, Ubuntu etc.
  • Get familiar with penetration testing based on client side exploitation techniques with detailed analysis of vulnerabilities and codes
  • Avail of exclusive coverage of antivirus bypassing techniques using metasploit
  • Master post-exploitation techniques such as exploring the target, keystrokes capturing, sniffing, pivoting, setting persistent connections etc.
  • Build and analyze meterpreter scripts in Ruby
  • Build and export exploits to framework
  • Use extension tools like Armitage, SET etc.

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jun 22, 2012
Length: 268 pages
Edition : 1st
Language : English
ISBN-13 : 9781849517430
Category :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Jun 22, 2012
Length: 268 pages
Edition : 1st
Language : English
ISBN-13 : 9781849517430
Category :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just Mex$85 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just Mex$85 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total Mex$ 3,611.97
BackTrack 5 Wireless Penetration Testing Beginner's Guide
Mex$1128.99
Metasploit Penetration Testing Cookbook
Mex$1128.99
Advanced Penetration Testing for Highly-Secured Environments: The Ultimate Security Guide
Mex$1353.99
Total Mex$ 3,611.97 Stars icon
Banner background image

Table of Contents

10 Chapters
Metasploit Quick Tips for Security Professionals Chevron down icon Chevron up icon
Information Gathering and Scanning Chevron down icon Chevron up icon
Operating System-based Vulnerability Assessment and Exploitation Chevron down icon Chevron up icon
Client-side Exploitation and Antivirus Bypass Chevron down icon Chevron up icon
Using Meterpreter to Explore the Compromised Target Chevron down icon Chevron up icon
Advanced Meterpreter Scripting Chevron down icon Chevron up icon
Working with Modules for Penetration Testing Chevron down icon Chevron up icon
Working with Exploits Chevron down icon Chevron up icon
Working with Armitage Chevron down icon Chevron up icon
Social Engineer Toolkit Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.9
(13 Ratings)
5 star 38.5%
4 star 46.2%
3 star 0%
2 star 0%
1 star 15.4%
Filter icon Filter
Top Reviews

Filter reviews by




Kindle Customer Nov 17, 2022
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Facebook is good to have your five good test your face challenges everybody is good and easy to understand how they work the tools you need and guys and the steps you can do very easy you do not need to read the book but to know the commands
Amazon Verified review Amazon
Howard Rayle Nov 16, 2013
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Excellent information about how to get the most from Metasploit. Takes you through step by step with pictures of commands.
Amazon Verified review Amazon
Manoj Sep 11, 2012
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Metasploit penetration testing cookbook is a must have for security professionals and new learners of metasploit framework.The book is easy to grasp and flows from beginner to advance level smoothly. The reason which makes it a better guide is that it targets latest operating systems and also gives a detailed analysis of different exploit codes used in penetration testing. The book also coveres extra topics like Armitage, SET etc which further addes more power to the content of this book. To summerize, the book is a very handy guide to mastering the metasploit framework.
Amazon Verified review Amazon
Michael Mar 25, 2013
Full star icon Full star icon Full star icon Full star icon Full star icon 5
perfect in every aspect for some one avid enough to have found this program, but not necessarily know anything about it, written in easy to understand language and broken down nicely
Amazon Verified review Amazon
CNC guy Sep 11, 2012
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Overview: Singh provides an introduction to the widely used Metasploit framework in the form of seventy plus recipes for various penetration testing tasks. In a previous blog, I reviewed Dave Kennedy's Metasploit book. Both texts are well written. The format is different, however. Singh's book is written in a cookbook style which makes it easy to refer to it when attempting specific tasks. Kennedy's book is written in a more traditional style with an introduction and then survey of various aspects of Metasploit. The differences between these two books extends beyond format. Singh's book goes beyond a basic coverage of Metasploit and covers additional penetration testing tools such as various scanners and evasion tools. So which book should you buy if you had to pick just one? To me it mostly comes down to personal preference. If you are just learning Metasploit, either should be a great aid in this process. If you want a book you can refer back to later, the Singh book may be slightly more convenient. The publisher may also be a consideration. The Kennedy book is published by No Starch Press, whereas Singh's book is published by Packt. If you like eBooks you may prefer books from Packt Publishing. Packt provides DRM-free books in both PDF and ePub formats. This can be extremely convenient if you like to read your books on multiple devices. Personally I find myself reading books on my tablet and also keeping a copy on my penetration testing platform as a reference. Here is a brief table of contents for Singh's book:Chapter 1: Metasploit Quick Tips for Security Professionals covering: configuration, installation, basic use, and storing results in a databaseChapter 2: Information Gathering and Scanning covering: passive and active gathering, social engineering, scanning, Nessus, NeXpose, and DradisChapter 3: Operating System-based Vulnerability Assessment covering: exploits, Windows XP, remote shells, Windows 2003, Windows 7, Linux, and DLL injectionChapter 4: Client-side Exploitation and Antivirus bypass covering: IE, Word, Adobe Reader, payloads, and killing anti-virusChapter 5: Using Meterpreter to Explore the Compromised Target covering: Meterpreter commands, privilege escalation, communication channels, and snooping on Windows targetsChapter 6: Advanced Meterpreter Scripting covering: hash dumps, back doors, pivoting, Railgun, pivoting, and killing firewallsChapter 7: Working with Modules for Penetration Testing covering: Auxiliary modules, admin modules, SQL injection, post-exploitation, and creating new modulesChapter 8: Working with Exploits covering: mixins, msfvenum, going from exploit to Metasploit module, and fuzzingChapter 9: Working with Armitage covering: Getting started, information gathering, and targeting multiple machinesChapter 10: Social Engineering Toolkit covering: Installation, configuration, spear-phishing, website attacks, and infectious media generationTo summarize, if you are looking for a Metasploit book in cookbook format than this book would be a good choice.cross-posted from [..]
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.