Nmap: Difference between revisions
From Cramsession
Jump to navigationJump to search
✍️ Verified Author: Mflavell • Click to view professional profile & credentials
No edit summary |
|||
| Line 30: | Line 30: | ||
=Port states in NMAP= | =Port states in NMAP= | ||
| Line 45: | Line 46: | ||
* Closed|Filtered - Cannot determine if closed or filtered. | * Closed|Filtered - Cannot determine if closed or filtered. | ||
https://nmap.org/book/man-port-scanning-basics.html | |||
[https://nmap.org/book/man-port-scanning-basics.html] | |||
Revision as of 20:47, 29 May 2025
Cybersecurity > Pentesting > Nmap
Simple NMAP scan of the network
sudo su nmap -sn network/mask -oN hosts.txt
- sn prevents a port scan of hosts
Just return the IP addresses
nmap -n -sn network/mask -oG | awk '/Up$/{print $2}' | sort -V > hosts.txt
Find the open ports
nmap ip
Find the open ports for a small IP range
nmap start ip-end octlet
example
nmap 192.168.0.1-20
Port states in NMAP
- Open - Accepting TCP connections
- Closed - Accessible but nobody is listening
- Filtered - Cannot determine if port is open
- Firewall rules could be filtering the port.
- Unfiltered - Accessible but cannot determine if open or closed.
- Open|Filtered - Cannot determine if open OR filtered.
- Closed|Filtered - Cannot determine if closed or filtered.