## TL;DR
OS detection needs at least one open and one closed port to fingerprint reliably. If your scan only found open ports, or filtered everything, nmap warns you the guess is weak. Re-run with a full port range and a raw-socket scan type so closed ports show up, and the warning goes away.

```text
WARNING: OS detection will be MUCH less reliable because we did not find at least 1 open and 1 closed TCP port
```

## Use this when
- The warning appears on an in-scope host you need to fingerprint.
- Your previous run used a limited port list or a connect scan.
- The host answered at all (it is up).

## Not for this skill when
- You do not need OS data. Drop -O and the warning is irrelevant.
- The host is down or firewalled on every port. Fingerprinting is impossible there.

## Steps
1. Re-scan with the full range so closed ports appear: `nmap -O -p- 192.0.2.5`. Verify: the scan reports both open and closed ports in its summary.
2. Use a raw-socket scan type as root: `sudo nmap -sS -O -p- 192.0.2.5`. Connect scans (-sT) give nmap less fingerprinting detail. Verify: the warning no longer appears.
3. If the host is chatty, slow the timing a notch: `sudo nmap -sS -O -T3 -p- 192.0.2.5`. Verify: results stay consistent across two runs.
4. Check the OS guess confidence in the output. "Aggressive OS guesses" with low accuracy still need corroboration. Verify: the reported accuracy line reads high, or you note it as tentative.
5. Corroborate with service banners from -sV before writing the OS into your report. Verify: banner data agrees with the fingerprint.

Compatibility: nmap 7.x. OS fingerprinting needs raw sockets, so root or capabilities on Linux.

## Variant phrasings
### nmap os detection less reliable warning
Same fix path, common phrasing.
### nmap -O unreliable no closed ports
The cause stated plainly.
### improve nmap OS detection accuracy
The goal-oriented search.

## Why it happens
nmap's OS fingerprint compares the target's TCP/IP stack responses against a database. The comparison needs contrast: how the stack answers on an open port versus a closed one. Scans that see only open ports (narrow port lists) or only filtered ones (firewalls) starve the matcher, so it warns that the guess is weak.

## Edge cases / pitfalls
- Load balancers and NAT devices answer with their own stack, not the backend's. Fingerprint those hosts separately.
- Some hardened hosts send identical responses everywhere by design. No scan flags fix that; record the OS as unknown.
- -p- on a /24 is slow. Fingerprint a sample of hosts, then apply the finding to identical ones.
- Only fingerprint hosts in your written scope. OS probing is active testing.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_alyKiT5sheqgpFo-w0Z2NQ
