Home CTF Writeups About

Cyborg


Start with nmap scan (found http -80 and ssh -22)

cyborg-images/74-1.png

gobuster found /admin and /etc

cyborg-images/74-2.png

3 potential users on system. Alex mentions squid proxy, potential insecure config files and a backup archive. Try ssh brute force with a users list.txt. No luck yet.

cyborg-images/74-3.png

some notes on the source code

cyborg-images/74-4.png

Found archive.tar using one of the links

cyborg-images/74-5.png

Readme file displays...

cyborg-images/74-6.png

Researched the link and found this, so expecting to extract something

cyborg-images/74-7.png

cyborg-images/74-8.png

the other subdirectory displays this...

cyborg-images/74-9.png

found a passwd file and conf, password needs to be cracked,

cyborg-images/74-10.png

cyborg-images/74-11.png

auth_param basic program /usr/lib64/squid/basic_ncsa_auth /etc/squid/passwd

auth_param basic children 5

auth_param basic realm Squid Basic Authentication

auth_param basic credentialsttl 2 hours

acl auth_users proxy_auth REQUIRED

http_access allow auth_users

cyborg-images/74-12.png

music_archive:$apr1$BpZ.Q.1m$F0qqPwHSOG50URuOVQTTn.

Used www.hashes.com to find hash

cyborg-images/74-13.png

Searched hashcat wiki for the hash type.

cyborg-images/74-14.png

Running hashcat to crack the hash.

cyborg-images/74-15.png

Found the password!

sq**********

Also, had tried to do steghide and stegseek crack on the piano.jpg found on website. But no luck.

extracted the archive using Borg, which reveals Alex's folder.

cyborg-images/74-16.png

Did some searching through each folder

cyborg-images/74-17.png

found this file in Desktop

cyborg-images/74-18.png

Found this note.txt in Documents which contained Alex's password

alex:S********* = SSH CREDS

cyborg-images/74-19.png

found the first flag in user.txt

Also found some files in the Music folder

cyborg-images/74-20.png

Check which commands can be run as sudo - a particular sh file in the /etc folder

cyborg-images/74-21.png

cat the files in the /etc/mp3backup folder

cyborg-images/74-22.png

cat the file which can be run as sudo

cyborg-images/74-23.png

backup.sh has 554 file permissions, so chmod it to 777.

cyborg-images/74-24.png

used revshells.com to get a bash script, which I pasted above the file content.

cyborg-images/74-25.png

started nc listener on port 4444

cyborg-images/74-26.png

executed the file with sudo permissions

cyborg-images/74-27.png

Oh yeah! Got root.

cyborg-images/74-28.png

Cat out the root flag

cyborg-images/74-29.png