> For the complete documentation index, see [llms.txt](https://cybersecnotes.gitbook.io/welcome/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cybersecnotes.gitbook.io/welcome/general/pivoting/chisel.md).

# Chisel

{% embed url="<https://exploit-notes.hdks.org/exploit/network/port-forwarding/port-forwarding-with-chisel/>" %}

Lo primero para utilizar chisel es modificar el archivo /etc/proxychains.conf,  configurando un servidor socks5 en la localhost por el puerto 1080, para redirigir todo el tráfico TCP que vaya a ser enviado a este túnel.

![](https://3633569060-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe5JdwWVWg04LoumBdXxj%2Fuploads%2FkdjVjmWa4nYt9KXMQk4n%2Fimage.png?alt=media\&token=97d8939e-58d0-4a41-ade7-3a7e97e43748)

Esto nos va a permitir que cuando el cliente se conecte al servidor, todo el tráfico que mandemos al 127.0.0.1:1080 se esté enviando al cliente (chisel) conectado a nuestro servidor (chisel).

**Servidor**

./chisel server --reverse -p 1234

**Cliente**

./chisel client (ip-server):1234 R:socks

**Parámetros**

**--reverse:** When the chisel server has --reverse enabled, remotes can be prefixed with R to denote that they are reversed. That is, the server will listen and accept connections, and they will be proxied through the client which specified the remote. Reverse remotes specifying "R:socks" will listen on the server's default socks port (1080) and terminate the connection at the client's internal SOCKS5 proxy.

**R:**

<figure><img src="https://3633569060-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe5JdwWVWg04LoumBdXxj%2Fuploads%2F2MPtLCBSRUHvCe67qhT4%2Fimage.png?alt=media&amp;token=7e8e6d96-d37f-4f05-b598-fc45fa79ab1f" alt=""><figcaption></figcaption></figure>
