Skip to content

Instantly share code, notes, and snippets.

@rmoyano
Last active June 3, 2024 17:01
Show Gist options
  • Save rmoyano/2ac323942ab448ee49fb2b2c5440418a to your computer and use it in GitHub Desktop.
Save rmoyano/2ac323942ab448ee49fb2b2c5440418a to your computer and use it in GitHub Desktop.

Nmap cheatsheet

Tests

Basic test using Google IP:

user@notebook:~$ nmap 8.8.8.8
Starting Nmap 7.80 ( https://nmap.org ) at 2024-06-03 13:52 -03
Nmap scan report for dns.google (8.8.8.8)
Host is up (0.027s latency).
Not shown: 998 filtered ports
PORT    STATE SERVICE
53/tcp  open  domain
443/tcp open  https

Nmap done: 1 IP address (1 host up) scanned in 4.95 seconds

Using OS detection:

user@notebook:~$ sudo nmap -O www.mit.edu
Starting Nmap 7.80 ( https://nmap.org ) at 2024-06-03 13:56 -03
Nmap scan report for www.mit.edu (23.1.195.2)
Host is up (0.17s latency).
Other addresses for www.mit.edu (not scanned): 2600:141b:1c00:2484::255e 2600:141b:1c00:248d::255e
rDNS record for 23.1.195.2: a23-1-195-2.deploy.static.akamaitechnologies.com
Not shown: 998 filtered ports
PORT    STATE SERVICE
80/tcp  open  http
443/tcp open  https
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running (JUST GUESSING): Linux 2.6.X|3.X|4.X (87%)
OS CPE: cpe:/o:linux:linux_kernel:2.6.32 cpe:/o:linux:linux_kernel:3.10 cpe:/o:linux:linux_kernel:4
Aggressive OS guesses: Linux 2.6.32 or 3.10 (87%), Linux 3.11 - 4.1 (87%), Linux 2.6.18 - 2.6.22 (86%), Linux 2.6.32 (85%), Linux 3.2 - 3.8 (85%), Linux 4.4 (85%)
No exact OS matches for host (test conditions non-ideal).

OS detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 16.97 seconds

Using IPV6 argument:

user@notebook:~$ nmap -6 2607:f8b0:4006:81d::2004
Starting Nmap 7.80 ( https://nmap.org ) at 2024-06-03 14:00 -03
Note: Host seems down. If it is really up, but blocking our ping probes, try -Pn
Nmap done: 1 IP address (0 hosts up) scanned in 0.04 seconds
user@notebook:~$ 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment