-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpp
More file actions
executable file
·191 lines (163 loc) · 5.28 KB
/
Copy pathpp
File metadata and controls
executable file
·191 lines (163 loc) · 5.28 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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
#!/usr/bin/env bash
#===============================================================================
# Description: A script using Docker and Docker Compose to quickly bring up some
# honeypots exposing lots of services. For research, reconnaissance, and fun.
# Source: https://github.com/philcryer/prickly-pete
# Author: philcryer < phil at philcryer dot com >
# License: MIT
#=============================================================================
set -e
## prompts
function msg_status () {
echo -e "\x1B[01;34m[*]\x1B[0m $1"
}
function msg_good () {
echo -e "\x1B[01;32m[*]\x1B[0m $1"
}
function msg_error () {
echo -e "\x1B[01;31m[*]\x1B[0m $1"
}
function msg_notification () {
echo -e "\x1B[01;33m[*]\x1B[0m $1"
}
## usage
usage() {
echo "Usage: pp [build] [up] [down] [status] [logs] [clean] [nuke]"
echo " build: build projects"
echo " up: start, and build if required, all containers"
echo " down: stop all containers"
echo " status: show the running status of all containers"
echo " scan: scan ports on localhost (requires nmap)"
echo " logs: show live logs from all containers"
echo " clean: remove all containers"
echo " nuke: clean, but also remove all collected data and logs"
exit 0
}
expr "$*" : ".*--help" > /dev/null && usage
expr "$*" : ".*-h" > /dev/null && usage
expr "$*" : ".*help" > /dev/null && usage
if [[ $# -eq 0 ]] ; then
usage
fi
if [[ $# -gt 1 ]] ; then
usage
fi
## logo
logo(){
echo "____________"
echo "| ___ \ ___ | Prickly"
echo "| |_/ / |_/ / e"
echo "| __/| __/ t - honeypots, running in docker"
echo "| | | | e - created in 2019, updated Summer 2025"
echo "\_| \_|"
echo
}
logo;
## functions
checkout(){
msg_notification "checking out code"
if [ ! -d 'src/conpot' ]; then
msg_status "conpot: checking out"
git clone https://github.com/mushorg/conpot.git src/conpot
fi
msg_notification "conpot: checked out"
if [ ! -d 'src/cowrie' ]; then
msg_status "cowrie: checking out"
git clone https://github.com/cowrie/cowrie.git src/cowrie
fi
msg_notification "cowrie: checked out"
if [ ! -d 'src/heralding' ]; then
msg_status "heralding: checking out"
git clone https://github.com/johnnykv/heralding.git src/heralding
fi
msg_notification "heraldinge: checked out"
if [ ! -d 'src/honeyaml' ]; then
msg_status "honeyaml: checking out"
git clone https://github.com/mmta/honeyaml.git src/honeyaml
fi
msg_notification "honeyaml: checked out"
#if [ ! -d 'src/ciscoasa_honeypot' ]; then
# msg_status "ciscoasa_honeypot: checking out"
# git clone https://github.com/Cymmetria/ciscoasa_honeypot.git src/ciscoasa_honeypot
#fi
#msg_notification "honeyaml: checked out"
#if [ ! -d 'src/ddospot-master-' ]; then
# msg_status "ddospot: checking out"
# #git clone https://github.com/aelth/ddospot.git src/ddospot
# cd src
# curl -L -O https://github.com/aelth/ddospot/archive/refs/heads/master.zip
# unzip master.zip
# cd -
#fi
#msg_notification "ddospot: checked out"
}
build(){
msg_notification "build starting"
export COMPOSE_BAKE=true
msg_status "cowrie: building container"
docker compose pull
msg_good "cowrie: container built"
msg_status "conpot: building container"
docker compose pull
msg_good "conpot: container built"
msg_status "heralding: building container"
docker compose pull
msg_good "heralding: container built"
msg_status "honeyaml: building container"
cd src/honeyaml
#docker compose pull
docker compose build
msg_good "honeyaml: container built"
#msg_status "ciscoasa_honeypot: building container"
#docker compose pull
#msg_good "ciscoasa_honeypot: container built"
#msg_status "ddospot: building container"
#docker compose pull
#msg_good "ddospot: container built"
}
volumes(){
echo; msg_notification "volumes: all container volumes holding logs and output data"
tmpfile=/tmp/pp.XXXXXX
docker_volumes=$(docker volume ls --filter "name=ppv" --format "table {{.Name}} - {{.Mountpoint}}" > $tmpfile)
cat $tmpfile; rm $tmpfile
}
## actions
if [[ ${1} == 'build' ]] ; then
msg_notification "build: building containers"
checkout;
build;
fi
if [[ ${1} == 'up' ]] ; then
msg_notification "up: starting containers"
checkout;
build;
docker compose up -d
fi
if [[ ${1} == 'down' ]] ; then
msg_notification "down: stopping containers"
docker compose stop
fi
if [[ ${1} == 'status' ]] ; then
msg_notification "status: running containers and their ports"
docker compose ps
volumes;
fi
if [[ ${1} == 'scan' ]] ; then
msg_notification "scan: scanning local ports via nmap (nmap -p- localhost)"
nmap -p- localhost
fi
if [[ ${1} == 'logs' ]] ; then
msg_notification "logs: show live container logs"
docker compose logs -f
fi
if [[ ${1} == 'clean' ]] ; then
msg_notification "clean: stop and bring all containers down"
docker compose down
volumes;
fi
if [[ ${1} == 'nuke' ]] ; then
msg_notification "nuke: stop and bring all containers down, and remove all volumes"
docker compose down
docker compose down --rmi all -v
fi
exit 0