Windows Log Analysis - Determine Attacker Technique

Un-redact that thing!

Instructions from the badge:

Using these normalized Sysmon logs, identify the tool the attacker used to retrieve domain password hashes from the lsass.exe process. For hints on achieving this objective, please visit Hermey Hall and talk with SugarPlum Mary.

Link to the SysMon logs and below you can see some sample data:

{
    "command_line": "cmd.exe /c echo besewi > \\\\.\\pipe\\besewi",
    "event_type": "process",
    "logon_id": 999,
    "parent_process_name": "services.exe",
    "parent_process_path": "C:\\Windows\\System32\\services.exe",
    "pid": 3812,
    "ppid": 616,
    "process_name": "cmd.exe",
    "process_path": "C:\\Windows\\System32\\cmd.exe",
    "subtype": "create",
    "timestamp": 132186397959850000,
    "unique_pid": "{7431d376-deb3-5dd3-0000-001096a84f00}",
    "unique_ppid": "{7431d376-cd7f-5dd3-0000-001010910000}",
    "user": "NT AUTHORITY\\SYSTEM",
    "user_domain": "NT AUTHORITY",
    "user_name": "SYSTEM"
}

Technical Challenge

To get some further hints for solving this challenge, you are told to talk with SugarPlum Mary in Hermey Hall. She is ready to give you some advice, as long as you help her first with an issue she is having with her terminal:

SugarPlum Mary

Oh me oh my - I need some help! I need to review some files in my Linux terminal, but I can’t get a file listing. I know the command is ls, but it’s really acting up. Do you think you could help me out? As you work on this, think about these questions:

  1. Do the words in green have special significance?
  2. How can I find a file with a specific name?
  3. What happens if there are multiple executables with the same name in my $PATH?

When you click to view her terminal you get the following information:

K000K000K000KK0KKKKKXKKKXKKKXKXXXXXNXXXX0kOKKKK0KXKKKKKKK0KKK0KK0KK0KK0KK0KK0KKKKKK
00K000KK0KKKKKKKKKXKKKXKKXXXXXXXXNXXNNXXooNOXKKXKKXKKKXKKKKKKKKKK0KKKKK0KK0KK0KKKKK
KKKKKKKKKKKXKKXXKXXXXXXXXXXXXXNXNNNNNNK0x:xoxOXXXKKXXKXXKKXKKKKKKKKKKKKKKKKKKKKKKKK
K000KK00KKKKKKKKXXKKXXXXNXXXNXXNNXNNNNNWk.ddkkXXXXXKKXKKXKKXKKXKKXKKXK0KK0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in my home/
To check on project logos
But what I see with ls there,
Are quotes from desert hobos...
which piece of my command does fail?
I surely cannot find it.
Make straight my path and locate that-
I'll praise your skill and sharp wit!
Get a listing (ls) of your current directory.

elf@b0b213fcf787:~$ ls
This isn't the ls you're looking for

elf@b0b213fcf787:~$ which ls   
/usr/local/bin/ls

elf@b0b213fcf787:~$ /bin/ls         << call the original ls directly to solve it
' '   rejected-elfu-logos.txt
Loading, please wait......
You did it! Congratulations!

A rather simple solution, but don’t worry, it will get a bit harder as you progress… Now, if you go back and click on Mary a few times, she will reveal the hints for solving this objective:

Oh there they are! Now I can delete them. Thanks! Have you tried the Sysmon and EQL challenge? If you aren’t familiar with Sysmon, Carlos Perez has some great info about it. Haven’t heard of the Event Query Language? Check out some of Ross Wolf’s work on EQL or that blog post by Josh Wright in your badge.

Link for EQL: https://www.endgame.com/our-experts/ross-wolf

Main Objective

While the provided hint about EQL was interesting, I could not directly use it to solve this challenge. Instead I went on a different route. Since the goal is to identify a tool being used to extract password hashes from lsass.exe, I parsed the JSON file with the Sysmon logs with jq and then filtered for the command_line looking for .exe files.

$ cat sysmon-data.json | jq '.[].command_line' | grep '.exe' | uniq | wc -l
196

196 is still rather large number to try, so then I decided to search on the net for extracting domain password and one of the first few articles pointed me to a utility called NTDS. I searched for this in the logs and the answer presented itself right away: ntdsutil which is the solution for Objective #4:

$ cat sysmon-data.json | jq '.[].command_line' | grep 'ntdsutil.exe'
  "ntdsutil.exe  \"ac i ntds\" ifm \"create full c:\\hive\" q q"
Previous
Next