Searchsploit & Exploit-DB Command Cheat Sheet
searchsploit is a command-line search utility for Exploit-DB, allowing security researchers and auditors to perform fast, offline queries against thousands of published proof-of-concept exploits, advisories, and papers.
1. Title Search by Software Name & Version
Section titled “1. Title Search by Software Name & Version”What It Does
Section titled “What It Does”Performs an offline grep across exploit titles stored in the local Exploit-DB database.
Syntax & Options
Section titled “Syntax & Options”searchsploit -t <software_name_and_version>-t: Restricts search solely to exploit titles rather than searching the full advisory body, significantly reducing false positives.
Safe Example & Interpretation
Section titled “Safe Example & Interpretation”searchsploit -t "vsftpd 2.3.4"Expected Output:
---------------------------------------------------------------------- --------------------------------- Exploit Title | Path---------------------------------------------------------------------- ---------------------------------vsftpd 2.3.4 - Backdoor Command Execution | unix/remote/49757.pyvsftpd 2.3.4 - Backdoor Command Execution (Metasploit) | unix/remote/17491.rb---------------------------------------------------------------------- ---------------------------------Shellcodes: No ResultsInterpretation: Two public proof-of-concept scripts exist for vsftpd 2.3.4. Their local files are located relative to /usr/share/exploitdb/exploits/.
2. Searching by CVE Identifier
Section titled “2. Searching by CVE Identifier”What It Does
Section titled “What It Does”Directly locates exploit entries mapped to an official Common Vulnerabilities and Exposures (CVE) number.
Syntax & Options
Section titled “Syntax & Options”searchsploit --cve <YYYY-NNNNN>Safe Example & Interpretation
Section titled “Safe Example & Interpretation”searchsploit --cve 2021-41773Expected Output:
---------------------------------------------------------------------- --------------------------------- Exploit Title | Path---------------------------------------------------------------------- ---------------------------------Apache HTTP Server 2.4.49 - Path Traversal & Remote Code Execution | multiple/webapps/50383.sh---------------------------------------------------------------------- ---------------------------------Interpretation: Quickly identifies the exact bash script exploit for the Apache 2.4.49 path traversal vulnerability.
3. Mirroring Exploit Files Locally (-m)
Section titled “3. Mirroring Exploit Files Locally (-m)”What It Does
Section titled “What It Does”Copies the chosen exploit file directly into your current working directory without modifying the system’s core Exploit-DB repository.
Syntax & Options
Section titled “Syntax & Options”searchsploit -m <exploit_path_or_id>Safe Example & Interpretation
Section titled “Safe Example & Interpretation”searchsploit -m unix/remote/49757.pyExpected Output:
Exploit: vsftpd 2.3.4 - Backdoor Command Execution URL: https://www.exploit-db.com/exploits/49757 Path: /usr/share/exploitdb/exploits/unix/remote/49757.pyFile Type: Python script, ASCII text executable
Copied to: /home/mihraj/49757.pyInterpretation: The script is now available locally at ./49757.py where it can be inspected and audited with a text editor (cat or nano) before any authorized testing.
4. Correlating Nmap Scan XML Output (--nmap)
Section titled “4. Correlating Nmap Scan XML Output (--nmap)”What It Does
Section titled “What It Does”Automatically parses an Nmap XML output file and runs searchsploit queries for every identified service banner.
Syntax & Options
Section titled “Syntax & Options”# 1. Run Nmap with XML outputnmap -sV -oX scan.xml 192.168.1.10
# 2. Correlate with searchsploitsearchsploit --nmap scan.xmlSafe Example & Interpretation
Section titled “Safe Example & Interpretation”searchsploit --nmap scan.xmlExpected Output:
[i] SearchSploit's XML mode (Scanning for service versions)[i] Reading XML file: scan.xml[i] Found 3 services: - Service: Apache httpd 2.4.49 -> 2 exploits found - Service: OpenSSH 8.9p1 -> 0 exploits found - Service: vsftpd 2.3.4 -> 2 exploits foundInterpretation: Eliminates manual searching for each open port identified during the reconnaissance phase.
5. Defensive & Authorization Considerations
Section titled “5. Defensive & Authorization Considerations”- Malicious Exploit Payloads: Exploit-DB archives community submissions. Historically, malicious actors have occasionally submitted PoCs containing embedded wiper scripts or reverse shells connecting to unexpected third-party C2 servers. Always audit the Python, C, or Ruby source code prior to running.
- Compilation Precautions: If compiling C exploits (
gcc exploit.c -o exploit), do so inside an unprivileged virtual machine or container to prevent accidental local privilege corruption. - Database Currency: Run
searchsploit -uperiodically on systems with internet access to refresh the local Git mirror against the latest published CVEs.