-
Notifications
You must be signed in to change notification settings - Fork 28
/
Makefile
62 lines (49 loc) · 1.59 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
61
62
SHELL := $(shell which bash)
STARTDATE := $(shell date -u +'%Y-%m-%dT%H-%M-%S')
PROJECT_VERSION := $(shell grep -oE 'version = ".*"' Cargo.toml -m 1 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
RELEASE_TARBALL = ./cracken-v${PROJECT_VERSION}.tar.gz
GPG_SIGN_KEY = 647290A426CF53EF
build-crate:
cargo package
release:
cargo build --release
rm -rf ./build/*
mkdir -p ./build/
cp ./target/release/cracken ./build/
cd build && \
tar -pcvzf "${RELEASE_TARBALL}" "./cracken" && \
gpg --detach-sign --default-key "${GPG_SIGN_KEY}" --armor "${RELEASE_TARBALL}" && \
gpg --verify "${RELEASE_TARBALL}.asc"
validate:
cargo fmt -- --check
cargo clippy
test: validate
cargo test -- --nocapture
test-release: release
rm -rf ./tmp/*
mkdir -p ./tmp
@echo "testing mask with minlen and maxlen"
cd ./tmp && \
cp "../build/${RELEASE_TARBALL}" . && \
tar xzvf "../build/${RELEASE_TARBALL}" && \
./cracken --help && \
time ./cracken -m 1 -x 4 -o './cracken-${STARTDATE}.txt' '?u?l?u?l' && \
cmp ../test-resources/upper-lower-1-4.txt './cracken-${STARTDATE}.txt'
@echo "testing mask with wordlists and custom charsets"
cd ./tmp && \
time ./cracken -c '#!@' \
-w ../test-resources/wordlist1.txt \
-w ../test-resources/wordlist2.txt \
-o './cracken-${STARTDATE}-wl.txt' \
'?w1?d?w2?l?w1?1' && \
cmp ../test-resources/wordlists-mix.txt './cracken-${STARTDATE}-wl.txt'
rm -rf ./tmp/*
print-release-version:
./build/cracken --help | grep cracken-v
bench:
cargo bench
coverage:
cargo tarpaulin -o Html --avoid-cfg-tarpaulin
ci: test test-release coverage build-crate print-release-version
fmt:
cargo fmt