# Nmap

{% file src="/files/7xFFFJCUzWL1WiZ4Szf3" %}

### Simple Scan

```bash
# Scan IP
nmap 192.168.100.1 
```

### Port Options

```bash
# Scan All Ports
nmap -p- 192.168.100.56
# Fast Scan
nmap -f 192.168.100.56 
# Scan range of ports
nmap -p 1-100 192.168.100.56 
# Scan single port
nmap -p 80 192.168.100.56
# Scan a selection of ports
nmap -p 21,22,25 192.168.100.56
```

### IP options

```bash
# Scan range of IPs
nmap 192.168.100.1-20 
# Scan Subnet
nmap 192.168.100.1/24 
```

### Advanced Scans

```bash
# Save results to file
nmap -oA filename 192.168.100.56
# Change XML to HTML
xlstproc filename.xml -o filename.html
# OS detection
nmap -O 192.168.100.56 
```

### Vulnerable scan Option

```bash
# Vulnerability Detection
nmap -sC --script vuln 192.168.100.56 
# HTTP Vulnerability Detection
nmap -p 80 -sC --script http 192.168.100.56 
```

### Best Options :

```bash
# Full scan
nmap -A 192.168.100.56 
# Port list [TCP SYN Ping]
nmap -PS 192.168.100.56 
# port list [TCP ACK Ping]
nmap -PA 192.168.100.56 
# TCP SYN scan
nmap -sS 192.168.100.56 
# Version detection
nmap -sV 192.168.100.56 

# Scan with common scripts
nmap -Pn -T4 -A -p- <IP> --min-rate=5000
# Service Enumeration
nmap -T4 -sSCV -Pn -p=<PORTS> -vvv <IP> --min-rate=5000
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ceh.securescape.cc/information-gathering/nmap.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
