Last active
February 13, 2016 16:26
Cracks rudimentary CAPTCHA. Requires tesseract.
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/sh | |
# decaptcha.sh - Cracks rudimentary CAPTCHA. Requires tesseract. | |
# --- | |
image="$1" | |
output=`mktemp` | |
charset="ABCDEFGHIJKLMNOPQRSTUVWXYZ" | |
command -v tesseract >/dev/null 2>&1 || { echo "Tesseract is not installed - (apt-get install tesseract-ocr) - Aborting." >&2; exit 1; } | |
if [ -z $image ]; then | |
echo "Usage: ./decaptcha.sh <FILE>" | |
exit 1 | |
fi | |
echo "(*) Processing $image..." | |
echo "tessedit_char_whitelist $charset" | tesseract "$image" "$output" -psm 7 /dev/stdin > /dev/null && cat "$output.txt" && rm "$output.txt" | |
rm "$output" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment