-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmkCTFdir.sh
executable file
·159 lines (112 loc) · 2.32 KB
/
mkCTFdir.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
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
#!/bin/bash
# Script to building out my CTF writeup and walkthroughs and notes.
ARGTOTAL=2
USAGE="Usage: $0 <OS/THM/HTB> <Boxname>"
if [ "$#" -ne $ARGTOTAL ]; then
echo "Error invalid argument total "
echo $USAGE
exit
fi
OS="OS-ProvingGrounds"
THM="TryHackMe/Markdown"
HTB="HackTheBox/Retired-Machines"
if [ "$site" != $1 ] || [ "$name" != $2 ];
then
case "$1" in
("HTB") site=$HTB; name=$2;;
("OS") site=$OS; name=$2;;
("THM") site=$THM; name=$2;;
*) echo $USAGE; echo "Site shorthand invalid"; exit;;
esac
mkdir -p $site/$name/{data,Notes,nmap,nikto,feroxbuster,masscan,gobuster,ffuf,Screenshots}
echo "# 0 - TEMPLATE" > $site/$name/Notes/0-$name-Notes.md
echo "# $name Writeup
Name: $name
Date:
Difficulty:
Goals:
Learnt:
Beyond Root:
- [[$name-Notes.md]]
- [[$name-CMD-by-CMDs.md]]

## Recon
The time to live(ttl) indicates its OS. It is a decrementation from each hop back to original ping sender. Linux is < 64, Windows is < 128.

## Exploit
## Foothold
## Privilege Escalation
## Post-Root-Reflection

## Beyond Root
" > $site/$name/$name-Writeup.md
echo "# $name Notes
## Data
IP:
OS:
Arch:
Hostname:
DNS:
Domain: / Domain SID:
Machine Purpose:
Services:
Service Languages:
Users:
Email and Username Formatting:
Credentials:
#### Mindmap-per Service
\`\`\`
sudo tcpdump -nvvvXi tun0 tcp port 80
ls -1tr Screenshots | grep -v ping | awk '{print \"\"}\' | xsel -b
\`\`\`
- OS detect, run generate noting for nmap
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
#### Todo List
" > $site/$name/$name-Notes.md
echo '# $dash_delimited_ip Meta-Notes
' > $site/$name/$name-Meta-Notes.md
echo '
## Machine Connects list and reason:
[[]] - Reason X
## Objectives
What do have in the solutions inventory to meet larger objective?
- Excalidraw maps!
## Solution Inventory Map
What edges do you have?
## Data Collected
#### Credentials
```
```
#### HUMINT
#### Local Inventory
#### Todo List
#### Timeline of tasks completed
' > $site/$name/$name-Meta-Notes.md
echo "# $name CMD-by-CMDs
\`\`\`bash
sed -i 's/$oldip/$newip/g' *-CMD-by-CMDs.md
ls -1 Screenshots | awk '{print\"\"}'
\`\`\`
\`\`\`
\`\`\`
" > $site/$name/$name-CMD-by-CMDs.md
else
echo $HELP
echo "Error Site or Name is empty $1 and $2"
exit
fi
exit