-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
91 lines (77 loc) · 3.3 KB
/
Makefile
File metadata and controls
91 lines (77 loc) · 3.3 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
ROOT_DIR := $(shell pwd)
BOOT_DIR := $(ROOT_DIR)/boot
ATTACKER_DIR := $(ROOT_DIR)/attacker
ROOTKIT_DIR := $(ROOT_DIR)/rootkit
all: prepare start doc
prepare:
@echo "Preparing the environment..."
@cd $(BOOT_DIR)
@chmod +x $(BOOT_DIR)/1__setup.sh
@sudo $(BOOT_DIR)/1__setup.sh $(BOOT_DIR)
start:
@cd $(BOOT_DIR)
@chmod +x $(BOOT_DIR)/2__launch.sh
@$(BOOT_DIR)/2__launch.sh $(BOOT_DIR)
update_attacker:
@echo "Updating attacker files..."
@echo "Copying repository 'attacker' to the attacker machine..."
@scp -r $(ATTACKER_DIR)/ attacker@192.168.100.2:/home/attacker/
@echo "All files copied successfully."
launch_attacker:
@echo "Launching attacking web server..."
ssh attacker@192.168.100.2 'sudo -S sh -c "pamac install --no-confirm kitty socat && python3 /home/attacker/attacker/main.py"'
update_victim:
@echo "Updating victim files..."
@echo "Copying repository 'rootkit' to the victim machine..."
@scp -r $(ROOTKIT_DIR)/ victim@192.168.100.3:/home/victim/
@echo "All files copied successfully."
launch_victim:
@echo "Compiling and insmod rootkit on the victim machine..."
ssh victim@192.168.100.3 'cd ~/rootkit && sudo -S sh -c "make -j 8 -f Makefile && insmod epirootkit.ko"'
launch_debug_victim:
@echo "Compiling and insmod rootkit on the victim machine..."
ssh victim@192.168.100.3 'cd ~/rootkit && sudo -S sh -c "make -j 8 -f Makefile debug && insmod epirootkit.ko"'
stop_epirootkit:
@echo "Trying to rmmod epirootkit... (available only if rootkit has been launched in debug mode)"
ssh victim@192.168.100.3 'sudo -S rmmod epirootkit'
doc: doc-en doc-fr
@echo "Documentation generated!"
@echo "English documentation available at docs/html/index.html"
@echo ""
@echo "To view the french documentation, open 'file://$(ROOT_DIR)/docs/html/fr/html/index.html' in your web browser."
@echo ""
@echo "To view the english documentation, open 'file://$(ROOT_DIR)/docs/html/en/html/index.html' in your web browser."
doc-fr:
@if ! command -v doxygen >/dev/null 2>&1; then \
echo "Doxygen not found. Installing..."; \
sudo apt-get update && sudo apt-get install -y doxygen; \
else \
echo "Doxygen is already installed."; \
fi
@echo "Generating French documentation..."
@mkdir -p $(ROOT_DIR)/docs/build/fr
@cd $(ROOT_DIR)/docs && doxygen Doxyfile.fr
@cp -r $(ROOT_DIR)/docs/img $(ROOT_DIR)/docs/build/fr/html 2>/dev/null || true
@echo "French documentation generated successfully at docs/build/fr/html/index.html"
doc-en:
@if ! command -v doxygen >/dev/null 2>&1; then \
echo "Doxygen not found. Installing..."; \
sudo apt-get update && sudo apt-get install -y doxygen; \
else \
echo "Doxygen is already installed."; \
fi
@echo "Generating English documentation..."
@mkdir -p $(ROOT_DIR)/docs/build/en
@cd $(ROOT_DIR)/docs && doxygen Doxyfile.en
@cp -r $(ROOT_DIR)/docs/img $(ROOT_DIR)/docs/build/en/html 2>/dev/null || true
@echo "English documentation generated successfully at docs/build/en/html/index.html"
clean:
@echo "Cleaning up..."
@echo "Removing generated documentation..."
@rm -rf $(ROOT_DIR)/docs/build
@echo "Cleaning network interfaces..."
@cd $(BOOT_DIR)
@chmod +x $(BOOT_DIR)/3__clean.sh
@$(BOOT_DIR)/3__clean.sh $(BOOT_DIR)
@echo "Cleanup completed."
.PHONY: prepare start update_attacker launch_attacker update_victim launch_victim launch_debug_victim stop_epirootkit doc doc-fr doc-en clean