Skip to main content

HTB - SecNotes

alt

Basic Nmap scan

Nmap command: nmap -Pn -n -sC -sV -oA scan_boxs/secnotes/nmap/10.10.10.97-d-scan 10.10.10.97
Nmap scan report for 10.10.10.97
Host is up (0.14s latency).
Not shown: 998 filtered tcp ports (no-response)
PORT STATE SERVICE VERSION
80/tcp open http Microsoft IIS httpd 10.0
| http-methods:
|_ Potentially risky methods: TRACE
| http-title: Secure Notes - Login
|_Requested resource was login.php
|_http-server-header: Microsoft-IIS/10.0
445/tcp open microsoft-ds Microsoft Windows 7 - 10 microsoft-ds (workgroup: HTB)
Service Info: Host: SECNOTES; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
| smb2-security-mode:
| 3.1.1:
|_ Message signing enabled but not required
| smb2-time:
| date: 2022-09-10T12:02:06
|_ start_date: N/A
| smb-security-mode:
| account_used: guest
| authentication_level: user
| challenge_response: supported
|_ message_signing: disabled (dangerous, but default)
|_clock-skew: mean: -1s, deviation: 0s, median: -1s

probing for all open ports

Nmap command: nmap -Pn -n -sV -p- -T4 10.10.10.97
Nmap scan report for 10.10.10.97
Host is up (0.14s latency).
Not shown: 65532 filtered tcp ports (no-response)
PORT STATE SERVICE VERSION
80/tcp open http Microsoft IIS httpd 10.0
445/tcp open microsoft-ds Microsoft Windows 7 - 10 microsoft-ds (workgroup: HTB)
8808/tcp open http Microsoft IIS httpd 10.0
Service Info: Host: SECNOTES; OS: Windows; CPE: cpe:/o:microsoft:windows

port 80:

alt

Looks like we have option to create account.

alt

creating an account cybo and logging in.

alt

Create a note

alt

alt

Testing injected html code execution.

alt

The above code if executed will align the text to the center.

alt

Hello1 text appears at the center. Successfully executed the injected code.

One can update the password of the logged in user.

alt

Successfully updated the password.

alt

alt

Exploit html injection

alt

We can see ncat catch the request.

alt

As we can send request to reset the password, there is a chance we might be able to reset the password for tyler. Let find the parameter sent in the reset password request.

alt

Now put the link to reset password in the message

alt

Successfully able to login as tyler.

alt

Found creds for tyler smb share.

alt

\\secnotes.htb\new-site
tyler / 92g!mA8BGjOirkL%OG*&

smb shares tyler access

tyler has privileges to put file in smb share

alt

alt

Was able to successfully upload the file, iisstart.htm file looks familiar. Lets try accessing the file on port 8808

alt

alt

Reverse shell php powershell

alt

Upload the reverse shell

alt

alt

User Flag

alt

Privilege escalation

Probing further in to the folder C:\Users\tyler\Desktop> we find bash.lnk link file and its point to an bash.exe. This could be interesting.

alt

Trying to execute the bash.exe file but no change. searching for bash.exe file but for some reason windows commands are executing. We will upload ne.exe file and get a reverse shell.

alt

Uploading cmdshell.php and nc.exe file to the smbshare

alt

Reverse shell with nc

alt

alt

Searching for bash.exe file

alt

Executing bash.exe file gives a bash shell.

alt

Eventhough the bash shell is root, the user doesn't have permission to access the file.

alt

Cheching the bash environment

alt

Swithcing to /root home directory and digging more info

alt

Looks like .bash_history file has some content and found creds for admin.

alt

PsExec connection as admin

alt

Root flag

alt