Foreword
I participated in Insomni’hack 23 with NUS Greyhats. We managed to get 12th place. I was in the Lunar New Year celebration mode and basically got carried by the team. I only look at one challenge in the Forensics category. I did not manage to solve it, but I will document (briefly) how we do to obtain the solution.
Challenges
Autopsy
Big kudos to IDissEverything of NUS Greyhats for solving this. The writeup is from asking him how to solve the challenge, as I did not manage to solve the challenge (me very noob).
We are given the pcap
file recording the network activity of the attacker during the exploitation phase of some Active Directory. Observing the pcap
, we can see that there is some DCERPC
traffic, and some system files like ntds.dit
(which is pivotal in dumping user hashes on the system for lateral movement and other exploitation), SYSTEM
and SECURITY
hives are transferred over the network using HTTP.
We can obtain the object transferred to the attacker by doing File > Export Objects > HTTP
. Trying to do the task by following the TCP flow will not lead to anything, and the output will contain the headers of the HTTP portion. Also, to get the actual files, we have to sort by size in descending order (as it is more likely that the full file is transferred, and not some fragments). We should be able to dump out ntds.dit
from the logs.
Using Impacket, we can dump out the ntds.dit
hashes and Kerberos keys.
|
|
This Medium article should mention how to decrypt Kerberos/NTLM encrypted traffic using Wireshark. We have to generate the keytab first, and we are provided the script from the article. Note that RC4
in the “keys” portion refer to NTLM hash (and also it would be clearer after looking at the article). The following is the full Python script to generate the keytab:
|
|
Run this by doing python3 <name of script file>.py <output file>
. Importing the keytab to Wireshark, and we should be able to see the flag in the Wireshark taskschedulerservice
filtered output.
