Skip to content

Conversation

JakePeralta7
Copy link
Contributor

Added detection of clearing event logs with functions from wevtapi.dll, these functions can also be used remotely after a session is established with RPC using the EvtOpenSession function.

Reference Code:
getel-arch/ClearLogsRemotely

Copy link
Collaborator

@williballenthin williballenthin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

Initially I was unsure if the name "... remotely" was appropriate, but as I look at some examples and the API documentation, I see that NULL would be provided instead of the session, so requiring EvtOpenSession is great here.

@williballenthin
Copy link
Collaborator

williballenthin commented Feb 22, 2025

for example here is WSReset.exe, which clears a local log:
image

it imports only EvtClearLog, not any of the other routines.

so here's a VT search for local clearing: https://www.virustotal.com/gui/search/imports%253AEvtClearLog%2520and%2520not%2520imports%253AEvtOpenSession?type=files

and likely remote clearing: https://www.virustotal.com/gui/search/imports%253AEvtClearLog%2520and%2520imports%253AEvtOpenSession?type=files (very few hits aside from wevtutil)

@JakePeralta7
Copy link
Contributor Author

JakePeralta7 commented Feb 22, 2025

Sorry about all of the mess in the commits, it's my first time writing a CAPA rule and I'm not used to your workflows

@williballenthin
Copy link
Collaborator

no worries! I appreciate the patience. and I'll squash merge so the history ends up clean.

really neat that you took the time to submit a rule after developing the POC. i hope we can continue to work together :-)

@williballenthin williballenthin merged commit 9c86fbe into mandiant:master Feb 22, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants