Dodge pod people armed with winPEAS.bat

 

Been a while since I've updated this, figured I might as well post some of my findings looking at logs generated by Windows privilege escalation discovery frameworks, in this case winPEAS (Windows Privilege Escalation Awesome Script).

So far I've only looked at the resulting logs generated by running the .bat file implementation, I'll chuck up another couple of blogs as I work my way through the pre-compiled executable version, then dazzleUP and Watson.

winPEAS is really comprehensive, it provides a lot of information about the host it is run on, patching and security updates, potential avenues for exploitation, existing services, file and directory permissions, etc. As a result of this though, it is very noisy in logs.

To retrieve service information winPEAS makes use of the windows executable sc.exe with the "qc" command. A full run of winPEAS.bat resulted in around 250 sc qc queries on my test VM, we can hunt for this:





Obviously replace the index with wherever your Windows event logs are going to within Splunk and consider putting a "where" in with a high threshold say > 50 to filter on. SPL is below.

 

index=winlogs  Creator_Process_Name=*\\cmd.exe New_Process_Name="*\\sc.exe" Process_Command_Line IN (*qc*)

| stats count(Process_Command_Line) AS sc-number min(_time) as earliest max(_time) as latest values(Process_Command_Line) AS Process_Command_Line BY Account_Name

| convert ctime(earliest) ctime(latest)

| table Account_Name sc-number earliest latest Process_Command_Line
 
That is a hunt for just one of the executables winPEAS calls, more detections coming soon.

Popular posts from this blog

Fastening the Seatbelt on.. Threat Hunting for Seatbelt

Capturing Pcap driver installations

Microsoft Defender, Find User Ignored Threats With Splunk