Skip to content
leg3ndProjects & tools
01Home02Projects03Tools04Notes
GMT+8
O/ OSCP exploitation reference
Workspace controls Memory only · 0 steps
Visualize path ↗
Command values 0 filled

Temporary connection values clear on reload. Passwords, hashes and tickets remain placeholders. Check address-family syntax in the selected command.

Reference index ↗ Search all procedures & variants ↗
01Discovery02Enumeration03Initial access04Usable access05Local privilege06Active Directory07Internal access08Evidence & reporting

QUICK REFERENCE

Discovery›Services›Web mapping›Web exploitation›Credentials›Public exploits›Sessions & transfers›Linux escalation›Windows escalation›AD enumeration›AD identity attacks›Lateral movement›Pivoting & tunnels›Execution troubleshooting›Integration & evidence›
174 methods · 15 topicsFull reference on GitHub ↗Commands · scripts · next steps
Tools/OSCP/Discovery/Discovery
← All discovery tasks

Validate uncertain results and rebuild the service queue

CommandsIf → thenExplanation & examples

Needs: A selected endpoint and a test that can resolve the decision-changing uncertainty

Netcat connection check

Keep source, destination, transport and port consistent when comparing results. Revisit relevant checks after a new route, foothold or identity changes access.

# Netcat connection check
nc -nv -w 3 -z TARGET PORTS

# Netcat connection check
nc -nvv -w 3 -z TARGET PORTS

Readable text only, with verbose output and port-state reasons

# Readable text only, with verbose output and port-state reasons
sudo nmap -sS -n -v --reason -p PORTS -oN scans/tcp-check.txt TARGET

Open saved .nmap or .txt output in a text editor. -oA writes .nmap, .gnmap and .xml; -oN writes only normal text. Use a different output prefix when retaining another run.

For every useful endpoint, capture one line with this structure

# For every useful endpoint, capture one line with this structure
SOURCE -> TARGET | tcp/udp PORT | OBSERVED STATE | APPLICATION EVIDENCE | COVERAGE LIMIT | NEXT TEST

Next: carry the complete endpoint tuple into Stage 02 service enumeration and choose the cheapest protocol-aware test that can change your understanding or access. Keep an explicit return item for incomplete TCP, UDP or application coverage.

Next: carry the complete endpoint tuple into Stage 02 service enumeration and choose the cheapest protocol-aware test that can change your understanding or access. Keep an explicit return item for incomplete TCP, UDP or application coverage.

  • open establishes a reachable endpoint from the scan source; it does not establish a vulnerability or usable authentication.
  • closed records an explicit rejection in that context. Move on unless later evidence changes the route, source or target state.
  • filtered leaves the listener state unresolved because filtering, loss or the path prevented classification.
  • unfiltered means the selected probe reached the port but could not determine whether it was open or closed; use a scan type that can answer the required question.
  • UDP open|filtered is inconclusive. A useful protocol probe may reduce uncertainty, but another silence can remain inconclusive.
  • closed|filtered is also an explicit ambiguity. Preserve it unless resolving the distinction changes the next action.
  • A port-based service label is a clue. Use application evidence before treating product, version, operating system or machine role as confirmed.
  • Record the exact target, transport, selected ports and source position. A successful narrow scan does not cover untested ports, the other transport or another network position.

Rank candidates by the cheapest test likely to produce access, credentials, sensitive information or a decisive prerequisite. Prefer observed application behavior over conventional port numbers. Keep at least one return item for incomplete coverage so an attractive early service does not erase the rest of the map.

Re-run network discovery after a new source host, route, tunnel or target restart. Re-enumerate a service after a new credential or identity. Inspect local listeners after a foothold. Recheck a previous result when the source, target state, port selection or network conditions changed—not simply because the first attack failed.

Verify → Record which layer was demonstrated: transport, application, authentication, read/write or execution.

If it fails → Connection success with no useful response needs a protocol-aware test; repeated identical failures without new evidence do not justify repeating the same path. More detail ↓

If → then

  • A listener has a port-based label or uncertain version → Identify applications and validate selected NSE checks

    Needs: A reachable selected port; scripts must match the application and permitted assessment behavior

  • A password tied to a plausible user and service → Validate known passwords and context-specific reuse

    Needs: Correct local/domain/application identity, reachable compatible service, accepted authentication and account state

  • Several hosts, identities, routes or competing hypotheses need coordination → Maintain state and select the next evidence-producing test

    Needs: Explicit scope/objective and a record of observations, unknowns and available capabilities

No useful finding → another task in this topic. Failed check → resolve the failure before ruling out the path.

Explanation & examples

Validate uncertain results and rebuild the service queue

USE WHEN
Scanners disagree, a result is ambiguous, or a new identity changes accessible behavior
STARTING ACCESS
An explicitly assigned address or host list and a known source position
RESULT
An evidence-labelled queue of endpoints, access contexts and next tests

Recognize the clue

Compare saved scan results with one direct connection and a service-native request for the endpoint that changes your next decision.

nc -nvz TARGET PORT
nmap -Pn -sT -p PORT --reason TARGET
SYNTHETIC EXAMPLE OUTPUT
Connection to TARGET PORT succeeded
PORT/tcp open SERVICE syn-ack

Means: Independent TCP reachability supports an endpoint candidate, not credentials, read permission or execution.

Confirm: Identify the application and validate the particular next-layer action.

After validation
The protocol answers and the intended access check succeeds: record that specific capability.
Ruled out in this context
The expected protocol is absent despite a listener: reject that protocol-specific hypothesis.
Still inconclusive
Conflicting source/time results need a controlled repeat and route comparison.

Troubleshooting: Connection success with no useful response needs a protocol-aware test; repeated identical failures without new evidence do not justify repeating the same path.

Purpose: Resolve uncertainty that affects a decision, preserve coverage limits, and turn scan output into a service-enumeration queue.

6. Resolve a result that changes your next action

Keep source, destination, transport and port consistent when comparing results. Revisit relevant checks after a new route, foothold or identity changes access.

Variants — Netcat verification, response reasons and readable output

Netcat connection check

One TCP port: replace PORTS with one number.

Short port range: replace PORTS with a range such as 3388-3390.

Success establishes TCP connection acceptance; refusal and timeout differ. The second form gives more verbose output. A three-second wait may be insufficient on a slow path.

Output and diagnostics

Readable text only, with verbose output and port-state reasons:

Open saved .nmap or .txt output in a text editor. -oA writes .nmap, .gnmap and .xml; -oN writes only normal text. Use a different output prefix when retaining another run.

7. Build the service queue

Open the saved .nmap files in a text editor. For every useful endpoint, capture one line with this structure:

Next: carry the complete endpoint tuple into Stage 02 service enumeration and choose the cheapest protocol-aware test that can change your understanding or access. Keep an explicit return item for incomplete TCP, UDP or application coverage.

Interpretation cues — preserve what the scan actually established

  • open establishes a reachable endpoint from the scan source; it does not establish a vulnerability or usable authentication.
  • closed records an explicit rejection in that context. Move on unless later evidence changes the route, source or target state.
  • filtered leaves the listener state unresolved because filtering, loss or the path prevented classification.
  • unfiltered means the selected probe reached the port but could not determine whether it was open or closed; use a scan type that can answer the required question.
  • UDP open|filtered is inconclusive. A useful protocol probe may reduce uncertainty, but another silence can remain inconclusive.
  • closed|filtered is also an explicit ambiguity. Preserve it unless resolving the distinction changes the next action.
  • A port-based service label is a clue. Use application evidence before treating product, version, operating system or machine role as confirmed.
  • Record the exact target, transport, selected ports and source position. A successful narrow scan does not cover untested ports, the other transport or another network position.
8. Prioritize and know when to rescan

Rank candidates by the cheapest test likely to produce access, credentials, sensitive information or a decisive prerequisite. Prefer observed application behavior over conventional port numbers. Keep at least one return item for incomplete coverage so an attractive early service does not erase the rest of the map.

Re-run network discovery after a new source host, route, tunnel or target restart. Re-enumerate a service after a new credential or identity. Inspect local listeners after a foothold. Recheck a previous result when the source, target state, port selection or network conditions changed—not simply because the first attack failed.

Why it works

A TCP connection proves transport reachability, not successful protocol authentication or useful rights. Re-enumeration is required when identity or route changes.

Worked example · hypothetical

Observation: one scan calls a port filtered while Netcat connects. Test: repeat the focused scan and speak the application protocol. Illustrative output: a service banner returns. Interpretation: keep the application evidence and investigate timing/source differences.

New identity, privilege, host or route? Re-enumerate → All topic tasks →

Study guide ↗Full procedure ↗Cheatsheet ↗
HomeProjectsToolsNotes
Interactive toolsOSCP notes ↗Extended OSCP workspace ↗Attack-path visualizer ↗

© 2026 Armaan. Built with curiosity.

GitHub ↗GMT+8