Code

Recon

nmap_scan.log

HTTP (5000)

80/443 is not open, only 5000 which is serving Python online runner (?)

Writeup.png

import is blocked, most "dangerous" functions are blocked like eval, exec, even open.

Payloads: https://book.hacktricks.wiki/en/generic-methodologies-and-resources/python/bypass-python-sandboxes/index.html#accessing-subclasses-with-bypassesarrow-up-right

The word read was blocked, but we can use communicate method as long as we have stdout/stderr with subprocess.PIPE value which is just -1.

Writeup-1.png

SSH (22)

We are app-production user and if you check ls /home you can find this user has a home directory, meaning we should be able to SSH with this user.

User.txt

Privilege Escalation (martin)

Application which we just attacked has a database with users

Writeup-2.png
Hash
Type
Result

759b74ce43947f5f4c91aeddc3e5bad3

md5

development

3de6f30c4a09c27fc71932bfc68474be

md5

nafeelswordsmaster

martin is the valid user on box

Privilege Escalation (root)

Example task.json cant be found in home directory

updated_json prevents directory traversal by replacing ../ with nothing, but if we do ....// it becomes ../ and directory traversal is complete.

Root.txt

Login as root

SSH key exists and we can use it for login

Last updated