Created
May 18, 2017 02:17
-
-
Save m0rb/b04450788b439df9fe55855fe116be29 to your computer and use it in GitHub Desktop.
uiwix payment gateway crawler
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
#!/bin/bash | |
# deps: tesseract, torify, curl | |
# use seq and GNU parallel to speed up crawling | |
# ex - $ seq 1000000000 2000000000 | parallel --jobs +20 ./uiwixcrawl.sh {} | |
# 5/17/17 - chris_commat_misentropic_commercial | |
URL="http://4ujngbdqqm6t2c53.onion" | |
grab() { | |
torify curl -s $@ -H 'Host: 4ujngbdqqm6t2c53.onion' -H \ | |
'User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:45.0) Gecko/20100101 Firefox/45.0'\ | |
-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*8' -H \ | |
'Accept-Language: en-US,en;q=0.5' --compressed -H \ | |
'Referer: http://4ujngbdqqm6t2c53.onion/index.php' -H 'Connection: keep-alive' | |
} | |
code() { | |
sed 's#.*c=\"##;s#\".*##' | grep code | |
} | |
sid() { | |
awk '/hidden/' | sed 's#.*ue=\"##;s#\".*##' | |
} | |
phpsess() { | |
awk '/PHPSESSID/{print $2}' | sed 's#;##' | |
} | |
btcaddr() { | |
awk '/Bitc.*es/' | sed 's#.*\">##g;s#<.*##' | |
} | |
try() { | |
A=$1 | |
TEMPFILE=$(mktemp) | |
PAGE="$(grab -i $URL)" | |
PHPSESSID=$(echo "$PAGE" | phpsess) | |
CODE="${URL}/$(echo $PAGE | code)" | |
SID=$(echo "$PAGE" | sid) | |
CAPTCHA=$(grab -o $TEMPFILE $CODE && tesseract $TEMPFILE -) | |
rm $TEMPFILE & | |
DATA="usr=${A}&sid=${SID}&code=${CAPTCHA}&login=Enter" | |
CHECK=$(grab "${URL}/index.php" -b "$PHPSESSID" --data "${DATA}" ) | |
if ! echo "$CHECK" | grep -q "ID not found" ; then | |
ANSWER=`grab "${URL}/panel.php?id=main" -b "$PHPSESSID" --data "${DATA}"` | |
[ -z "$ANSWER" ] || ( echo ${A} && echo "$ANSWER" | btcaddr > ${A}.txt ); | |
fi | |
} | |
try $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment