-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
143 lines (106 loc) · 4.27 KB
/
Makefile
File metadata and controls
143 lines (106 loc) · 4.27 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
MUSL_TARGET ?= x86_64-linux-musl
UNAME_M := $(shell uname -m)
DOCKER_BUILD = docker build --build-arg MUSL_TARGET=$(MUSL_TARGET) -f Dockerfile.$@ -t $@-$(MUSL_TARGET) .
GRABBY_HANDS = docker run --rm --mount type=bind,source=$(shell pwd)/output/$(MUSL_TARGET),target=/grabby $@-$(MUSL_TARGET) install -g $(shell id -g) -o $(shell id -u)
all: busybox-1.33.1 curl-7.79.1 dropbear-2020.81 loggedfs-0.9 ngrep-2a9603b nmap-7.90 openssl-1.1.1k parted-3.4 socat-1.7.4.1 tcpdump-4.99.1 strace-6.1 fuzzotron-09b7046
check:
@echo "These binaries are not built properly:"
@echo "$(shell file output/*/* | grep -E -v "\.tar\.gz|statically linked")"
## Dependencies
musl-cross-make:
mkdir -p output/$(MUSL_TARGET)
$(DOCKER_BUILD)
ncurses-6.2: musl-cross-make
$(DOCKER_BUILD)
readline-8.1: ncurses-6.2
$(DOCKER_BUILD)
zlib-1.2.11: musl-cross-make
$(DOCKER_BUILD)
pcre-8.45: musl-cross-make
$(DOCKER_BUILD)
libnl-3.2.25: musl-cross-make
$(DOCKER_BUILD)
protobuf-3.21.1: musl-cross-make
$(DOCKER_BUILD)
expat-2.4.1: musl-cross-make
$(DOCKER_BUILD)
e2fsprogs-1.46.5: musl-cross-make
$(DOCKER_BUILD)
# Produces both libcurl and the curl binary.
curl-7.79.1: openssl-1.1.1k
$(DOCKER_BUILD)
$(GRABBY_HANDS) /output/bin/curl /grabby/$@
libxml2-2.9.12: musl-cross-make
$(DOCKER_BUILD)
libpcap-1.10.1: musl-cross-make
$(DOCKER_BUILD)
# Nothing uses this currently, it's an optional dependency for git though.
gettext-0.21: musl-cross-make
$(DOCKER_BUILD)
# libfuse >= 3.x uses meson/ninja as a build system so for the time being I am sticking with 2.x
fuse-2.9.9: musl-cross-make
$(DOCKER_BUILD)
# Don't use this EOL version of OpenSSL for anything important, it's just provided here in case it's needed to e.g. decrypt an old file
openssl-0.9.8zh: zlib-1.2.11
$(DOCKER_BUILD)
$(GRABBY_HANDS) /output/bin/openssl /grabby/$@
# Produces both libssl and the openssl command line tool.
openssl-1.1.1k: musl-cross-make
$(DOCKER_BUILD)
$(GRABBY_HANDS) /output/bin/openssl /grabby/$@
## Tools
dropbear-2020.81: zlib-1.2.11
$(DOCKER_BUILD)
$(GRABBY_HANDS) /output/bin/dbclient /grabby/dbclient-2020.81
$(GRABBY_HANDS) /output/bin/dropbearconvert /grabby/dropbearconvert-2020.81
$(GRABBY_HANDS) /output/bin/dropbearkey /grabby/dropbearkey-2020.81
$(GRABBY_HANDS) /output/sbin/dropbear /grabby/$@
socat-1.7.4.1: openssl-1.1.1k readline-8.1
$(DOCKER_BUILD)
$(GRABBY_HANDS) /output/bin/socat /grabby/$@
fuzzotron-09b7046: openssl-1.1.1k pcre-8.45
$(DOCKER_BUILD)
$(GRABBY_HANDS) /output/bin/replay /grabby/replay-09b7046
$(GRABBY_HANDS) /output/bin/fuzzotron /grabby/fuzzotron-09b7046
nmap-7.90: libpcap-1.10.1 openssl-1.1.1k pcre-8.45 zlib-1.2.11
$(DOCKER_BUILD)
$(GRABBY_HANDS) /output/bin/nmap /grabby/$@
ngrep-2a9603b: libpcap-1.10.1 pcre-8.45
$(DOCKER_BUILD)
$(GRABBY_HANDS) /output/bin/ngrep /grabby/$@
tcpdump-4.99.1: libpcap-1.10.1
$(DOCKER_BUILD)
$(GRABBY_HANDS) /output/bin/tcpdump /grabby/$@
loggedfs-0.9: fuse-2.9.9 libxml2-2.9.12 pcre-8.45
$(DOCKER_BUILD)
$(GRABBY_HANDS) /output/bin/loggedfs /grabby/$@
busybox-1.33.1: musl-cross-make
$(DOCKER_BUILD)
$(GRABBY_HANDS) /output/bin/busybox /grabby/$@
strace-6.1: musl-cross-make
$(DOCKER_BUILD)
$(GRABBY_HANDS) /output/bin/strace /grabby/$@
openssh-8.8p1: openssl-1.1.1k zlib-1.2.11
$(DOCKER_BUILD)
$(GRABBY_HANDS) /output/bin/ssh /grabby/ssh-8.8p1
$(GRABBY_HANDS) /output/bin/scp /grabby/scp-8.8p1
$(GRABBY_HANDS) /output/bin/sftp /grabby/sftp-8.8p1
$(GRABBY_HANDS) /output/bin/ssh-keygen /grabby/ssh-keygen-8.8p1
parted-3.4: e2fsprogs-1.46.5 readline-8.1
$(DOCKER_BUILD)
$(GRABBY_HANDS) /output/sbin/parted /grabby/parted-3.4
stunnel-5.64: openssl-1.1.1k
$(DOCKER_BUILD)
$(GRABBY_HANDS) /output/bin/stunnel /grabby/$@
## Slightly crusty tools
# By default just build the basic 'git' binary. If you want "everything" then set GIT_FULL as an environment variable. The 'git-versionnumber' binary will need to be renamed to just 'git' to work.
git-2.33.0: curl-7.79.1 expat-2.4.1 openssl-1.1.1k zlib-1.2.11
$(DOCKER_BUILD)
$(GRABBY_HANDS) /output/bin/git /grabby/$@
ifdef GIT_FULL
$(GRABBY_HANDS) /output/full.tar.gz /grabby/$@.tar.gz
endif
# Currently this will only build on 64 bit ARM, 32 or 64 bit x86. This will be sorted out later.
nsjail-3.1: libnl-3.2.25 protobuf-3.21.1
$(DOCKER_BUILD)
$(GRABBY_HANDS) /build/nsjail-3.1/nsjail /grabby/$@