CTF Arsenal
Boot2Root / Command Mistakes & Recovery

nmap/nc: Connection refused

1. Error or symptom

A scan or connection attempt immediately returns 'Connection refused'.

2. Likely cause

Nothing is listening on that port, or the service crashed/isn't started yet.

3. How to verify

nmap -p PORT TARGET_IP to confirm current port state; retry after a short wait if the box just booted.

4. Correct command

nmap -p- --min-rate=1000 TARGET_IP   # re-verify the full port list

5. Recovery procedure

Re-scan to find the actual open port(s); don't keep retrying a port that's confirmed closed.

6. How to avoid repeating it

Always confirm port state with a fresh scan before assuming your client/payload is misconfigured.