Snoopy

Recon

nmap_scan.log

HTTP (80)

Writeup.png

mm is Mattermost portal, but without creds no luck.

Get users from /about.html

LFI

Index page has download script http://snoopy.htb/download?file=announcement.pdfarrow-up-right

LFI is confirmed

The chat application allows sending Password Reset to emails, but because mail server is disabled this won't work. If we could hijack this that would be great 🤔

Writeup-1.png

Application seems to be living inside the /var/www/html, but I can't read index.php 🤔

No credentials, but it mentions that SMTP is being used. php-email-form.php doesn't exist, but if we write to it we can probably get RCE? 💭

DNS (53)

DNS is open for some reason, but ANY returned no responses. But using axfr returned more domains 📝

https://ubuntu.com/server/docs/domain-name-service-dns#:~:text=The%20DNS%20configuration%20files%20are,%2Fetc%2Fbind%2Fnamed.arrow-up-right

Writeup-2.png

SMTP

allow-transferarrow-up-right is interesting in configuration.

nsupdate - Dynamic DNS update utilityarrow-up-right

We get a connection, but it hangs so it must be expecting real SMTP server's answer.

Run SMTP with python built-in module on port 25:

Chat

http://mm.snoopy.htb/reset_password_complete?token=j3pea4t1xe3czn7rtua699kk345aqktbbfofzwo9y3expycybew1mnjzup1ipburarrow-up-right

Writeup-3.png

Town Square talks about adding dedicated channel for new DevSecOps tool, if we go to Find Channel and search for subdomains found in DNS we end up on Server Provisioning

Writeup-4.png

When submitting the request form we get a callback at port 2222 with Paramiko, SSH.

Writeup-5.png

SSH Honeypot

Automatic

sshesamearrow-up-right: An easy to set up and use SSH honeypot, a fake SSH server that lets anyone in and logs their activity

Manual

So basically pam_execarrow-up-right module can be used to log usernames and input in the SSH, essentially making it a honeypot. BUT this requires usernames to exist on the system, invalid usernames are logged, but their input no.

Post Exploitation: Sniffing Logon Passwords with PAMarrow-up-right

https://book.hacktricks.xyz/linux-hardening/linux-post-exploitation#sniffing-logon-passwords-with-pamarrow-up-right

SSH (cbrown)

https://exploit-notes.hdks.org/exploit/linux/privilege-escalation/sudo/sudo-git-privilege-escalation/#git-applyarrow-up-right

Didn't work out.

Get git version

https://github.com/aquasecurity/trivy/issues/3458arrow-up-right -> https://github.blog/open-source/git/git-security-vulnerabilities-announced-2/arrow-up-right -> https://github.blog/open-source/git/git-security-vulnerabilities-announced-3/arrow-up-right -> Avoid running git apply / git am on input from untrusted sources (CVE-2023-23946).

https://cvefeed.io/vuln/detail/CVE-2023-23946arrow-up-rightCVE-2023-23946-POCarrow-up-right

Generate SSH keys

Create malicious patch which will write to authorized_keys and will enable us to login into SSH. (Refer to PoC)

Create a symlink which is directory we want to write to and apply

SSH (sbrown)

User.txt

Privilege Escalation (root)

CVE-2023-20052: ClamAV XXE Vulnerabilityarrow-up-rightCVE-2023-20052arrow-up-right PoC

We need to create a *.DMG file, but fuck that! I don't want to wait for docker and I don't want to install those tools.

Download something like 7zip.DMGarrow-up-right

We need to replace with:

Nothing 🤔

💀 the hardest fucking part was finding valid DMG files......... This took way too long..... Should have just used fucking Docker and have been done with it.

Valid DMG: https://www.macintoshrepository.org/32918-7zx-7-zip-for-mac-os-x-arrow-up-right

Get SSH key:

Root.txt

Last updated