Skip to content

Instantly share code, notes, and snippets.

@threedaymonk
Created July 16, 2012 18:43
Show Gist options
  • Save threedaymonk/3124250 to your computer and use it in GitHub Desktop.
Save threedaymonk/3124250 to your computer and use it in GitHub Desktop.
Breaking the http://www.olympicgamesmonitoring.com/ CAPTCHA in one line of shell script
#!/bin/sh
convert -threshold 30% $1 pnm:- | gocr - | tr 'OI' '01' | tr 'A-Z' 'a-z'
2n2ft6 => 2n2ft6 ok
5fmky2 => 5fmky1 FAIL
6q7jp9 => 6q7jp9 ok
7jgkyf => 7jgkyf ok
ckc6vx => ckc6vx ok
dhxry4 => dhxry4 ok
fpyy4y => fpyy4y ok
g6fn8s => g6fn8s ok
htczms => htc_ms FAIL
mkg7pb => mkg7pb ok
mmp7dy => mmp7dy ok
nqcy2v => nqcy2v ok
ntx9hb => ntx9hb ok
q6fnkc => q6fnkc ok
q8d9cb => q8d9cb ok
qcg2g6 => 9cg2g6 FAIL
rrqmt2 => rrqmt2 ok
ymxrnc => ymxrnc ok
zf8x5g => zf8x5g ok
zmbc5s => zmbc5s ok
#!/bin/sh
for f in training/*; do
expected=$(echo $f | cut -d. -f1 | cut -d/ -f2)
actual=$(./decode.sh $f)
if [ "$actual" = "$expected" ]; then
status="ok"
else
status="FAIL"
fi
echo "$expected => $actual $status"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment