Good Morning,
I am trying to create a transaction that will search my logs for hosts that perform the following:
So far I have something like:
LogType=Mylogs | transaction host startswith=CreatorProcessName="WINWORD" endswith=BaseFileName="chrome.exe"
With the above command, I am about to see hosts that have opened a Word document and ended by opening a chrome browser, however, I am unable to see that the host met all 4 actions of (1) opening Word (2) opening a command prompt (3) opening a chrome browser (4) opening another chrome browser. How do I edit my search to also include the actions in between, number 2 and 3?
Thanks
Ditch transaction and try this:
LogType=Mylogs | streamstats current=t count(eval(BaseFileName="powershell.exe")) AS SessionID by host | sort host SessionID
Or this (should be synonymous if every event has a proper start and end event):
LogType=Mylogs | reverse | streamstats current=t count(eval(CreatorProcessName="WINWORD")) AS SessionID by host | sort host SessionID
Thanks so much for your reply. I am not as familiar with the streamstats command so I will have to study it more. I am also not sure I explained things correctly. What I am trying to do is detect any hosts that may have been infected with PowerWare ransomeware. I know that this host activity may include opening a Word document, which has an embedded macro to execute the command prompt. After which, there are two instances of powershell that are executed.
What I am trying to do is detect when a user opens a Word doc, gets a command prompt, and then two instances of powershell. I was able to come up with this:
LogType=WindowsEventLog OR LogType=WLS | transaction host startswith=CreatorProcessName="WINWORD" endswith=BaseFileName="powershell.exe"
However, the above doesn't specify the cmd.exe or the second instance of Powershell. If someone were to actually execute this PowerRare, I believe my alert will catch it, but it lacks the specification to include all of those events specifically.
Thanks,
Janice
I re-edited my answer to give 2 options for the same thing. I think the one with reverse
will help you best. You can also tack on to the end of each command this, which will probably help you even more (it will create many multi-value fields):
... | stats values(*) AS * BY SessionID host
Then you can tack on something like this:
... | search CreatorProcessName="WINWORD"
So my suggested complete solution is this:
LogType=Mylogs | streamstats current=t count(eval(BaseFileName="powershell.exe")) AS SessionID by host | sort host SessionID | stats values(*) AS * BY SessionID host | search CreatorProcessName="WINWORD"
Thanks so much for your help!
So did it work out?
I still didn't get it to work out for me. I entered the following, ran the test file and didn't get any alert. However, I just decided to use the basic transaction one that I initially made which will alert me if two of the requirements are met, but I will just have to follow up with additional analysis. Thanks for your help!
LogType=Mylogs | streamstats current=t count(eval(BaseFileName="powershell.exe")) AS SessionID by host | sort host SessionID | stats values(*) AS * BY SessionID host | search CreatorProcessName="WINWORD" | search BaseFileName="cmd.exe"