OSCP Reference

1.1 Discover attack surfaces

Strategy map | Master Notes | Operational index | Cheatsheets

Discovery establishes reachable behavior from a particular source. Keep host discovery, TCP coverage, UDP coverage and application identity separate; each produces different evidence.

Speedrun blocks: 1; revisit after new routes or hosts. Documented methods: 7.

Examples are hypothetical study material. Apply commands only to an assigned scope during the later practice phase. A method is enabled by its prerequisites; its presence here does not establish a vulnerability or practical mastery.

1.1.1 First pass: tools and findings

Use the branch matching the current host, identity and observed result. Tool output supplies leads; the linked procedure verifies and uses the exact condition.

1.1.1.1 Confirm the source route

Run from the machine that will send the scan. Keep the assigned scope explicit.

ip addr
ip route get TARGET
nmap -sn SUBNET -oA host-discovery

1.1.1.2 Build a TCP port list with Nmap

The command below scans all TCP ports with SYN privileges. Create the scans output directory first; use the complete connect-scan variant when unprivileged. Keep the fast initial pass distinct from full coverage.

sudo nmap -sS -n -p- -oA scans/tcp-all TARGET

1.1.1.3 Identify the responding application

Keep the endpoint and raw service output; choose the matching client from its response.

nmap -Pn -sV -p PORTS TARGET -oA selected-services
nmap --script-help SCRIPT_NAME

1.1.2 Discovery workflow

Start with an assigned address/list and your actual source interface; no open service is assumed.

Follow these observations into a method; the detailed recognition routes below show synthetic output and the checks still needed.

  1. Confirm the source interface, route and host-discovery limitations: Validate the source path and discover hosts.
  2. Separate initial TCP selection, full TCP coverage and UDP investigation: Discover TCP ports with SYN or connect scans; Probe UDP and resolve ambiguous silence.
  3. Establish application evidence on discovered listeners, including nonstandard ports: Identify applications and validate selected NSE checks; Discriminate unknown listeners and use scanner alternatives.
  4. Save the endpoint queue and revisit it after a new identity or route: Validate uncertain results and rebuild the service queue.

Decision rule: an observed clue opens a candidate. Choose it only after the missing conditions are verified; a failed check rules out that context, while unavailable evidence stays inconclusive.

1.1.3 Method families

1.1.4 Choose a method

MethodRecognition clueRequired accessEnabling conditionsResulting capability
Validate the source path and discover hostsNo response, a new subnet, or uncertainty about the interface and routeAn explicitly assigned address or host list and a known source positionCorrect VPN/interface and explicit scope; discovery probes must be compatible with the pathA source-qualified reachable-host list and a defensible discovery limitation
Enumerate reachable endpoints from a Windows sourceThe useful vantage point is a Windows host without NmapAn explicitly assigned address or host list and a known source positionA permitted Windows shell, explicit target list and built-in networking supportSelected TCP reachability from the Windows network position
Discover TCP ports with SYN or connect scansAn assigned host needs an initial service queue or full TCP coverageAn explicitly assigned address or host list and a known source positionSYN scanning needs raw-packet privileges; connect scanning needs OS TCP connections; specify selected versus full port coverageA saved TCP port-state inventory with explicit coverage
Probe UDP and resolve ambiguous silenceTCP enumeration is incomplete for the objective or DNS/SNMP/RPC clues suggest UDPAn explicitly assigned address or host list and a known source positionRaw-packet access and UDP reachability from the real source; bounded or full selection must be explicitUDP responders and documented open/filtered uncertainty
Identify applications and validate selected NSE checksA listener has a port-based label or uncertain versionAn explicitly assigned address or host list and a known source positionA reachable selected port; scripts must match the application and permitted assessment behaviorApplication and version evidence sufficient to choose service enumeration or an exploit candidate
Discriminate unknown listeners and use scanner alternativesA nonstandard listener, slow TCP discovery or a scanner-specific candidateAn explicitly assigned address or host list and a known source positionExplicit bounded scope; raw scanning alternatives need their required privileges and conservative ratesA validated listener/protocol candidate rather than an unverified scanner finding
Validate uncertain results and rebuild the service queueScanners disagree, a result is ambiguous, or a new identity changes accessible behaviorAn explicitly assigned address or host list and a known source positionA selected endpoint and a test that can resolve the decision-changing uncertaintyAn evidence-labelled queue of endpoints, access contexts and next tests

1.1.5 Validate the source path and discover hosts

Blocks: 1; revisit after new routes or hosts. Operational procedure | Quick sheet

1.1.5.1 Purpose and result

A source-qualified reachable-host list and a defensible discovery limitation.

1.1.5.2 Recognition clues

No response, a new subnet, or uncertainty about the interface and route.

1.1.5.2.1 Find the clue from your starting access

Where to investigate: From the assessment host inspect the assigned interface and the route to the exact target before interpreting silence.

Discovery action — reference example:

Access/context: An explicitly assigned address or host list and a known source position

Conditions, effects and verification

Requires: Correct VPN/interface and explicit scope; discovery probes must be compatible with the path

Action class: Network probes and local output files.

Stop/verify: Record source address/interface, route and the exact responding endpoint; a missing ping response does not prove a host is down.

Failure/next check: No route or wrong VPN interface is an environment failure. If only discovery is blocked, use the known-host TCP method; a SOCKS path requires a compatible connect-based client.

ip addr
ip route get TARGET
nmap -sn SUBNET -oA host-discovery

Illustrative evidence — synthetic, abbreviated:

The excerpt may combine command fields with labelled observations from the preceding investigation; it is not a real-target transcript or a promise of exact tool formatting.

TARGET via VPN_GATEWAY dev tun0 src SOURCE_IP
Nmap scan report for HOSTNAME (TARGET)
Host is up

Recognize this detail: The route names the intended interface/source; a responder is evidence from that source, not a global reachability claim.

Still missing before method selection: Check scope, target state and whether host-discovery probes are permitted by this path.

Outcome after checkingExample and next decision
Enabled after validationThe assigned route is correct and the selected application responds: proceed to service coverage.
Ruled out in this contextThe route points outside the assigned VPN: repair that route before evaluating the target.
InconclusiveNo discovery response but a plausible route exists: the host may filter probes; test a justified selected port.

If you do not yet have this clue: start with this topic's discovery workflow.

1.1.5.3 Prerequisites

Starting access: An explicitly assigned address or host list and a known source position. Required conditions: Correct VPN/interface and explicit scope; discovery probes must be compatible with the path.

1.1.5.4 Discover and verify prerequisites

ip addr
ip route get TARGET
nmap -sn SUBNET -oA host-discovery

1.1.5.5 Why it works

Discovery probes identify responders; silence can be caused by filtering. A known assigned host can still require a port scan that skips discovery.

1.1.5.6 Execute and choose variants

Purpose: Confirm the source path and discover explicitly assigned hosts before spending time on port coverage.

1.1.5.6.1.1 Check the path

From the target's working folder:

mkdir -p scans
ip -br addr
ip route get TARGET

Read: selected interface/source address. A route lookup does not prove reachability.

1.1.5.6.1.1.1 Variants — discover one host, a host list or a subnet
1.1.5.6.1.2 Identify reachable hosts within the assigned scope Host discovery

One host:

nmap -sn -n -oA scans/host TARGET

Assigned list: put IPs in targets.txt, one per line.

nmap -sn -n -iL targets.txt -oA scans/hosts

Explicitly assigned subnet:

nmap -sn -n -oA scans/subnet SUBNET

No response does not establish that a host is offline. A list of assigned hosts does not imply the surrounding subnet is in scope.

1.1.5.7 Worked example — hypothetical

Observation: a known host is absent from the ping sweep. Test: confirm the route and scan its selected application port with discovery skipped. Illustrative output: TCP/443 is open. Interpretation: discovery missed a live service; retain the host and enumerate HTTPS.

1.1.5.8 Verify the result

Record source address/interface, route and the exact responding endpoint; a missing ping response does not prove a host is down.

1.1.5.9 Failure and fallback

No route or wrong VPN interface is an environment failure. If only discovery is blocked, use the known-host TCP method; a SOCKS path requires a compatible connect-based client.

1.1.5.10 Continue from the interpreted result

Observed resultCheck before proceedingNext numbered section
An assigned host needs an initial service queue or full TCP coverageSYN scanning needs raw-packet privileges; connect scanning needs OS TCP connections; specify selected versus full port coverage§1.1.7 — Discover TCP ports with SYN or connect scans
TCP enumeration is incomplete for the objective or DNS/SNMP/RPC clues suggest UDPRaw-packet access and UDP reachability from the real source; bounded or full selection must be explicit§1.1.8 — Probe UDP and resolve ambiguous silence
One reachable pivot can connect to one internal TCP destinationA bindable pivot listener, source-to-listener access and pivot-to-destination connectivity§6.1.3.6 — Relay a single TCP service through a fixed forward
The useful vantage point is a Windows host without NmapA permitted Windows shell, explicit target list and built-in networking support§1.1.6 — Enumerate reachable endpoints from a Windows source

1.1.6 Enumerate reachable endpoints from a Windows source

Blocks: 1; revisit after new routes or hosts. Operational procedure | Quick sheet

1.1.6.1 Purpose and result

Selected TCP reachability from the Windows network position.

1.1.6.2 Recognition clues

The useful vantage point is a Windows host without Nmap.

1.1.6.2.1 Find the clue from your starting access

Where to investigate: From the Windows foothold inspect interfaces/routes, then check an assigned internal host's selected service ports.

Discovery action — reference example:

Access/context: An explicitly assigned address or host list and a known source position

Conditions, effects and verification

Requires: A permitted Windows shell, explicit target list and built-in networking support

Action class: Network probes and local output files.

Stop/verify: Associate each result with the actual Windows source and selected port; do not claim UDP or full-port coverage.

Failure/next check: A false result may be routing, filtering or service absence; use route and listener evidence before deciding the service is down.

Get-NetIPConfiguration
Get-NetRoute -AddressFamily IPv4
Test-NetConnection TARGET -Port 445

Illustrative evidence — synthetic, abbreviated:

The excerpt may combine command fields with labelled observations from the preceding investigation; it is not a real-target transcript or a promise of exact tool formatting.

InterfaceAlias   : ADAPTER
SourceAddress    : SOURCE_IP
RemotePort       : 445
TcpTestSucceeded : True

Recognize this detail: The service is reachable from this Windows source; this can reveal a useful vantage point unavailable from Kali.

Still missing before method selection: Confirm application/authentication and whether a forward or a native client can use that route.

Outcome after checkingExample and next decision
Enabled after validationA protocol request works from this source: choose an authorized service client or suitable tunnel.
Ruled out in this contextThe selected service is conclusively closed from this source: choose another observed endpoint.
InconclusiveTcpTestSucceeded False with uncertain routing/firewall does not prove the host is down.

If you do not yet have this clue: start with Validate the source path and discover hosts.

1.1.6.3 Prerequisites

Starting access: An explicitly assigned address or host list and a known source position. Required conditions: A permitted Windows shell, explicit target list and built-in networking support.

1.1.6.4 Discover and verify prerequisites

Get-NetIPConfiguration
Get-NetRoute -AddressFamily IPv4
Test-NetConnection TARGET -Port PORT

1.1.6.5 Why it works

A local TcpClient or Test-NetConnection uses the host's route and firewall context. Results from Kali do not substitute for reachability from this source.

1.1.6.6 Execute and choose variants

Purpose: Test TCP reachability from a Windows host when source position or available tooling matters.

Test one TCP port from the Windows source host:

Test-NetConnection -ComputerName TARGET -Port PORTS

Read: TcpTestSucceeded, source and destination addresses. Use one number for PORTS. Failure does not distinguish a closed port, filtering or a path problem.

1.1.6.6.1 Variants — scan ports 1-1024 or a selected port list
1.1.6.6.1.1 Scan a low-port range
1..1024 | % {echo ((New-Object Net.Sockets.TcpClient).Connect("DC_IP", $_)) "TCP port $_ is open"} 2>$null
1.1.6.6.1.2 Check a selected port list

The example list can be changed to the endpoints of interest.

22,80,443,445,3389 | % {echo ((New-Object Net.Sockets.TcpClient).Connect("TARGET", $_)) "TCP port $_ is open"} 2>$null

$_ is the current port; errors are hidden. No printed result does not prove every port is closed. Results reflect the Windows host's access and the stated port selection.

1.1.6.7 Worked example — hypothetical

Observation: Kali cannot reach an internal WinRM endpoint. Test: check TCP/5985 from the Windows foothold. Illustrative output: TcpTestSucceeded is True. Interpretation: a new route/source exists; choose a forward or run an authorized native client there.

1.1.6.8 Verify the result

Associate each result with the actual Windows source and selected port; do not claim UDP or full-port coverage.

1.1.6.9 Failure and fallback

A false result may be routing, filtering or service absence; use route and listener evidence before deciding the service is down.

1.1.6.10 Continue from the interpreted result

Observed resultCheck before proceedingNext numbered section
A foothold exposes an interface/subnet or a loopback-only serviceA usable pivot process/identity and explicit scope; both forward and return directions must be understood§6.1.3.5 — Discover pivot interfaces, routes and internal service context
A WinRM listener and a candidate endpoint-authorized accountReachable HTTP(S) listener, accepted authentication and endpoint/session configuration permissions; hash/ticket support depends on client/context§6.4.4.12 — Use WinRM, WinRS or PowerShell remoting
Scanners disagree, a result is ambiguous, or a new identity changes accessible behaviorA selected endpoint and a test that can resolve the decision-changing uncertainty§1.1.11 — Validate uncertain results and rebuild the service queue

1.1.7 Discover TCP ports with SYN or connect scans

Blocks: 1; revisit after new routes or hosts. Operational procedure | Quick sheet

1.1.7.1 Purpose and result

A saved TCP port-state inventory with explicit coverage.

1.1.7.2 Recognition clues

An assigned host needs an initial service queue or full TCP coverage.

1.1.7.2.1 Find the clue from your starting access

Where to investigate: After path validation, compare a first TCP pass with explicit full-port coverage; record skipped discovery or privilege limitations.

Discovery action — reference example:

Access/context: An explicitly assigned address or host list and a known source position

Conditions, effects and verification

Requires: SYN scanning needs raw-packet privileges; connect scanning needs OS TCP connections; specify selected versus full port coverage

Action class: Network probes and local output files.

Stop/verify: Retain the selected port set, source context, completion/errors and raw output; follow open ports with focused application evidence.

Failure/next check: Filtered is not closed. Through SOCKS use supported TCP-connect behavior and skip unsupported raw discovery/UDP; if results conflict, compare from the actual source.

nmap -Pn -sT --top-ports 1000 TARGET -oA tcp-initial
nmap -Pn -sT -p- TARGET -oA tcp-full

Illustrative evidence — synthetic, abbreviated:

The excerpt may combine command fields with labelled observations from the preceding investigation; it is not a real-target transcript or a promise of exact tool formatting.

Initial selection: 22/tcp open ssh; 80/tcp open http
Full selection also: 18080/tcp open unknown

Recognize this detail: The high listener exists outside the first selection; its application label remains provisional.

Still missing before method selection: Confirm scan completion, source, errors and application behavior on each interesting port.

Outcome after checkingExample and next decision
Enabled after validationA focused connection and application response confirm the listener: queue its service.
Ruled out in this contextThe earlier result cannot be reproduced after a completed focused check: retire that stale listener hypothesis.
InconclusiveFiltered ports or interrupted scans leave coverage/reachability unresolved; save the limit and choose a focused check.

If you do not yet have this clue: start with Validate the source path and discover hosts.

1.1.7.3 Prerequisites

Starting access: An explicitly assigned address or host list and a known source position. Required conditions: SYN scanning needs raw-packet privileges; connect scanning needs OS TCP connections; specify selected versus full port coverage.

1.1.7.4 Discover and verify prerequisites

nmap -Pn -sT --top-ports 1000 TARGET -oA tcp-initial
nmap -Pn -sT -p- TARGET -oA tcp-full

1.1.7.5 Why it works

SYN and connect scans infer reachability differently but both cover only their selected ports. A common-port scan is a prioritization pass, not full TCP coverage.

1.1.7.6 Execute and choose variants

Purpose: Get quick leads, complete TCP coverage, and adapt scan type, discovery handling, timing and output to the access path.

1.1.7.6.1.1 Get initial TCP results
sudo nmap -sS -n -oA scans/tcp-initial TARGET

Coverage: 1,000 common TCP ports. Review scans/tcp-initial.nmap in a text editor.

1.1.7.6.1.1.1 Variants — host list, connect scan or selected ports
1.1.7.6.1.2 Find common TCP listeners for an initial service map Initial view: 1,000 common ports

Assigned host list, SYN scan:

sudo nmap -sS -n -iL targets.txt -oA scans/tcp-initial-list

One host, connect scan without raw-packet privileges:

nmap -sT -n -oA scans/tcp-connect TARGET

Default coverage is the common-port selection, not ports 1-1000.

1.1.7.6.1.3 Selected ports or a range

One host: replace PORTS with, for example, 25,43 or 1-1024.

sudo nmap -sS -n -p PORTS -oA scans/tcp-selected TARGET

Find relevant services across assigned hosts:

sudo nmap -sS -n -p PORTS -iL targets.txt -oA scans/tcp-service-sweep

A focused service sweep is not a full port map.

1.1.7.6.1.4 Discover listeners across the full TCP port range Complete TCP coverage
sudo nmap -sS -n -p- -oA scans/tcp-all TARGET

Coverage: TCP 1-65535. Investigate useful initial results while this runs.

1.1.7.6.1.4.1 Variants — connect scan, blocked discovery, timing and progress
1.1.7.6.1.5 Discover listeners across the full TCP port range All TCP ports: 1-65535

Connect scan:

nmap -sT -n -p- -oA scans/tcp-all-connect TARGET

Inspect additional endpoints before narrowing the investigation. TCP coverage says nothing about UDP.

1.1.7.6.1.6 Discovery skips a running target

Recheck relevant ports with response reasons:

sudo nmap -sS -n -Pn --reason -p PORTS -oA scans/tcp-recheck TARGET

Proceed with full TCP coverage despite failed discovery:

sudo nmap -sS -n -Pn -p- -oA scans/tcp-all-no-discovery TARGET

-Pn assumes online status; inspect actual responses. It does not fix routing. Use -sT without sudo if ordinary TCP connections are needed.

1.1.7.6.1.7 Timing and progress

Full TCP with normal timing and periodic progress:

sudo nmap -sS -n -p- -T3 --stats-every 30s -oA scans/tcp-normal TARGET

Faster timing on a stable path:

sudo nmap -sS -n -p- -T4 --stats-every 30s -oA scans/tcp-faster TARGET

-T3 is normal timing; -T4 is more aggressive. Periodic progress changes display, not coverage. Recheck decisive results if loss or filtering makes observations uncertain.

1.1.7.6.1.8 Discover TCP services through an established SOCKS route TCP-only access through a SOCKS proxy

Use ordinary connect calls when a previously established proxy is the only route. This is a bounded first view, not complete TCP coverage:

proxychains nmap -sT -Pn -n --top-ports 100 -oA scans/tcp-proxy-top100 TARGET

proxychains cannot turn SYN probes or UDP into proxied TCP connections. -Pn avoids discovery probes that may not traverse the proxy. Confirm the proxy route first, preserve the 100-port limit, and expand with another connect scan only when scope and path permit it.

1.1.7.7 Worked example — hypothetical

Observation: the initial scan exposes SSH and HTTP. Test: finish full TCP selection. Illustrative output: an additional management service appears on a high port. Interpretation: add it to the queue before committing to a web-only path.

1.1.7.8 Verify the result

Retain the selected port set, source context, completion/errors and raw output; follow open ports with focused application evidence.

1.1.7.9 Failure and fallback

Filtered is not closed. Through SOCKS use supported TCP-connect behavior and skip unsupported raw discovery/UDP; if results conflict, compare from the actual source.

1.1.7.10 Continue from the interpreted result

Observed resultCheck before proceedingNext numbered section
A listener has a port-based label or uncertain versionA reachable selected port; scripts must match the application and permitted assessment behavior§1.1.9 — Identify applications and validate selected NSE checks
SMB/RPC endpoints, domain clues or new credentialsReachable SMB/RPC; anonymous, guest, local or domain context must be explicit; share and filesystem ACLs both matter§1.2.6 — Enumerate SMB/RPC shares, files and identities
An HTTP endpoint, redirect or hostname-dependent responseCorrect scheme/port and virtual host; saved cookies/headers for authenticated comparisons§2.1.5 — Establish scheme, host, redirects and request state

1.1.8 Probe UDP and resolve ambiguous silence

Blocks: 1; revisit after new routes or hosts. Operational procedure | Quick sheet

1.1.8.1 Purpose and result

UDP responders and documented open/filtered uncertainty.

1.1.8.2 Recognition clues

TCP enumeration is incomplete for the objective or DNS/SNMP/RPC clues suggest UDP.

1.1.8.2.1 Find the clue from your starting access

Where to investigate: Inspect discovery results and DNS/SNMP/RPC clues, then probe a separate bounded UDP selection from the same source.

Discovery action — reference example:

Access/context: An explicitly assigned address or host list and a known source position

Conditions, effects and verification

Requires: Raw-packet access and UDP reachability from the real source; bounded or full selection must be explicit

Action class: Network probes and local output files.

Stop/verify: Use an application response for a confirmed service; document unresolved silence, coverage and ICMP rate-limit effects.

Failure/next check: Do not translate UDP silence into a closed service. Retry a focused application-aware probe or a different permitted vantage point.

sudo nmap -Pn -sU --top-ports 20 --reason TARGET -oA udp-initial

Illustrative evidence — synthetic, abbreviated:

The excerpt may combine command fields with labelled observations from the preceding investigation; it is not a real-target transcript or a promise of exact tool formatting.

161/udp open|filtered snmp no-response
53/udp open domain udp-response

Recognize this detail: A DNS response confirms a UDP application; open|filtered SNMP silence is a candidate requiring a correctly formatted request.

Still missing before method selection: Check accepted service parameters, response identity and possible ICMP rate limiting.

Outcome after checkingExample and next decision
Enabled after validationA service-native request returns the expected OID/record: enumerate that application.
Ruled out in this contextAn explicit port-unreachable response rules out that UDP endpoint for this source/time.
InconclusiveSilence can mean open or filtered; use a justified application-aware probe rather than declaring either.

If you do not yet have this clue: start with Validate the source path and discover hosts.

1.1.8.3 Prerequisites

Starting access: An explicitly assigned address or host list and a known source position. Required conditions: Raw-packet access and UDP reachability from the real source; bounded or full selection must be explicit.

1.1.8.4 Discover and verify prerequisites

sudo nmap -Pn -sU --top-ports 20 --reason TARGET -oA udp-initial
sudo nmap -Pn -sU -sV -p 53,161 TARGET -oA udp-focused

1.1.8.5 Why it works

A UDP service may ignore an empty probe; ICMP errors and application responses distinguish states. Silence alone cannot distinguish open from filtered.

1.1.8.6 Execute and choose variants

Purpose: Sample UDP separately, preserve ambiguous states, and expand only when the objective or evidence warrants it.

1.1.8.6.1.1 Check UDP separately
sudo nmap -sU -n --top-ports 20 -oA scans/udp-top20 TARGET

Limit: this is a sample. open|filtered remains inconclusive; expand when evidence or the objective warrants it.

1.1.8.6.1.1.1 Variants — larger sample, selected ports, application probes and TCP + UDP
1.1.8.6.1.2 Common-port samples

Expand to 100 common ports when more coverage is warranted:

sudo nmap -sU -n --top-ports 100 -oA scans/udp-top100 TARGET

These are samples. open|filtered is inconclusive; TCP results cannot fill UDP gaps.

1.1.8.6.1.3 Selected ports

Check a relevant UDP port/list:

sudo nmap -sU -n -p PORTS -oA scans/udp-selected TARGET

Add application probes to resolve a useful candidate:

sudo nmap -sU -n -sV -p PORTS -oA scans/udp-detail TARGET

A reply can resolve ambiguity; no reply can leave it inconclusive. If discovery skips an assigned running host, add -Pn with the same limitations as TCP.

1.1.8.6.1.4 Full UDP coverage when the objective justifies the cost
sudo nmap -sU -n -p- --stats-every 60s -oA scans/udp-all TARGET

This selects UDP ports 1-65535 and may take a long time because silence requires waiting and ICMP errors may be rate-limited. It is the coverage-expansion option, not a universal first command. Continue service work in parallel and preserve the result if the scan cannot finish.

1.1.8.6.1.5 Combined TCP/UDP selection

Example selection: change the TCP (T:) and UDP (U:) lists for the actual question.

sudo nmap -sS -sU -n -p T:22,80,445,U:53,123,161 -oA scans/tcp-udp TARGET

The port lists are examples, not complete coverage. UDP waiting can extend the combined scan.

1.1.8.7 Worked example — hypothetical

Observation: UDP/161 is open|filtered. Test: a correctly formatted SNMP request with a justified community. Illustrative output: system OIDs return. Interpretation: SNMP is confirmed accessible; enumerate useful branches.

1.1.8.8 Verify the result

Use an application response for a confirmed service; document unresolved silence, coverage and ICMP rate-limit effects.

1.1.8.9 Failure and fallback

Do not translate UDP silence into a closed service. Retry a focused application-aware probe or a different permitted vantage point.

1.1.8.10 Continue from the interpreted result

Observed resultCheck before proceedingNext numbered section
UDP/161 evidence or an exposed management planeAn accepted read community or SNMPv3 identity/security level; transport and view permissions§1.2.12 — Extract configuration and process information through SNMP
A DNS server, domain name or host aliasesReachable DNS transport and relevant authoritative zone; AXFR requires an allowed TCP zone transfer§1.2.11 — Expand names through DNS records and zone transfers
RPC/NFS listeners or export informationReachable RPC/NFS transports, permitted client address and an export whose UID/GID mapping grants relevant access§1.2.7 — Inspect RPC/NFS exports and effective file identity

1.1.9 Identify applications and validate selected NSE checks

Blocks: 1; revisit after new routes or hosts. Operational procedure | Quick sheet

1.1.9.1 Purpose and result

Application and version evidence sufficient to choose service enumeration or an exploit candidate.

1.1.9.2 Recognition clues

A listener has a port-based label or uncertain version.

1.1.9.2.1 Find the clue from your starting access

Where to investigate: Take the discovered open-port list and request protocol/version evidence rather than choosing attacks from conventional port numbers.

Discovery action — reference example:

Access/context: An explicitly assigned address or host list and a known source position

Conditions, effects and verification

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

Action class: Network probes and local output files.

Stop/verify: Preserve the responding product/version evidence and distinguish an inferred fingerprint from a confirmed vulnerable build.

Failure/next check: A timeout, generic banner or scanner label leaves identity inconclusive; use native protocol clients or the unknown-port method.

nmap -Pn -sV -p PORTS TARGET -oA selected-services

Illustrative evidence — synthetic, abbreviated:

The excerpt may combine command fields with labelled observations from the preceding investigation; it is not a real-target transcript or a promise of exact tool formatting.

18080/tcp open http APPLICATION_SERVER
Service detection performed

Recognize this detail: An HTTP response on a nonstandard port routes investigation to application mapping; a product string is still only fingerprint evidence.

Still missing before method selection: Verify normal requests, hostname/TLS requirements and exact build/configuration before selecting an exploit.

Outcome after checkingExample and next decision
Enabled after validationNative protocol responses agree with the fingerprint: use that service's enumeration guide.
Ruled out in this contextA presumed SSH port instead speaks HTTP: discard the SSH-specific method for that endpoint.
InconclusiveGeneric banners or timeouts do not identify a build; try protocol-aware/TLS discrimination.

If you do not yet have this clue: start with Validate the source path and discover hosts.

1.1.9.3 Prerequisites

Starting access: An explicitly assigned address or host list and a known source position. Required conditions: A reachable selected port; scripts must match the application and permitted assessment behavior.

1.1.9.4 Discover and verify prerequisites

nmap -Pn -sV -p PORTS TARGET -oA selected-services
nmap --script-help SCRIPT_NAME

1.1.9.5 Why it works

Port numbers and banners suggest a protocol; application responses and exact configuration constrain an exploit. NSE results remain candidates when the check cannot prove the vulnerable condition.

1.1.9.6 Execute and choose variants

Purpose: Identify applications on discovered ports and choose only the probing needed for the next decision.

1.1.9.6.1.1 Identify discovered applications
nmap -sT -n -sV -p PORTS -oA scans/tcp-services TARGET

Next: choose service-specific enumeration from application evidence. A version match alone does not establish exploitability.

1.1.9.6.1.1.1 Variants — default scripts, named scripts and OS fingerprints
1.1.9.6.1.2 Identify applications on discovered ports

Version probing plus the default NSE script set: use when those scripts answer relevant enumeration questions.

nmap -sT -n -sV -sC -p PORTS -oA scans/tcp-services-default TARGET

Read the application evidence and script results. Default scripts add interactions; they do not complete service enumeration or prove exploitability.

Lighter version probing when time or fragile service behavior matters:

nmap -sT -n -sV --version-light -p PORTS -oA scans/tcp-services-light TARGET

Light mode tries fewer uncommon probes and can miss an identity that the default intensity finds. Use the default first unless a concrete constraint justifies the tradeoff.

1.1.9.6.1.3 Select a named script

Inspect behavior locally:

nmap --script-help http-headers

After identifying HTTP, inspect its relevant port(s):

nmap -sT -n -p PORTS --script http-headers -oA scans/http-headers TARGET

Returned headers are clues. Choose scripts for the question they answer and their behavior.

1.1.9.6.1.4 OS fingerprinting and bundled probing

Estimate OS from network-stack behavior:

sudo nmap -n -O -oA scans/os TARGET

Request more tentative OS guesses:

sudo nmap -n -O --osscan-guess -oA scans/os-guesses TARGET

Bundle OS/version detection, default scripts and traceroute:

sudo nmap -sS -n -A -oA scans/combined-detail TARGET

OS guesses are hypotheses. These use default TCP coverage; -A does not mean all ports. Choose this bundle only when its additional probing is useful.

1.1.9.7 Worked example — hypothetical

Observation: port 8443 is labelled HTTPS but the product is unknown. Test: version probes and a normal HTTP request. Illustrative output: a named management product and login route. Interpretation: map authentication and verify the build before exploit selection.

1.1.9.8 Verify the result

Preserve the responding product/version evidence and distinguish an inferred fingerprint from a confirmed vulnerable build.

1.1.9.9 Failure and fallback

A timeout, generic banner or scanner label leaves identity inconclusive; use native protocol clients or the unknown-port method.

1.1.9.10 Continue from the interpreted result

Observed resultCheck before proceedingNext numbered section
A nonstandard listener, slow TCP discovery or a scanner-specific candidateExplicit bounded scope; raw scanning alternatives need their required privileges and conservative rates§1.1.10 — Discriminate unknown listeners and use scanner alternatives
An HTTP endpoint, redirect or hostname-dependent responseCorrect scheme/port and virtual host; saved cookies/headers for authenticated comparisons§2.1.5 — Establish scheme, host, redirects and request state
A product/version clue, advisory or component-specific public PoCExact vulnerable build/configuration, required access and endpoint behavior; reviewable source and a verifiable expected effect§4.1.5 — Match a public exploit to the actual component and configuration
An rsync daemon banner, TCP/873 listener or disclosed rsync moduleReachable rsync daemon and a module/path readable by the anonymous or supplied account§1.2.8 — Inspect rsync modules and retrieve selected artifacts
A UDP/69 service plus a plausible filename from configuration, source or boot metadataReachable TFTP service and an exact server-relative filename permitted for read or write§1.2.9 — Retrieve an evidence-backed file over TFTP
An FTP banner or accessible listingAnonymous login allowed or a valid FTP identity; data-channel connectivity and object-specific read/write rights§1.2.5 — Use anonymous or authenticated FTP file access
An SSH service and a known password, private key or agent contextCompatible authentication method, correct user, accepted key policy and the requested shell/subsystem permission§1.2.10 — Use SSH passwords, keys and forwarding-capable access
SMTP capabilities or mail-related account cluesReachable SMTP/POP3/IMAP service; enumeration or mailbox access must be enabled for the selected context§1.2.13 — Enumerate SMTP identities and accessible mailbox protocols
A DNS server, domain name or host aliasesReachable DNS transport and relevant authoritative zone; AXFR requires an allowed TCP zone transfer§1.2.11 — Expand names through DNS records and zone transfers
RPC/NFS listeners or export informationReachable RPC/NFS transports, permitted client address and an export whose UID/GID mapping grants relevant access§1.2.7 — Inspect RPC/NFS exports and effective file identity
SMB/RPC endpoints, domain clues or new credentialsReachable SMB/RPC; anonymous, guest, local or domain context must be explicit; share and filesystem ACLs both matter§1.2.6 — Enumerate SMB/RPC shares, files and identities
UDP/161 evidence or an exposed management planeAn accepted read community or SNMPv3 identity/security level; transport and view permissions§1.2.12 — Extract configuration and process information through SNMP
A MySQL-compatible service and valid application/database credentialsDatabase authentication and exact schema/file privileges; secure_file_priv and server filesystem identity constrain file actions§1.2.15 — Use MySQL/MariaDB data and file primitives
SQL Server credentials or a Windows identity accepted by the databaseCorrect SQL versus Windows authentication; database role and configuration must permit the requested operation§1.2.16 — Use SQL Server rights, impersonation and command facilities
PostgreSQL access or an application connection stringAccepted connection/database role; COPY PROGRAM needs the corresponding server privilege and an executable OS context§1.2.17 — Use PostgreSQL data and privileged program execution
A Redis listener or application cache credentialsReachability and accepted authentication/ACL commands; persistence writes need CONFIG rights, destination permissions and a consumer§1.2.18 — Inspect Redis access and persistence boundaries
An Oracle TNS listener or connection descriptorCorrect service/SID, reachable database transport and valid database credentials for authenticated work§1.2.19 — Triage Oracle listener and database identity
An exposed remote-access application and compatible known credentialsEnabled destination service, matching authentication and protocol-specific logon/session rights§1.2.20 — Validate RDP, WinRM, VNC and Telnet access contexts
LDAP/Kerberos listeners or a probable AD domainReachable directory; anonymous query permission or valid bind identity; required signing/TLS and naming context§1.2.14 — Discover LDAP naming contexts and authenticated search
A confirmed SIP or IRC applicationApplication-specific request format; permitted registration/channel/configuration access§1.2.21 — Investigate SIP/IRC identity and configuration clues

1.1.10 Discriminate unknown listeners and use scanner alternatives

Blocks: 1; revisit after new routes or hosts. Operational procedure | Quick sheet

1.1.10.1 Purpose and result

A validated listener/protocol candidate rather than an unverified scanner finding.

1.1.10.2 Recognition clues

A nonstandard listener, slow TCP discovery or a scanner-specific candidate.

1.1.10.2.1 Find the clue from your starting access

Where to investigate: Select an unexplained listener from the saved queue, compare native connection behavior, then use focused version/TLS probes.

Discovery action — reference example:

Access/context: An explicitly assigned address or host list and a known source position

Conditions, effects and verification

Requires: Explicit bounded scope; raw scanning alternatives need their required privileges and conservative rates

Action class: Network probes and local output files.

Stop/verify: Confirm the endpoint through independent application behavior and preserve the rate/scope used for discovery.

Failure/next check: No response may require TLS or a protocol-first request. Avoid treating speed-oriented results as complete, and keep prohibited mass vulnerability scanners outside the exam path.

nmap -Pn -sV --version-all -p PORT TARGET
nc -nv TARGET PORT

Illustrative evidence — synthetic, abbreviated:

The excerpt may combine command fields with labelled observations from the preceding investigation; it is not a real-target transcript or a promise of exact tool formatting.

PORT/tcp open ssl/http APPLICATION
HTTP/1.1 302 Found
Location: https://HOSTNAME/

Recognize this detail: TLS and an HTTP redirect suggest a hostname-selected web application rather than an attack tied to the port number.

Still missing before method selection: Reproduce the hostname/TLS request and confirm exact software/configuration.

Outcome after checkingExample and next decision
Enabled after validationA correctly addressed request produces the application: move to its normal behavior map.
Ruled out in this contextThe banner disproves the originally assumed protocol: remove that service hypothesis.
InconclusiveNo banner may mean a client-first protocol, TLS or filtering; use a discriminating normal request.

If you do not yet have this clue: start with Validate the source path and discover hosts.

1.1.10.3 Prerequisites

Starting access: An explicitly assigned address or host list and a known source position. Required conditions: Explicit bounded scope; raw scanning alternatives need their required privileges and conservative rates.

1.1.10.4 Discover and verify prerequisites

nmap -Pn -sV --version-all -p PORT TARGET
nc -nv TARGET PORT

1.1.10.5 Why it works

Fast discovery tools trade probing depth for speed. Recheck discovered ports with Nmap and a native client; a vulnerability-script label is not a complete exploit proof.

1.1.10.6 Execute and choose variants

Use when: Nmap remains the interpretation baseline, but a faster TCP discovery pass or a bounded web-server check is useful. These tools generate candidates; Nmap/manual protocol checks confirm them.

1.1.10.6.1.1 RustScan: fast TCP discovery, Nmap interpretation

Prerequisite: RustScan and Nmap on Kali; direct TCP reachability. Coverage: only the explicit TCP range. Decisive output: a discovered port that Nmap can reproduce and identify.

rustscan -a TARGET -r 1-65535 --ulimit 5000 -- \
  -Pn -sV -sC -oA rustscan-followup

If the target or network becomes unstable, lower concurrency rather than trusting an empty result. RustScan does not replace UDP work and does not prove that closed/filtered ports were tested with the same semantics as Nmap.

1.1.10.6.1.1.1 Bounded first 1,000 TCP ports
rustscan -a TARGET -r 1-1000 --ulimit 5000 -- \
  -Pn -sV -sC -oA rustscan-1000

Use only for a quick selection. It is not full TCP coverage and is not equivalent to Nmap's default top-1,000 selection.

1.1.10.6.1.2 Masscan: raw-packet discovery, then validation

Prerequisite: root/raw-packet access and a directly routed target. Choose it: for a large authorized address/port space where discovery speed matters. Failure cue: high loss or inconsistent results at the chosen rate.

sudo masscan TARGET -p1-65535 --rate 500 -oL masscan-open.txt

Treat each hit as a candidate and recheck with Nmap:

PORTS=$(awk '$1 == "open" && $2 == "tcp" {print $3}' masscan-open.txt \
  | sort -nu | paste -sd,)
test -n "$PORTS" && sudo nmap -Pn -sV -sC -p "$PORTS" TARGET -oA masscan-verified

Masscan's raw-packet model is not suitable through a TCP SOCKS proxy. A rate that overwhelms the path can create false negatives and disrupt the lab; record the rate with the result.

1.1.10.6.1.3 Unknown-port discrimination

Start passively or with protocol-appropriate probes. Do not spray arbitrary strings at a stateful or destructive service.

nmap -Pn -sV --version-all -p PORT TARGET -oN port-PORT-version.txt
nmap --script-help banner
nmap -Pn --script=banner -p PORT TARGET -oN port-PORT-banner.txt
nc -nv TARGET PORT
openssl s_client -connect TARGET:PORT -servername HOSTNAME
curl -vk --max-time 10 https://TARGET:PORT/

Next action: route application evidence to the matching Stage 02 page. If TLS succeeds but HTTP does not, preserve the certificate names and protocol evidence instead of labelling it HTTPS.

1.1.10.6.1.4 NSE candidate checks

Inspect a script before selecting it:

nmap --script-help SCRIPT_NAME
grep -i 'SCRIPT_NAME' /usr/share/nmap/scripts/script.db

Run a named script against a confirmed service/port:

nmap -Pn -sV --script SCRIPT_NAME -p PORT TARGET -oN nse-SCRIPT_NAME.txt

The broad vuln category is candidate generation and can be intrusive or misleading. If its use is justified in the authorized lab, restrict it to identified ports and manually validate every result:

nmap -Pn -sV --script vuln -p PORTS TARGET -oN nse-vuln-candidates.txt

Avoid *brute* categories as a default; first establish exact service, known test identities, lockout/rate limits and explicit authorization.

1.1.10.6.1.5 Nikto: bounded web-server candidate generation

Prerequisite: an identified HTTP(S) endpoint. Choose it: after manual baselining to identify common files, headers and server misconfiguration candidates. Decisive output: a finding manually reproduced with the same host, path and authentication context.

nikto -h http://TARGET:PORT -output nikto-TARGET-PORT.txt
1.1.10.6.1.5.1 HTTPS, host name and tuning variants
nikto -h https://HOSTNAME:PORT -output nikto-HOSTNAME-PORT.txt
nikto -h http://TARGET:PORT -vhost HOSTNAME -output nikto-vhost.txt
nikto -h http://TARGET:PORT -Tuning 123b -output nikto-focused.txt

Tuning codes are version-sensitive. Inspect nikto -H / local documentation before relying on a copied code set.

Nikto is explicitly listed as allowed by the current OffSec exam guide, but its findings remain scanner candidates. Recheck the guide before an exam and manually validate anything that affects an attack decision.

1.1.10.7 Worked example — hypothetical

Observation: fast discovery reports an unexpected high port. Test: a focused version probe and protocol request. Illustrative output: an HTTP response appears. Interpretation: treat it as a web application regardless of its port.

1.1.10.8 Verify the result

Confirm the endpoint through independent application behavior and preserve the rate/scope used for discovery.

1.1.10.9 Failure and fallback

No response may require TLS or a protocol-first request. Avoid treating speed-oriented results as complete, and keep prohibited mass vulnerability scanners outside the exam path.

1.1.10.10 Continue from the interpreted result

Observed resultCheck before proceedingNext numbered section
A listener has a port-based label or uncertain versionA reachable selected port; scripts must match the application and permitted assessment behavior§1.1.9 — Identify applications and validate selected NSE checks
An HTTP endpoint, redirect or hostname-dependent responseCorrect scheme/port and virtual host; saved cookies/headers for authenticated comparisons§2.1.5 — Establish scheme, host, redirects and request state
A product/version clue, advisory or component-specific public PoCExact vulnerable build/configuration, required access and endpoint behavior; reviewable source and a verifiable expected effect§4.1.5 — Match a public exploit to the actual component and configuration

1.1.11 Validate uncertain results and rebuild the service queue

Blocks: 1; revisit after new routes or hosts. Operational procedure | Quick sheet

1.1.11.1 Purpose and result

An evidence-labelled queue of endpoints, access contexts and next tests.

1.1.11.2 Recognition clues

Scanners disagree, a result is ambiguous, or a new identity changes accessible behavior.

1.1.11.2.1 Find the clue from your starting access

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

Discovery action — reference example:

Access/context: An explicitly assigned address or host list and a known source position

Conditions, effects and verification

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

Action class: Network probes and local output files.

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

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

nc -nvz TARGET PORT
nmap -Pn -sT -p PORT --reason TARGET

Illustrative evidence — synthetic, abbreviated:

The excerpt may combine command fields with labelled observations from the preceding investigation; it is not a real-target transcript or a promise of exact tool formatting.

Connection to TARGET PORT succeeded
PORT/tcp open SERVICE syn-ack

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

Still missing before method selection: Identify the application and validate the particular next-layer action.

Outcome after checkingExample and next decision
Enabled after validationThe protocol answers and the intended access check succeeds: record that specific capability.
Ruled out in this contextThe expected protocol is absent despite a listener: reject that protocol-specific hypothesis.
InconclusiveConflicting source/time results need a controlled repeat and route comparison.

If you do not yet have this clue: start with Validate the source path and discover hosts.

1.1.11.3 Prerequisites

Starting access: An explicitly assigned address or host list and a known source position. Required conditions: A selected endpoint and a test that can resolve the decision-changing uncertainty.

1.1.11.4 Discover and verify prerequisites

nc -nvz TARGET PORT
nmap -Pn -sT -p PORT --reason TARGET

1.1.11.5 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.

1.1.11.6 Execute and choose variants

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

1.1.11.6.1.1 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.

1.1.11.6.1.1.1 Variants — Netcat verification, response reasons and readable output
1.1.11.6.1.2 Netcat connection check

One TCP port: replace PORTS with one number.

nc -nv -w 3 -z TARGET PORTS

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

nc -nvv -w 3 -z TARGET PORTS

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.

1.1.11.6.1.3 Output and diagnostics

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.

1.1.11.6.1.4 Build the service queue

Open the saved .nmap files in a text editor. 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.

1.1.11.6.1.4.1 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.
1.1.11.6.1.5 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.

1.1.11.7 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.

1.1.11.8 Verify the result

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

1.1.11.9 Failure and fallback

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

1.1.11.10 Continue from the interpreted result

Observed resultCheck before proceedingNext numbered section
A listener has a port-based label or uncertain versionA reachable selected port; scripts must match the application and permitted assessment behavior§1.1.9 — Identify applications and validate selected NSE checks
A password tied to a plausible user and serviceCorrect local/domain/application identity, reachable compatible service, accepted authentication and account state§3.1.6 — Validate known passwords and context-specific reuse
Several hosts, identities, routes or competing hypotheses need coordinationExplicit scope/objective and a record of observations, unknowns and available capabilities§8.1.5 — Maintain state and select the next evidence-producing test

1.1.12 Sources and shared concepts

Supplied PEN-200 Ch 6 pp136–165. Nmap scan techniques, port selection, NSE.

Commands and their adjacent variant conditions are synchronized extracts of the linked operational procedures. Those procedures own complete execution details; this guide owns method selection, explanations and worked reasoning. Tool availability on the learner's Kali or a target must be checked in that environment.


Top of document · Reference home