> For the complete documentation index, see [llms.txt](https://cas-cyber.gitbook.io/cas-cybersecurity/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cas-cyber.gitbook.io/cas-cybersecurity/scanning-and-enumeration/scanning-with-nmap.md).

# Scanning with nmap

### scanning with nmap

I don't solve this box yet, I'll go further with nmap command line scanner

> nmap -v 10.10.10.28&#x20;

**-v** stands for verbose (that we see some output)

In that case nmap sends ping packets to the target host. We can verify that with tcpdump:

> sudo tcpdump -i tun0 -p icmp

![listening for icmp packets on tun0 while doing a nmap scan](/files/-MhXuVoH7OawKKkPQBPW)

> sudo nmap 10.10.10.28 -v -Pn -sV -O

![no icmp packets detected](/files/-MhYB9TasbdrvthaoCBf)

If we use the paramater **-Pn** nmap doesn't send ping packets. -**sV** stands for Version detection and **-O** for OS detection.

-**A** enables OS detection, version detection, script scan and traceroute

-**p** is for specific ports (example -p22,80,443)

**-T** can be used for timing options (4 is default, 5 is maximum) --> Can be used to evade firewall and IDS detection

**-sS** stand for stealth scan or syn scan

-**oA scan\_results** writes an output file

<div align="left"><img src="/files/-MhYDe6UD0zdlgdQslz5" alt=""></div>

**-iL targets.txt** Input list of ip addresses to scan

-**F** scan top 100 ports (fastscan)

-**sU** -**p U:53** performs UDP scan on port 53

**-sC** or --**script** use a specific NSE script

> sudo nmap --script smb-enum-users.nse -p 445 10.10.10.27

NSE scripts are located in **/usr/share/nmap/scripts**

![some smb nse scripts](/files/-MhYghq1j-U8ti39x-3v)

NSE Scripts extends the core functionality of nmap. You can find more informations about them inside the help of nmap or the NSE reference: <https://nmap.org/nsedoc/>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://cas-cyber.gitbook.io/cas-cybersecurity/scanning-and-enumeration/scanning-with-nmap.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
