forked from lowleveltv/secure-server-stuff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
39 lines (30 loc) · 1.03 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
CC = gcc
OBJD = objdump
UNSAFEF = -fno-stack-protector -m32 -no-pie
default: index
index:
@echo "Dependencies:"
@echo "- make multilib -> install gcc-multilib."
@echo "Binaries:"
@echo "- make hacked -> generate hacked originals binary."
@echo "- make exploit -> generate a c version of the original exploit."
@echo "Run:"
@echo "- make pyexploit -> run the python3 version of the exploit."
@echo "- make cexploit -> run the c version of the exploit."
@echo "Miscelaneous:"
@echo "- make hacked-dump -> generate hacked objdump."
@echo "- make clean -> clean /bin directory."
multilib:
sudo apt install gcc-multilib
hacked: original/hacked.c original/secrets.c
@$(CC) -o bin/hacked original/hacked.c original/secrets.c $(UNSAFEF)
dumphacked: bin/hacked
@$(OBJD) -d bin/hacked > hacked-dump
exploit: exploits/exploit.c
@$(CC) -o bin/exploit exploits/exploit.c $(UNSAFEF)
pyexploit: exploits/exploit.py
(python3 exploits/exploit.py; cat) | ./bin/hacked
cexploit: bin/exploit
(./bin/exploit; cat) | ./bin.hacked
clean:
@rm ./bin/*