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