forked from its-a-feature/Mythic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
display_output.sh
executable file
·53 lines (51 loc) · 1.75 KB
/
display_output.sh
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
#!/bin/bash
if [ $# -ne 0 ]
then
containers=( "$@" )
for p in "${containers[@]}"
do
docker logs --tail=500 "$p"
read -n 1 -p "Press key to move to next container or q to quit" character
if [ "$character" == "q" ]
then
exit 0
fi
done
else
echo "Clearing display_output.txt"
echo -n "" > display_output.txt
echo "Writing out mythic_rabbitmq to display_output.txt"
output=`docker logs --tail=500 mythic_rabbitmq >> display_output.txt 2>/dev/null`
echo "Writing out mythic_postgres to display_output.txt"
output=`docker logs --tail=500 mythic_postgres >> display_output.txt 2>/dev/null`
echo "Writing out mythic_server to display_output.txt"
output=`docker logs --tail=500 mythic_server >> display_output.txt 2>/dev/null`
profiles=(./C2_Profiles/*)
for p in "${profiles[@]}"
do
realpath=$(realpath "$p")
p=$(echo "${p/.\/C2_Profiles\//}")
tag=$(echo "$p" | tr '[:upper:]' '[:lower:]')
tag=$(echo "${tag/' '/}")
tag=$(echo "${tag/'_'/}")
if [ -d "$realpath" ]
then
echo "Writing out $tag to display_output.txt"
output=`docker logs --tail=500 "$tag" >> display_output.txt 2>/dev/null`
fi
done
profiles=(./Payload_Types/*)
for p in "${profiles[@]}"
do
realpath=$(realpath "$p")
p=$(echo "${p/.\/Payload_Types\//}")
tag=$(echo "$p" | tr '[:upper:]' '[:lower:]')
tag=$(echo "${tag/' '/}")
tag=$(echo "${tag/'_'/}")
if [ -d "$realpath" ]
then
echo "Writing out $tag to display_output.txt"
output=`docker logs --tail=500 "$tag" >> display_output.txt 2>/dev/null`
fi
done
fi