-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
61 lines (42 loc) · 1.97 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
cleans := $(patsubst rules/%,clean/%,$(wildcard rules/*))
pass = ~/tools/john/run/password.lst
dico = /usr/share/dict/american-english
john = ~/tools/john/run/john
limitfile = limit
threads = 6
minmatch = 4
# parameters used for tuning your rule usages
# the first one is used to set which format should be used
format = descrypt
# the second one to decide the number of salts to be cracked
nbsalts = 50
.SECONDARY:
.PHONY: all clean
result: $(cleans) ra $(limitfile) processWordlist processtime
./ra `cat $(limitfile)` $(threads) `cat processWordlist` `cat processtime` $(cleans) > result
processWordlist: $(dico) $(john)
/usr/bin/time --format="%e" $(john) -sess:benchProcessWordlist -w:$(dico) -stdout 2> /tmp/processWordlist > /dev/null && egrep '^[0-9.]+$$' /tmp/processWordlist > processWordlist
processtime: $(john) computeprocesstime.pl
$(john) -test:10 -format:$(format) | perl computeprocesstime.pl $(nbsalts) > processtime
removeknown: removeknown.c cityhash.c
gcc -Werror -Wall -g2 -O2 -o removeknown removeknown.c
cleanpass: $(pass) $(dico) removeknown
./removeknown $(dico) < $(pass) > cleanpass
badrules: $(cleans) list_useless_rules $(limitfile)
./list_useless_rules `cat $(limitfile)` clean | tee badrules
clean:
rm -f output/* conf/* clean/* result ra rf slimmer cleanpass removeknown processWordlist processtime
ra: ra.c
gcc -Werror -Wall -g2 -O2 -o ra ra.c -lavl -pthread
list_useless_rules: list_useless_rules.c
gcc -Werror -Wall -g2 -O2 -o list_useless_rules list_useless_rules.c -lavl -lpthread
rf: rf.c cityhash.c
gcc -Werror -Wall -g2 -O2 -o rf rf.c -lavl
slimmer: slimmer.c
gcc -Werror -Wall -g2 -O2 -o slimmer slimmer.c -lavl
clean/%.rule: output/%.out slimmer $(limitfile)
zcat $< | ./slimmer `cat $(limitfile)` - $@
output/%.out: conf/%.conf rf $(dico) cleanpass
$(john) -w:$(dico) -sess:$* -rules:xxx --config:$< -stdout | ./rf - cleanpass "`cat rules/$*.rule`" $(minmatch) | gzip -1 > $@
conf/%.conf: rules/%.rule john.conf.skel
cat john.conf.skel $< > $@