Chisel Port Forwarding
Last updated
Last updated
When performing internal network enumeration, it's crucial to identify services running on various ports. In this case, we discovered a service running on port 8000 using the ss
command:
This command lists all active listening ports along with associated processes, helping us pinpoint the internal service.
To access the internal service remotely, we can set up a port forward using , a TCP/UDP tunneling tool that supports reverse port forwarding. This allows us to forward port 8000 from the target machine to our attack machine.
On our attacking machine, we start a Chisel server that listens on port 9000:
On the target machine, we run the following command to establish a reverse tunnel, forwarding port 8000 to our attacking machine:
This command connects the target machine to our Chisel server and forwards port 8000 to our local system.
Now that port 8000 is accessible from our attacking machine, we can utilize it for exploitation. For example, if the service running on port 8000 is a Java Debug Wire Protocol (JDWP) instance, we can use jdwp-shellifier.py
to execute commands remotely:
Before triggering the exploit, we set up a netcat listener on our attack machine to catch the reverse shell:
To initiate the shell connection, we trigger an event on the target machine:
Once executed, this should provide us with a remote shell, allowing further exploitation and post-exploitation activities.