OnlyForYou

Recon

nmap_scan.log

HTTP (80)

Writeup.png

The application has no links going anywhere, so most probably nothing with dirbusting. Subdomain enumeration returns new domain:

Writeup-1.png

We can download the source. From frontend we know that application allows to resize images and convert them.

In app.py the download functionality is vulnerable to LFI. RTFM, and Python's os.path.joinarrow-up-right

After some fuzzing we discover the path for application on server.

The piece of code is vulnerable to code execution, it's running as shell and it has no sanitization!

Regular expression is bypassable if we put our payload at the end:

There are some internal applications running.

The user www-data doesn't have shell, so no SSH upgrade. I decided to upgrade nc to pwncat-cs.

We can use chisel to port forward the applications

3000 is Gogs, which seems to be Gitea alternative. No creds... moving on.

Writeup-2.png

8001 is server ONLY4YOU application, trying default credentials logs us in.

Writeup-3.png

Creds: admin:admin

The Tasks mentioned migrating to neo4j, we also saw this port with user. The /search most likely performs contains query for Name field.

Writeup-4.png

https://book.hacktricks.xyz/pentesting-web/sql-injection/cypher-injection-neo4jarrow-up-righthttps://www.varonis.com/blog/neo4jection-secrets-data-and-cloud-exploitsarrow-up-righthttps://hackmd.io/@Chivato/rkAN7Q9NYarrow-up-right

Query is injectable, but it's not your typical SQL. Cypher has very different syntax compared to SQL.

Writeup-5.png

Get the server version query works.

The page returns 500, but clearly the request with version information is made to us.

Writeup-6.png

Get tables (or labels)

Get columns (or keys)

Writeup-7.png

Creds: admin:admin Creds: john:ThisIs4You

SSH (22)

We are now available to SSH as john in to the box.

User.txt

Privilege Escalation

We are able to login into Gogs on port 3000 with john's credentials, if we can create malicious python package we can get RCE.

Malicious Python Packages and Code Execution via pip downloadarrow-up-right

Upload this tar.gz to new Public repository, or edit the existing Test project to be public. After uploading we need to provide raw url so file can be downloaded.

Root.txt

Last updated