HackathonCTF 1 is a Linux machine, xXX
Download: https://www.vulnhub.com/entry/hackathonctf-1,591/
Source www.daniel-pinto.dev
👀Finding VM's IP
I like to set environment variables to help me with my scripts. So I set the "ip" variable with machine's IP. You will see references like $ip around.
🖥️Scan
Start running a nmap scan searching for all ports (-p-):
Once the results come back, run nmap again for common scripts (-sC) and service versions (-sV), grepping from result and specifying the ports:
Output:
📑Enumeration
On 21
- Anonymous access is disabled
- vsftpd 3.0.2
On 23
- Telnet service running
On 80
- robots.txt returned 3 directories: /ctf /ftc /sudo
- Directories returned NotFound
- Apache/2.4.7 (Ubuntu)
nmap missed some base64 string

/ftc.html

- Still not sure what that means...

🔐Service Exploited
Brute force using the username "test" found on sudo.html comment.


🔏Priv Escalation
First thing to check was what commands could we sudo.

"(ALL, !root) ALL" means we can execute sudo commands as any user than root like:


We can't execute as root or specifing -u#0.

Joe Vennix from Apple Information Security found that the function fails to parse all values correctly and when giving the parameter user id “-1” or its unsigned number “4294967295”, the command will run as root, bypassing the security policy entry we set in the example above (CVE-2019-14287).
So to get a root shell, we can execute this command:

💰Loot

0 comments:
Post a Comment