Freelancer

Recon

nmap_scan.log
└─$ cat /etc/hosts | grep free
10.10.11.5      freelancer.htb  dc.freelancer.htb       hostmaster.freelancer.htb

DNS (53)

DNS enumeration gives new subdomains. Update hosts.

HTTP (80)

Writeup.png

Normal User

We are allowed to register as a Freelancer or Employer.

Employer has a note so it's worth exploring this first.

Writeup-1.png

Creds: test02:test02@freelancer.htb:test02test02

Since our account had to be reviewed I tried XSS payload, but no luck.

On login page we have option to recover the password. After answering questions we end up on Reset Password, but the URL is a bit funky.

Writeup-2.png

We aren't able to reset password of others, the application gives 500. Probably our id is tied to sessionid which we can't effect. The password reset activated our account and we are able to login.

Writeup-3.png

OTP Authentication

QR Code is interesting

Writeup-4.png

The same funky url is used for Authentication.

Writeup-5.png

Tool: https://qrcode-decoder.comarrow-up-right

Fuzz the parameter. QR link is one time use only so it needs to be generated for each login attempt.

Using OTP we are able to login as admin (id=2)

Admin Account Via OTP

Writeup-6.png

Since the app is built with Django we have /admin panel

Writeup-7.png

Django Admin Panel

Writeup-8.png

Application has SQL Terminal we can play around

Writeup-9.png

PayloadsAllTheThings: MSSQL Injectionarrow-up-right

MSSQL can execute shell commands, but looks like we don't have permissions to do so. Database didn't have anything more interesting then this.

Get users and permissions:

Writeup-10.png

Get sysadmins:

Writeup-11.png

I tried getting ConPtyShell, but it looks like AV is active on box.

Writeup-12.png

Probably box specific thing, but the xp_cmdshell permissions restarts after few commands. To reset use:

Reverse Shell

Reverse shells from revshell.com were getting caught, then I used powercat

SQL database seems to be living on sql_svc user Downloads

Database configuration:

List all users:

Format usernames:

Passwords:

Check if any user uses this passwords:

Privilege Escalation (mikasaackerman)

Creds: mikasaAckerman:IL0v3ErenY3ager

winrm is not active system so no luck there. Get reverse shell via RunasCs.exe:

User.txt

Privilege Escalation (lorra199)

Download the file: (download speed isn't good)

Forensics

Volatility was not particularly helpful about this dump. Through some hints I found tool MemProcFSarrow-up-right.

The process is kept running because it's live mounting the dump file, process doesn't take long.

impacket-secretsdump can be used to dump SAM hashes.

Get the user with this password:

Get the reverse shell and explore system:

Winrm

This user is able to use winrm, upgrade shell:

Sync time and get "loot" for bloodhound:

Note: 1. NetBIOS error shouldn't be an issue for Bloodhound. 2. ntpdate didn't work, faketime fixed the issue.

Writeup-13.png

Mark the lorra199 user as owned.

To show all computers on network use query: MATCH (c:Computer) RETURN c

There seems to be second domain controller on the network.

Writeup-14.png

Show shortest path to DC2 from owned user.

Writeup-15.png

Members of this group can list/delete/control the deleted active directory objectsThe AD RECYLE BIN group has GenericWrite permissions on DC2 and can modify the attributes of the account, including setting or changing the list of services allowed to be delegated to, which can indirectly implement constrained delegation (RBCD).

Deleted object can be listed using:

Privilege Escalation (Administrator)

A Practical Guide To RBCD Exploitationarrow-up-right


References:

Writeups:

Should read:

Should give a read?:

Last updated