How To Use Metasploit in Kali Linux - A Step-By-Step Tutorial - C
How To Use Metasploit in Kali Linux - A Step-By-Step Tutorial - C
Home » Ethical hacking » Metasploit » How to Use Metasploit in Kali Linux: A Step-By-Step Tutorial
METASPLOIT
Share
cd /usr/share/metasploit-framework/modules
ls
tree -L 1 module-name/
Command Description
search Allows you to search from the Metasploit database based on the given
protocol/application/parameter
use Allows you to choose a particular module and changes the context to module-
specific commands
info Provides information about the selected module
show Displays information about the given module name and options for the current
module
check Checks if the target system has a vulnerability
Command Description
set It’s a context-specific variable that configures options for the current module
unset Removes previously set parameters
run Executes the current module
Before beginning, set up the Metasploit database by starting the PostgreSQL server and
initialize msfconsole database as follows:
You can run the regular nmap -p- <metasploitable_ip_address> command to confirm MySQL
database’s port number.
Use the search option to look for an auxiliary module to scan and enumerate the MySQL
database.
search type:auxiliary mysql
From the above list, you can use the auxiliary/scanner/mysql/mysql_version module by
typing the module name or associated number to scan MySQL version details.
use 11
Or:
use auxiliary/scanner/mysql/mysql_version
Now use the show options command to display the necessary parameters required for
executing the current module:
The output displays that the only required and unset option is RHOSTS which is the IP
address of the target machine. Use the set rhosts command to set the parameter and run the
module, as follows:
The output displays the similar MySQL version details as the db_nmap function.
Bruteforce MySQL Root Account With msfconsole
After scanning, you can also brute force MySQL root account via
Metasploit’s auxiliary(scanner/mysql/mysql_login) module.
You’ll need to set the PASS_FILE parameter to the wordlist path available
inside /usr/share/wordlists:
Then, specify the IP address of the target machine with the RHOSTS command.
set RHOSTS <metasploitable-ip-address>
Set BLANK_PASSWORDS to true in case there is no password set for the root account.
run
Conclusion
Congratulations!!!.. You have successfully learned “How to Use Metasploit for Hacking in Kali
Linux”. I hope now you have good knowledge of using Metasploit in Kali Linux.
Metasploit
Rocky is a versatile author sharing in-depth tutorials on web development, AI, and ethical
hacking. Unlock new possibilities and expand your knowledge with Rocky's empowering
content.
Related Posts
CHEATSHEET
ADD A COMMENT
Search … SEARCH
Support Us
ABOUT US
This is the Codelivly blog. Here, you will find articles discussing various topics related to coding
and programming. Our goal is to provide helpful resources and advice for beginners and
experienced coders alike.
RECENT POSTS
IMPORTANT PAGE
About Us
Advertise With Us
Contact US
Privacy Policy
Refund Policy
Write For Us