You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/generic-methodologies-and-resources/pentesting-network/nmap-summary-esp.md
+138-2Lines changed: 138 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ By default Nmap launches a discovery phase consisting of: `-PA80 -PS443 -PE -PP`
45
45
-**`--badsum`:** It sends the sum wrong, the computers would discard the packets, but the firewalls could answer something, it is used to detect firewalls.
46
46
-**`-sZ`:** "Weird" SCTP scanner, when sending probes with cookie echo fragments they should be dropped if open or responded with ABORT if closed. It can pass through firewalls that init does not pass through, the bad thing is that it does not distinguish between filtered and open.
47
47
-**`-sO`:** Protocol Ip scan. Sends bad and empty headers in which sometimes not even the protocol can be distinguished. If ICMP unreachable protocol arrives it is closed, if unreachable port arrives it is open, if another error arrives, filtered, if nothing arrives, open|filtered.
48
-
-**`-b <server>`:** FTPhost--> It is used to scan a host from another one, this is done by connecting the ftp of another machine and asking it to send files to the ports that you want to scan from another machine, according to the answers we will know if they are open or not. \[\<user>:\<password>@]\<server>\[:\<port>] Almost all ftps servers no longer let you do this and therefore it is of little practical use.
48
+
-**`-b <server>`:** FTPhost--> It is used to scan a host from another one, this is done by connecting the ftp of another machine and asking it to send files to the ports that you want to scan from another machine, according to the answers we will know if they are open or not. [\<user>:\<password>@]\<server>\[:\<port>] Almost all ftps servers no longer let you do this and therefore it is of little practical use.
49
49
50
50
### **Focus Analysis**
51
51
@@ -257,7 +257,143 @@ Moreover, probes which do not have a specifically defined **`servicewaitms`** us
257
257
If you don't want to change the values of **`totalwaitms`** and **`tcpwrappedms`** at all in the `/usr/share/nmap/nmap-service-probes` file, you can edit the [parsing code](https://github.com/nmap/nmap/blob/master/service_scan.cc#L1358) such that these values in the `nmap-service-probes` file are completely ignored.
258
258
259
259
260
-
{{#include ../../banners/hacktricks-training.md}}
260
+
## Build a static Nmap for restricted environments
261
+
262
+
In hardened or minimal Linux environments (containers, appliances), dynamically linked Nmap binaries often fail due to missing runtime loaders or shared libraries (e.g., /lib64/ld-linux-x86-64.so.2, libc.so). Building your own statically linked Nmap and bundling NSE data allows execution without installing system packages.
263
+
264
+
High-level approach
265
+
- Use a clean amd64 Ubuntu builder via Docker.
266
+
- Build OpenSSL and PCRE2 as static libraries.
267
+
- Build Nmap linking statically and using the included libpcap/libdnet to avoid dynamic deps.
268
+
- Bundle NSE scripts and data directories with the binary.
269
+
270
+
Discover target architecture (example)
271
+
```bash
272
+
uname -a
273
+
# If building from macOS/ARM/etc., pin the builder arch:
&& tar -C /out -czf /out/nmap-linux-amd64-static-bundle.tar.gz nmap-bundle \
384
+
&& echo "===== OUTPUT ====="; ls -lah /out; echo "===== FILE TYPE ====="; file /out/nmap-bundle/nmap-linux-amd64-static || true
385
+
'
386
+
```
387
+
388
+
</details>
389
+
390
+
## References
261
391
392
+
-[Compiling static Nmap binary for jobs in restricted environments](https://www.pentestpartners.com/security-blog/compiling-static-nmap-binary-for-jobs-in-restricted-environments/)
0 commit comments