> For the complete documentation index, see [llms.txt](https://blog.hacktive.bebzounette.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://blog.hacktive.bebzounette.com/active-directory/untitled/tcp-udp.md).

# TCP/UDP

Nmap is a popular choice for a port scan and for good reason, Nmap has tons of options and is capable of much more than just a port scan.

{% tabs %}
{% tab title="Unix" %}
The goal will be to scan/test the hosted applications/services:

```python
# Basic scan of the first 1000 TCP ports
nmap -sS -n --open 10.10.10.0/24

# More intense scanning of open ports
nmap -sT -Pn -n --open 10.10.10.0/24 -sV -p 42,53,80,88,135,139,389,443,445,464,593,636,1512,3306,3268,3269,3389,8080,8889
```

{% endtab %}

{% tab title="Windows" %}
The nmap tool also exists for windows [here](https://nmap.org/book/inst-windows.html).

```python
# Basic scan of the first 1000 TCP ports
nmap -sS -n --open 10.10.10.0/24

# More intense scanning of open ports
nmap -sT -Pn -n --open 10.10.10.0/24 -sV -p 42,53,80,88,135,139,389,443,445,464,593,636,1512,3306,3268,3269,3389,8080,8888
```

It is also possible to use PowerShell to scan ports:

```powershell
$ip='localhost'
for($i=0; $i -le 65445; $i++){
    Test-NetConnection $ip -Port $i -InformationLevel 'Detailed'
}
```

{% endtab %}
{% endtabs %}

You can refer to the [Services ](/services/echo-7.md)part.


---

# 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://blog.hacktive.bebzounette.com/active-directory/untitled/tcp-udp.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.
