Skip to content

Instantly share code, notes, and snippets.

@yrps
Created July 21, 2015 04:21
Show Gist options
  • Select an option

  • Save yrps/366cf87e23f2f55cbf0c to your computer and use it in GitHub Desktop.

Select an option

Save yrps/366cf87e23f2f55cbf0c to your computer and use it in GitHub Desktop.
"Manual brute force password attack for you to perform- I chose a password and hashed it using md5"
#!/bin/bash
target=0d149b90e7394297301c90191ae775f0
read -r -d '' words <<WORDS
ad ah am an as at aw ax ay
be by do go ha he hi if in is
it me my no of oh on or ow
ox pi so to uh um up us we
WORDS
let nwords=0
for w in $words; do
let nwords++
hash=$(echo -n "$w" | md5sum | cut -d' ' -f1)
win=
if [ "$hash" == "$target" ]; then
win="< here it is"
fi
printf "%s %s %s\n" "$w" "$hash" "$win"
done
keyspace=$(( 95 ** 2 ))
cat<<COMMENT
Restricted to English words, the keyspace of $keyspace has been reduced
to $nwords, a factor of about $(( keyspace / nwords )).
COMMENT
@yrps

yrps commented Jul 21, 2015

Copy link
Copy Markdown
Author

ad 523af537946b79c4f8369ed39ba78605
ah 3cf4046014cbdfaa7ea8e6904ab04608
am c04cd38aeb30f3ad1f8ab4e64a0ded7b
an 18b049cc8d8535787929df716f9f4e68
as f970e2767d0cfe75876ea857f92e319b
at 7d0db380a5b95a8ba1da0bca241abda1
aw b787d22d9cb06342658bf546039117bc
ax 9cea1e2473aaf49955fa34faac95b3e7
ay 42d74a038852aaee074a9245c49e9c8d
be 910955a907e739b81ec8855763108a29
by df3f079de6961496f0460dcfdbf9bca3
do d4579b2688d675235f402f6b4b43bcbf
go 34d1f91fb2e514b8576fab1a75a89a6b
ha 925cc8d2953eba624b2bfedf91a91613
he 6f96cfdfe5ccc627cadf24b41725caa4
hi 49f68a5c8493ec2c0bf489821c21fc3b
if 39c8942e1038872a822c0dc75eedbde3
in 13b5bfe96f3e2fe411c9f66f4a582adf
is a2a551a6458a8de22446cc76d639a9e9
it 0d149b90e7394297301c90191ae775f0 < here it is
me ab86a1e1ef70dff97959067b723c5c24
my 6864f389d9876436bc8778ff071d1b6c
no 7fa3b767c460b54a2be4d49030b349c7
of 8bf8854bebe108183caeb845c7676ae4
oh c7218260ef2b966ab0454e07c55cf4e9
on ed2b5c0139cec8ad2873829dc1117d50
or e81c4e4f2b7b93b481e13a8553c2ae1b
ow 617a4046ef07a0d9851942247a994cf9
ox 5360b37c5130191f972e0e5c0805f52d
pi 72ab8af56bddab33b269c5964b26620a
so b807023f87e63b8ada92f79f546ff9cc
to 01b6e20344b68835c5ed1ddedf20d531
uh b20b42abce21dcd370986f1b3c2dfa5b
um 0dd00e33b6fc67b811ebe3177217d6c0
up 46c48bec0d282018b9d167eef7711b2c
us 0b3b97fa66886c5688ee4ae80ec0c3c2
we ff1ccf57e98c817df1efcd9fe44a8aeb

Restricted to English words, the keyspace of 9025 has been reduced
to 37, a factor of about 243.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment