forked from eciavatta/caronte
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
88 lines (59 loc) · 1.57 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
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
TIMER = 60
FILE_COUNT = 30
FILENAME = service1-%Y-%m-%d_%H.%M.%S.pcap
DUMP_CMD = sudo tcpdump -G $(TIMER) -W $(FILE_COUNT) -w $(FILENAME) -s0 -i game 'tcp and port PORT'
COMPOSE = sudo docker-compose
YML = caronte/docker-compose.yml
DC = $(COMPOSE) -f $(YML)
TEAM = 9
VM_IP = 10.60.$(TEAM).1
# Docker
all: up
build:
$(DC) up -d --build
up:
$(DC) up -d
down:
$(DC) down
start:
$(DC) start
stop:
$(DC) stop
# Traffic and SSH
sniff:
./import_pcaps.sh $(VM_IP)
scp_dump:
scp ./dump.sh root@$(VM_IP):/root/dump.sh
ssh_copy_id:
ssh-copy-id -i ~/.ssh/id_rsa.pub root@$(VM_IP)
ssh_copy: ssh_copy_id
ssh root@$(VM_IP)
ssh:
ssh root@$(VM_IP)
dump_copy: ssh_copy_id scp_dump
ssh root@$(VM_IP) bash dump.sh
./import_pcaps.sh $(VM_IP)
dump: scp_dump
ssh root@$(VM_IP) bash dump.sh
./import_pcaps.sh $(VM_IP)
put:
./put_services
config:
scp ./config.sh root@$(VM_IP):/root/config.sh
ssh root@$(VM_IP) bash config.sh
# Help
help:
@ echo "Remember to insert the id_rsa.pub in the VM"
@ echo "create the /root/pcaps/service* subforlders"
@ echo "sudo chmod -R 777 ."
@ echo "enter into screen to dump:"
@ echo $(DUMP_CMD)
@ echo "screen -S name -> to create a session named 'name'"
@ echo "screen -> create a session without name"
@ echo "screen -r name -> recover the session"
@ echo "screen -dr name -> recover the detached session"
@ echo "<CTRL-a> + d -> detach"
@ echo "<CTRL-d> -> kill session"
@ echo "screen -ls -> list sessions"
# Phony
.PHONY: all build up down start stop sniff scp_dump ssh_copy_id ssh_copy ssh dump_copy dump put config help