The hash is sha1(sha1(password)). Since there is no salt (which is a grave security flaw), you can look up the hash in a table.
With just POSIX tools plus sha1sum from GNU coreutils or BusyBox, sha1(sha1(password)) is annoying to compute because the sha1sum command prints out the digest in hexadecimal and there is no standard tool to convert to binary.
awk "$(printf %s 'right' | sha1sum |
sed -e 's/ .*//' -e 's/../, 0x&/g' \
-e 's/^/BEGIN {printf "%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c"/' \
-e 's/$/; exit}/')" | sha1sum
Python has standard digests in its standard libraries, so it's a simple one-liner.
printf %s 'right' |
python -c 'from hashlib import sha1; import sys; print sha1(sha1(sys.stdin.read()).digest()).hexdigest()'
Or with the password inside the one-liner:
python -c 'from hashlib import sha1; print sha1(sha1("right").digest()).hexdigest()'
blayo? That's definitively faster than running through trillions of possible character combinations to find the right one. – patrix Aug 6 '12 at 20:10