Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Kali Linux - An Ethical Hacker's Cookbook
Kali Linux - An Ethical Hacker's Cookbook

Kali Linux - An Ethical Hacker's Cookbook: End-to-end penetration testing solutions

eBook
€20.98 €29.99
Paperback
€36.99
Subscription
Free Trial
Renews at €18.99p/m

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

Kali Linux - An Ethical Hacker's Cookbook

Gathering Intel and Planning Attack Strategies

In this chapter, we will cover the following recipes:

  • Getting a list of subdomains
  • Using Shodan for fun and profit
  • Shodan Honeyscore
  • Shodan plugins
  • Using Nmap to find open ports
  • Bypassing firewalls with Nmap
  • Searching for open directories
  • Performing deep magic with DMitry
  • Hunting for SSL flaws
  • Exploring connections with intrace
  • Digging deep with theharvester
  • Finding technology behind web apps
  • Scanning IPs with masscan
  • Sniffing around with Kismet
  • Testing routers with firewalk

Introduction

We learned in the previous chapter the basics of hunting subdomains. In this chapter, we dive a little deeper and look at other different tools available for gathering Intel on our target. We start by using the infamous tools of Kali Linux.

Gathering information is a very crucial stage of performing a penetration test, as every next step we take after this will totally be an outcome of all the information we gather during this stage. So it is very important that we gather as much information as possible before jumping into the exploitation stage.

Getting a list of subdomains

We don't always we have a situation where a client has defined a full detailed scope of what needs to be pentested. So we will use the following mentioned recipes to gather as much information as we can to perform a pentest.

Fierce

We start with jumping into Kali's Terminal and using the first and most widely used tool fierce.

How to do it...

The following steps demonstrate the use of fierce:

  1. To launch fierce, we type fierce -h to see the help menu:
  1. To perform a subdomain scan we use the following command:
        fierce -dns...

Using Shodan for fun and profit

Shodan is the world's first search engine to search for devices connected to the internet. It was launched in 2009 by John Matherly. Shodan can be used to look up webcams, databases, industrial systems, video games, and so on. Shodan mostly collects data on the most popular web services running, such as HTTP, HTTPS, MongoDB, FTP, and many more.

Getting ready

To use Shodan we will need to create an account on Shodan.

How to do it...

Shodan Honeyscore

Shodan Honeyscore is another great project built in the Python. It helps us figure out whether an IP address we have is a honeypot or a real system.

How to do it...

The following steps demonstrate the use of Shodan Honeyscore:

  1. To use Shodan Honeyscore we visit https://honeyscore.shodan.io/:
  1. Enter the IP address we want to check, and that's it!

Shodan plugins

To make our life even easier, Shodan has plugins for Chrome and Firefox that can be used to check open ports for websites we visit on the go!

How to do it...

We download and install the plugin from https://www.shodan.io/. Browse any website and we will see that by clicking on the plugin we can see the open ports:

See also

  • The Dnscan recipe from Chapter 1, Kali – An Introduction
  • The Digging deep with theharvester recipe

Using Nmap to find open ports

Network Mapper (Nmap) is a security scanner written by Gordon Lyon. It is used to find hosts and services in a network. It first came out in September 1997. Nmap has various features as well as scripts to perform various tests such as finding the OS, service version, brute force default logins, and so on.

Some of the most common types of scan are:

  • TCP connect() scan
  • SYN stealth scan
  • UDP scan
  • Ping scan
  • Idle scan

How to do it...

The following is the recipe for using Nmap:

  1. Nmap is already installed in Kali Linux. We can type the following command to start it and see all the options available:
        nmap -h

The following screenshot shows the output of the preceding command:

  1. To perform a basic...

Introduction


We learned in the previous chapter the basics of hunting subdomains. In this chapter, we dive a little deeper and look at other different tools available for gathering Intel on our target. We start by using the infamous tools of Kali Linux.

Gathering information is a very crucial stage of performing a penetration test, as every next step we take after this will totally be an outcome of all the information we gather during this stage. So it is very important that we gather as much information as possible before jumping into the exploitation stage.

Getting a list of subdomains


We don't always we have a situation where a client has defined a full detailed scope of what needs to be pentested. So we will use the following mentioned recipes to gather as much information as we can to perform a pentest.

Fierce

We start with jumping into Kali's Terminal and using the first and most widely used tool fierce.

How to do it...

The following steps demonstrate the use of fierce:

  1. To launch fierce, we type fierce -h to see the help menu:
  1. To perform a subdomain scan we use the following command:
        fierce -dns host.com -threads 10

The following screenshot shows the output of the preceding command:

DNSdumpster

This is a free project by Hacker Target to look up subdomains. It relies on https://scans.io/ for its results. It can also be used to get the subdomains of a website. We should always prefer to use more than one tool for subdomain enumeration as we may get something from other tools that the first one failed to pick.

How to do it...

It is pretty simple...

Using Shodan for fun and profit


Shodan is the world's first search engine to search for devices connected to the internet. It was launched in 2009 by John Matherly. Shodan can be used to look up webcams, databases, industrial systems, video games, and so on. Shodan mostly collects data on the most popular web services running, such as HTTP, HTTPS, MongoDB, FTP, and many more.

Getting ready

To use Shodan we will need to create an account on Shodan.

How to do it...

To learn about Shodan, follow the given steps:

  1. Open your browser and visit https://www.shodan.io:
  1. We begin by performing a simple search for the FTP services running. To do this we can use the following Shodan dorks: port:"21". The following screenshot shows the search results:
  1. This search can be made more specific by specifying a particular country/organization: port:"21" country:"IN". The following screenshot shows the search results:
  1. We can now see all the FTP servers running in India; we can also see the servers that allow anonymous...

Shodan Honeyscore


Shodan Honeyscore is another great project built in the Python. It helps us figure out whether an IP address we have is a honeypot or a real system.

How to do it...

The following steps demonstrate the use of Shodan Honeyscore:

  1. To use Shodan Honeyscore we visit https://honeyscore.shodan.io/:
  1. Enter the IP address we want to check, and that's it!

Shodan plugins


To make our life even easier, Shodan has plugins for Chrome and Firefox that can be used to check open ports for websites we visit on the go!

How to do it...

We download and install the plugin from https://www.shodan.io/. Browse any website and we will see that by clicking on the plugin we can see the open ports:

See also

  • The Dnscan recipe from Chapter 1, Kali – An Introduction
  • The Digging deep with theharvester recipe

Using Nmap to find open ports


Network Mapper (Nmap) is a security scanner written by Gordon Lyon. It is used to find hosts and services in a network. It first came out in September 1997. Nmap has various features as well as scripts to perform various tests such as finding the OS, service version, brute force default logins, and so on.

Some of the most common types of scan are:

  • TCP connect() scan
  • SYN stealth scan
  • UDP scan
  • Ping scan
  • Idle scan

How to do it...

The following is the recipe for using Nmap:

  1. Nmap is already installed in Kali Linux. We can type the following command to start it and see all the options available:
        nmap -h

The following screenshot shows the output of the preceding command:

  1. To perform a basic scan we use the following command:
        nmap -sV -Pn x.x.x.x

The following screenshot shows the output of the preceding command:

  1. -Pn implies that we do not check whether the host is up or not by performing a ping request first. The -sV parameter is to list all the running services on...

Bypassing firewalls with Nmap


Most of the time during a pentest, we will come across systems protected by firewalls or Intrusion Detection Systems (IDS). The Nmap provides different ways to bypass these IDS/firewalls to perform port scans on a network. In this recipe, we will learn some of the ways we can bypass firewalls.

TCP ACK scan

The ACK scan (-sA) sends acknowledgment packets instead of SYN packets, and the firewall does not create logs of ACK packets as it will treat ACK packets as responses to SYN packets. It is mostly used to map the type of firewall being used.

How to do it...

The ACK scan was made to show unfiltered and filtered ports instead of open ones.

The command for ACK scan is:

nmap -sA x.x.x.x

Let's look at the comparison of how a normal scan differs from an ACK scan:

 

Here we see the difference between a normal scan and an ACK scan:

How it works...

The scan results of filtered and unfiltered ports depends on whether a firewall being used is stateful or stateless. A stateful firewall...

Searching for open directories


In the previous recipe, we discussed how to find open ports on a network IP or domain name. We often see developers running web servers on different ports. Sometimes developers may also leave directories misconfigured that may contain juicy information for us. We have already covered dirsearch in the previous chapter; here we will look at alternatives.

The dirb tool

The dirb tool is a well-known tool that can be used to brute force open directories. Although it is generally slow and does not support multi-threading, it is still a great way to find directories/subdirectories that may have been left open due to a misconfiguration.

How to do it...

Type the following command to fire up the tool:

dirb https://domain.com

The following screenshot shows the output of the preceding command:

There's more...

There are other options in dirb, as well, that come in handy:

  • -a: to specify a user agent
  • -c: to specify a cookie
  • -H: to enter a custom header
  • -X: to specify the file extension...

Performing deep magic with DMitry


The Deepmagic Information Gathering Tool (DMitry) is a command-line tool open source application coded in C. It has the capability of gathering subdomains, email addresses, whois info, and so on, about a target.

How to do it...

To learn about DMitry, follow the given steps:

  1. We use a simple command:
dmitry -h

The following screenshot shows the output of the preceding command:

  1. Next, we try performing an email, whois, TCP port scan, and subdomain search by using the following:
dmitry -s -e -w -p domain.com

The following screenshot shows the output of the preceding command:

Hunting for SSL flaws


Most of the web applications today use SSL to communicate with the server. The sslscan is a great tool to check SSL for flaws or misconfigurations.

How to do it...

To learn about sslscan follow the given steps:

  1. We will look at the help manual to see the various options the tool has:
sslscan -h  

The following screenshot shows the output of the preceding command:

  1. To run the tool against a host we type the following:
sslscan host.com:port 

The following screenshot shows the output of the preceding command:

See also

  • The A tale of a bleeding heart recipe from Chapter 5, Network Exploitation on Current Exploitation

TLSSLed is also an alternative we can use in Kali to perform checks on SSL.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • •Practical recipes to conduct effective penetration testing using the powerful Kali Linux
  • •Leverage tools like Metasploit, Wireshark, Nmap, and many more to detect vulnerabilities with ease
  • •Confidently perform networking and application attacks using task-oriented recipes

Description

With the current rate of hacking, it is very important to pentest your environment in order to ensure advanced-level security. This book is packed with practical recipes that will quickly get you started with Kali Linux (version 2016.2) according to your needs, and move on to core functionalities. This book will start with the installation and configuration of Kali Linux so that you can perform your tests. You will learn how to plan attack strategies and perform web application exploitation using tools such as Burp, and Jexboss. You will also learn how to perform network exploitation using Metasploit, Sparta, and Wireshark. Next, you will perform wireless and password attacks using tools such as Patator, John the Ripper, and airoscript-ng. Lastly, you will learn how to create an optimum quality pentest report! By the end of this book, you will know how to conduct advanced penetration testing thanks to the book’s crisp and task-oriented recipes.

Who is this book for?

This book is aimed at IT security professionals, pentesters, and security analysts who have basic knowledge of Kali Linux and want to conduct advanced penetration testing techniques.

What you will learn

  • • Installing, setting up and customizing Kali for pentesting on multiple platforms
  • • Pentesting routers and embedded devices
  • • Bug hunting 2017
  • • Pwning and escalating through corporate network
  • • Buffer over?ows 101
  • • Auditing wireless networks
  • • Fiddling around with software-defned radio
  • • Hacking on the run with NetHunter
  • • Writing good quality reports

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Oct 17, 2017
Length: 376 pages
Edition : 1st
Language : English
ISBN-13 : 9781787120280
Vendor :
Linux Foundation
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 : Oct 17, 2017
Length: 376 pages
Edition : 1st
Language : English
ISBN-13 : 9781787120280
Vendor :
Linux Foundation
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.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
€189.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 €5 each
Feature tick icon Exclusive print discounts
€264.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 €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 115.97
Kali Linux Cookbook
€36.99
Kali Linux - An Ethical Hacker's Cookbook
€36.99
Mastering Kali Linux for Advanced Penetration Testing, Second Edition
€41.99
Total 115.97 Stars icon
Banner background image

Table of Contents

12 Chapters
Kali – An Introduction Chevron down icon Chevron up icon
Gathering Intel and Planning Attack Strategies Chevron down icon Chevron up icon
Vulnerability Assessment Chevron down icon Chevron up icon
Web App Exploitation – Beyond OWASP Top 10 Chevron down icon Chevron up icon
Network Exploitation on Current Exploitation Chevron down icon Chevron up icon
Wireless Attacks – Getting Past Aircrack-ng Chevron down icon Chevron up icon
Password Attacks – The Fault in Their Stars Chevron down icon Chevron up icon
Have Shell Now What? Chevron down icon Chevron up icon
Buffer Overflows Chevron down icon Chevron up icon
Playing with Software-Defined Radios Chevron down icon Chevron up icon
Kali in Your Pocket – NetHunters and Raspberries Chevron down icon Chevron up icon
Writing Reports 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.8
(20 Ratings)
5 star 65%
4 star 0%
3 star 10%
2 star 0%
1 star 25%
Filter icon Filter
Top Reviews

Filter reviews by




abhilasha gupta Jan 11, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
After so long i found a book that genuinely teaches me something!
Amazon Verified review Amazon
Anthony Feb 04, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Amazing book
Amazon Verified review Amazon
Ayan Saha May 25, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
its the best book available in india to learn kali Linux penetration testing in a practical manner , don't waste your time and money by funding money on courses which costs 1000$ , rather but this type of books you can great a plenty amount of knowledge from them
Amazon Verified review Amazon
Trip Nine May 25, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Kali Linux - An Ethical Hacker's Cookbook (Second Edition) is jam packed with techniques and exploits that are relevant for 2019 and it's packaged in an easy to read bundle.Sure you can find a lot of things on the internet for free that are covered in the book - but not all in one place. And time is money.Don't burn hours trying to compile exploits and tactics that make up a great Kali cookbook when there is one right here.Get it and then use it to as a library reference delivering value to your customers in information security.
Amazon Verified review Amazon
Yehia Serrieh May 27, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
comprehensive and very practical book it contains a skills, and experience you will never find on internet this book can teach you tips, tricks, and hints so you can master kali with all tools included
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.