BigBang

Recon

nmap_scan.log

HTTP (80)

IP redirects to blog.bigbang.htb which seems to have repeating contents. It's a wordpress website and we have some kind of form for login and resetpassword leads to wordpress

Writeup.png

WordPress

BuddyForms

BuddyForms < 2.7.8 - Unauthenticated PHAR Deserializationarrow-up-right

https://cvefeed.io/vuln/detail/CVE-2023-26326arrow-up-right

WordPress BuddyForms Plugin — Unauthenticated Insecure Deserialization (CVE-2023–26326)arrow-up-right

Note: Idk if id should be valid, but you can upload legit file and increment

CVE doesn't seem to work..

WordPress BuddyForms Plugin <= 2.8.8 is vulnerable to Arbitrary File Downloadarrow-up-righthttps://cvefeed.io/vuln/detail/CVE-2024-32830arrow-up-righthttps://feedly.com/cve/CVE-2024-32830arrow-up-rightBuddyForms <= 2.8.8 - Unauthenticated Arbitrary File Read and Server-Side Request Forgeryarrow-up-right

Hmmm... the source doesn't have any protections which it has in later versions; Only suspicion is that author did a hot patch or something.

Patch Investigation (Skip)


From the future: It seems like PHP disabled this functionality after PHP 8.0. 4xura: HTB Writeup – BigBangarrow-up-right

Writeup-1.png

To see diffs use

Source: https://plugins.svn.wordpress.org/buddyforms/tags/arrow-up-right

Nothing.

LFI using php filter chain

Later on someone said wrapwraparrow-up-right worked

Chain:

I think main reason why previously phar or php didn't work was because we needed image, simplest image header is GIF with GIF89;

Now we have LFI, but some files are not readable fully (?); Also it is incredibly slow, like 10-15second per read.

LFI is not yielding anything

iconv RCE

By default there were some uploaded files and for some reason output of /proc/self/maps many times in 2024 uploads.

Ambionics security has another research about iconv RCE which fits the description of target. maps is also required for this exploit with glibc, considering that above maps is either a hint or author forgot to remove them.

Iconv, set the charset to RCE: Exploiting the glibc to hack the PHP engine (part 1)arrow-up-rightAnalysis of CVE-2024–2961 Vulnerabilityarrow-up-right

Note: glibc wasn't playing nice so above script is updated to pad length of prefix with null bytes, so GIF89; adds 6 null bytes at the end which gives valid libc.

Author also provided PoC script for exploitation: cnext-exploitsarrow-up-right -> cnext-exploit.pyarrow-up-right

We need to slightly modify script to use wrapwrap and then get RCE.

Main changes are inside Remote class and then some changes in logic. check_vulnerable will fail because so it's removed, files were already downloaded so load them locally. Most of the code stayed the same from source.

Writeup-2.png

Reverse Shell (www-data)

Commands to check active ports don't exist like ss or netstat

I don't think we are inside a container, but could be.

Perl exists on system so we can use this script https://gist.github.com/jkstill/5095725?permalink_comment_id=4188684#gistcomment-4188684arrow-up-right to parse /proc/net/tcp for connections.

Enumerate mysql with php

Databases:

Tables:

Dump table

Crack the hashes

SSH

User.txt

Privilege Escalation (developer)

There are other users on box, so it's probably not going to be straight up to root.

Enumerate with linpeas

Grafana is interesting

sqlite3 doesn't exist.

Download with scp

grafana2hashcatarrow-up-right

Note: Base64 function decodes if type is blob, if text encodes. refer to https://www.sqlite.org/base64.htmlarrow-up-right

Privilege Escalation (root)

Credentials work for local user

No need to port forward Grafana I think 🤔

Smali code was all over the place so I decided to use MobSF: Mobile-Security-Framework-MobSFarrow-up-right

Analysis may take 3-5 minutes

Writeup-3.png
Writeup-4.png
Writeup-5.png
Writeup-6.png

After filtering for bigbang.htb there's 2 routes: /login and /command

Authorization header value seems to be coming from login so let's do that first. Code was really messy, but API was chatty enough to say what it wanted.

Actually if we look for class name we can identify arguments.

Writeup-7.png

There seems to be 2 commands. First is move with x, y, z coordinates?

Writeup-8.png

And second is send_image with output_file

Pasted_image_20250201180525.png

Outputs about special characters looked like classic filters for command injection.

I wanted to insert newline, but application crashed with Errno 2

Error is raised by Python, probably the output_file is parsed into os.system or smth. Anyway the api returns error but command is executed.

Writeup-10.png

Root.txt

Last updated