Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Metasploit for Beginners

You're reading from  Metasploit for Beginners

Product type Book
Published in Jul 2017
Publisher Packt
ISBN-13 9781788295970
Pages 190 pages
Edition 1st Edition
Languages
Author (1):
Sagar Rahalkar Sagar Rahalkar
Profile icon Sagar Rahalkar

Table of Contents (11) Chapters

Preface 1. Introduction to Metasploit and Supporting Tools 2. Setting up Your Environment 3. Metasploit Components and Environment Configuration 4. Information Gathering with Metasploit 5. Vulnerability Hunting with Metasploit 6. Client-side Attacks with Metasploit 7. Web Application Scanning with Metasploit 8. Antivirus Evasion and Anti-Forensics 9. Cyber Attack Management with Armitage 10. Extending Metasploit and Exploit Development

Information Gathering with Metasploit

Information gathering and enumeration are the initial stages of penetration testing life cycle. These stages are often overlooked, and people directly end up using automated tools in an attempt to quickly compromise the target. However, such attempts are less likely to succeed.

"Give me six hours to chop down a tree and I will spend the first four sharpening the axe."
- Abraham Lincoln

This is a very famous quote by Abraham Lincoln which is applicable to penetration testing as well! The more efforts you take to gather information about your targets and enumerate them, the more likely you are to succeed with compromise. By performing comprehensive information gathering and enumeration, you will be presented with wealth of information about your target, and then you can precisely decide the attack vector in order to compromise the...

Information gathering and enumeration

In this section, we'll explore various auxiliary modules within the Metasploit Framework that can be effectively used for information gathering and enumeration of various protocols such as TCP, UDP, FTP, SMB, SMTP, HTTP, SSH, DNS, and RDP. For each of these protocols, you will learn multiple auxiliary modules along with the necessary variable configurations.

Transmission Control Protocol

Transmission Control Protocol (TCP) is a connection-oriented protocol and ensures reliable packet transmission. Many of the services such as Telnet, SSH, FTP, and SMTP make use of the TCP protocol. This module performs a simple port scan against the target system and tells us which TCP ports are open...

Password sniffing

Password sniffing is a special type of auxiliary module that listens on the network interface and looks for passwords sent over various protocols such as FTP, IMAP, POP3, and SMB. It also provides an option to import previously dumped network traffic in .pcap format and look for credentials within.

Its auxiliary module name is auxiliary/sniffer/psnuffle, and it can be seen in the following screenshot:

Advanced search with shodan

Shodan is an advanced search engine that is used to search for internet connected devices such as webcams and SCADA systems. It can also be effectively used for searching vulnerable systems. Interestingly, the Metasploit Framework has a capability to integrate with Shodan to fire search queries right from msfconsole.

In order to integrate Shodan with the Metasploit Framework, you first need to register yourself on https://www.shodan.io. Once registered, you can get the API key from the Account Overview section shown as follows:

Its auxiliary module name is auxiliary/gather/shodan_search, and this auxiliary module connects to the Shodan search engine to fire search queries from msfconsole and get the search results.

You will have to configure the following parameters:

  • SHODAN_APIKEY: The Shodan API key available to registered Shodan users
  • QUERY: Keyword...

Summary

In this chapter, we have seen how to use various auxiliary modules in the Metasploit Framework for information gathering and enumeration. In the next chapter, we'll learn to perform a detailed vulnerability assessment on our target systems.

Exercises

You can try the following exercises:

  • In addition to the auxiliary modules discussed in this chapter, try to explore and execute the following auxiliary modules:
    • auxiliary/scanner/http/ssl_version
    • auxiliary/scanner/ssl/openssl_heartbleed
    • auxiliary/scanner/snmp/snmp_enum
    • auxiliary/scanner/snmp/snmp_enumshares
    • auxiliary/scanner/snmp/snmp_enumusers
  • Use the Shodan auxiliary module to find out various internet connected devices
lock icon The rest of the chapter is locked
You have been reading a chapter from
Metasploit for Beginners
Published in: Jul 2017 Publisher: Packt ISBN-13: 9781788295970
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}