> For the complete documentation index, see [llms.txt](https://g4b0.gitbook.io/g4b0-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://g4b0.gitbook.io/g4b0-docs/documentation/cheatsheets/tunneling-and-portforwarding/ssh-for-windows-plink.exe.md).

# SSH for Windows: plink.exe

* **Plink** (PuTTY Link) es la herramienta CLI de SSH incluida en el paquete PuTTY para Windows. Puede crear dynamic port forwards y SOCKS proxies igual que el cliente SSH nativo de Linux.
* Antes del otoño de 2018, Windows no incluía un cliente SSH nativo, por lo que PuTTY era la elección estándar de los sysadmins para conectarse a otros hosts.
* **Escenario de uso:** durante un pentest se obtiene acceso a una máquina Windows moderadamente endurecida que se necesita usar como pivot point. Subir herramientas propias puede delatarnos. Si el host es antiguo y PuTTY ya está instalado (o se encuentra en algún file share), Plink permite crear el pivot *living off the land* para evadir detección más tiempo.
* También aplica cuando se usa un sistema Windows como primary attack host en lugar de uno basado en Linux.

**Topología de red:**

```
Windows Attack Host (10.10.15.5)
  └─ Plink SSH Client → SSH tunnel → Ubuntu Server (10.129.15.50)
       └─ SOCKS Listener :9050 → Victim Windows A (172.16.5.19) :RDP
```

***

#### Dynamic Port Forward con Plink

```cmd
plink -ssh -D 9050 ubuntu@10.129.15.50
```

* `-ssh` — fuerza el protocolo SSH (equivalente a `ssh -D` en Linux).
* `-D 9050` — abre un dynamic port forward local en el puerto 9050, actuando como SOCKS proxy.

**Output esperado:** se establece una sesión SSH con el servidor Ubuntu y Plink queda escuchando en `127.0.0.1:9050` como SOCKS proxy.

***

#### Configurar Proxifier para usar el tunnel

**Proxifier** es una herramienta Windows que enruta el tráfico de aplicaciones de escritorio a través de un proxy SOCKS o HTTPS y permite proxy chaining.

Pasos:

1. Crear un perfil en Proxifier con: `Address: 127.0.0.1`, `Port: 9050`, `Type: SOCKS4`.
2. Una vez activo el tunnel de Plink, lanzar `mstsc.exe` para iniciar una sesión RDP contra la víctima Windows (ej. `172.16.5.19`). Proxifier redirigirá el tráfico automáticamente por el SOCKS proxy.

***

> **Nota:** Esta técnica puede practicarse desde un Windows attack host personal. Al desplegar el target del laboratorio, esperar **3-5 minutos** hasta que toda la configuración esté lista para que la conexión funcione correctamente.


---

# 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://g4b0.gitbook.io/g4b0-docs/documentation/cheatsheets/tunneling-and-portforwarding/ssh-for-windows-plink.exe.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.
