Skip to content

Aksheet10/Super-Spam-Walkthrough

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 

Repository files navigation

Super-Spam Official Walkthrough

(Note to tester: the machine needs more resources to speed up this time)

This machine can take 5-10 minutes to setup.

Good luck Have fun solving it :)


  • Let's scan the machine with rustscan for open ports

    rustscan -a 10.10.103.218

    image

    We can see 5 open ports 80, 4012, 4019, 5901 and 6001

    Lets use NMAP to perform version detection

    nmap -sV 10.10.103.218 -p 80,4012,4019,5901,6001 -T4

    image

    Port 80 = HTTP

    Port 4012 = SSH

    Port 4019 = FTP

    Port 5901 = VNC


    Q1. What CMS and version is being used? (format: wordpress x.x.x)

    nmap -A -p 80 -T4 ip

    image


  • FTP

    Lets login in FTP with anonymous

    ftp 10.10.103.218 4012

    Pasted image 20210228103031

    We can see a note.txt

    Pasted image 20210228103159

    We can see on line of 13th January that adam has included a Wireshark file

    Lets do a ls -a to see if there are any hidden files

    Pasted image 20210228103539

    Yes!! We were right

    There is a hidden directory called .cap

    Lets navigate into that directory and check its contents

    image

    We can see a file called SamsNetwork.cap, we can download on our machine.

    -rwxr--r-- 1 ftp ftp 370488 Feb 20 14:46 SamsNetwork.cap

    get SamsNetwork.cap - To download it in our machine.

    Pasted image 20210228105101

    It is now downloaded in our machine. Lets use aircrack-ng to crack it.

    aircrack-ng SamsNetwork.cap -w /path/to/rockyou.txt

    After some time we can see that it successfully cracked the password.

    Pasted image 20210228133528

    Password : [REDACTED]

    Now we have a password!!


    • Website

      Lets check out the website.

      image

      Lets try finding username's in the website

      image

      Click on Blog

      After viewing all the blogs, I found these usernames

      • Adam_Admin
      • Benjamin_Blogger
      • Donald_dump
      • Lucy_Loser

      We have 1 password and 4 users. Let's try logging in.

      Scroll all the way down image

      After trying the password for all user's. We can see the the password [REDACTED] works for the user [REDACTED].

      image

      After login we can see this page. image

      http://ip/concrete5/index.php/dashboard/welcome

      Now just change the url to ip image

      Scroll a bit down and click on any of them. image

      You will see these button's on the top right

      image

      Click on

      image

      And you will see this

      image

      Click on File Manager under Files section

      image

      You will see a site like this image Click on upload file

      Upload a PHP revserse shell. You can find it here.

      Download this on your machine and change the ip address in it using a text edittor

      Now lets upload this in the website and set up a listener on our machine : nc -lvnp 1234 (replace 1234 with the port you have changed in the php reverse shell script)

      image

      Looks like .php extension is an invalid extension

      Lets fix that.

      image

      image

      Add , php at the end

      image

      Click on Save

      Now lets try to upload again

      image

      Click on Upload Files on the top right

      image

      Boom!! Its successfull!

      Now lets click close.

      Now set up a listener nc -lvnp 1234(replace 1234 with the port you have changed in the php reverse shell script)

      image

      After you click on that link. You will get a reverse shell.

      Lets upgrade our shell by using python3 -c 'import pty;pty.spawn("/bin/bash")'

      image

      Navigate to /home/personal.

      There are a lot of files

      image

      To find the user flag we need to grep through all the files - cat * | grep flag

      image

      Now go to /home/lucy_loser and list the files

      image

      We see an hidden directory .MessagesBackupToGalactic. Let's navigate to that folder and view files

      image

      We can see a lot of png, a python file and a note.txt

      Q3. What type of encryption did super-spam use to send his encrypted messages?

      image

      Lets download all the pngs to our machine using a python3 http server - python3 -m http.server 2222. Remember to run it in while you are in the .MessagesBackupToGalactic folder.

      image

      To get it on your machine follow these steps

      wget ip:2222/c1.png
      wget ip:2222/c2.png
      wget ip:2222/c3.png
      wget ip:2222/c4.png
      wget ip:2222/c5.png
      wget ip:2222/c6.png
      wget ip:2222/c7.png
      wget ip:2222/c8.png
      wget ip:2222/c9.png
      wget ip:2222/xored.py
      

      Now Lets run the xored.py script. For it to work you would need PILLOW installed

      pip3 install pillow

      Lets run the script.

      image

      It requires 2 png files. After trying a lot i found out c2.png and c8.png worked

      image

      Lets view our newly made file c28.png

      Q4. What key information was embedded in one of super-spam's encrypted messages?

      [redacted]
      

      image

      We can find a password

      After trying each user i found out the we could use the user donalddump to login using that password.

      image

      Let's SSH into donalddump

      ssh donalddump@ip -p 4012 and password which you found in the image

      image

      Lets browse in our home directory

      image

      Permission denied - Lets try to change the permissions of the /home/donalddump - chmod 777 /home/donalddump

      image


      • Getting Root


      Now we remember we had VNCviewer running as we found in our nmap scan.

      Lets try to gain root using that

      Grab VNC passwd file from donaldump's directory

      image

      Transfer this using python3 -m http.server 1234

      On your machine - wget ip:1234/passwd

      image

      Do port forwarding with ssh as you know donald_dump's password , ssh -L 5901:localhost:5901 donalddump@ip -p 4012

      image


      Note : Make sure you have VNCviewer installed, if not please install it using this link.

      Or install it using: sudo apt install tigervnc-viewer

      Run - vncviewer -passwd passwd_file ip::5901 on your machine.

      • passwd_file was the one we transfered from Superspam to our machine which was in the donalddump home directory.

      image

      Let's change the root password and then log in as root from ssh

      passwd

      image

      I changed the password to 1234

      Lets do su root in the donalddump ssh shell

      image

      We see a unusual hidden directory called .nothing

      Lets browse in it and check its content.

      image

      We see a r00t.txt file. Lets get the contents of the file - cat r00t.txt

      image

      By copying the what am i? string and paste it in CyberChef

      image

      Now we get the decoded string which has the root flag!

      image

      Root_flag: flag{REDACTED}


      Just for fun, I decoded the other string and this is the decoded string.

      image

      image


      Thank You for reading my writeup. Hope you enjoyed it!!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published