Skip to content

Instantly share code, notes, and snippets.

@rakibulinux
Created February 11, 2020 11:54
Show Gist options
  • Select an option

  • Save rakibulinux/24e151b4f46d9db61189ff2b28e0e013 to your computer and use it in GitHub Desktop.

Select an option

Save rakibulinux/24e151b4f46d9db61189ff2b28e0e013 to your computer and use it in GitHub Desktop.
How to Install & use the NMAP Security Scanner on Linux
#!/bin/sh
sudo apt-get update
sudo apt-get install nmap
nmap --version
#Scan IP range or subnet
sudo nmap target_IP or domain.com
#Port Specification and Scan Order
sudo nmap –p 80,443 185.34.65.632
sudo nmap –sU –p 80,130,255 185.34.65.632
#TCP SYN scan
sudo nmap -sS 185.34.65.632
#TCP scan
sudo nmap –sT 185.34.65.632
#Nmap: Scan Speed, Aggression, and Verbosity
sudo nmap –A –T4 –v –Pn reddit.com
#NB: Aggressive Scan-: -A, Scan Output-: –v, Scan Speed-: -T0 (T0 and span to T5)
#Scan port 80 on the target system:
nmap –p 80 185.34.65.632
#Scan ports 1 through 200 on the target system:
nmap –p 1-200 185.34.65.632
#Scan (Fast) the most common ports:
nmap –F 185.34.65.632
#To scan all ports (1 – 65535):
nmap –p– 185.34.65.632
#Here is a brief list of standard ports and their designations:
21 – FTP
22 – SSH
25 – SMTP (sending email)
53 – DNS (domain name service)
80 – HTTP (web server)
110 – POP3 (email inbox)
123 – NTP (Network Time Protocol)
143 – IMAP (email inbox)
443 – HTTPS (secure web server)
465 – SMTPS (send secure email)
631 – CUPS (print server)
993 – IMAPS (secure email inbox)
995 – POP3 (secure email inbox)
#A Linux firewall can be configured to block all traffic on a particular port.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment