On Fri, Apr 22, 2016 at 11:50 AM, Rob B <
rba...@netorian.com> wrote:
> dan,
>
> I have this from the alerts log:
>
> ** Alert 1461339927.2762520: - windows,system_error,
> 2016 Apr 22 08:45:27 (VICTIM0) 10.0.1.100->WinEvtLog
> Rule: 18103 (level 5) -> 'Windows error event.'
> User: cuckoo
> 2016 Apr 22 11:46:32 WinEvtLog: Microsoft-Windows-AppLocker/EXE and DLL:
> ERROR(8004): Microsoft-Windows-AppLocker: user:
VICTIM0.domain.com:
> \\10.0.1.10\SHARE\MALWARE_FOR_DEMO\PSCP.EXE was prevented from running.
>
Ok, so I installed 2.8.3 and here is what a vanilla 2.8.3's
ossec-logtest gives us for this log message:
**Phase 1: Completed pre-decoding.
full event: '2016 Apr 22 11:46:32 WinEvtLog:
Microsoft-Windows-AppLocker/EXE and DLL: ERROR(8004):
Microsoft-Windows-AppLocker: user:
VICTIM0.domain.com:
\\10.0.1.10\SHARE\MALWARE_FOR_DEMO\PSCP.EXE was prevented from
running.'
hostname: 'ipyr'
program_name: '(null)'
log: '2016 Apr 22 11:46:32 WinEvtLog:
Microsoft-Windows-AppLocker/EXE and DLL: ERROR(8004):
Microsoft-Windows-AppLocker: user:
VICTIM0.domain.com:
\\10.0.1.10\SHARE\MALWARE_FOR_DEMO\PSCP.EXE was prevented from
running.'
**Phase 2: Completed decoding.
decoder: 'windows'
**Phase 3: Completed filtering (rules).
Rule id: '18100'
Level: '0'
Description: 'Group of windows rules.'
Unfortunately it doesn't decode the status field, and triggers 18100
instead of 18103.
Adding the following decoder gets me to the same point you're at:
<decoder name="windows-applocker">
<parent>windows</parent>
<type>windows</type>
<prematch>WinEvtLog: Microsoft-Windows-AppLocker</prematch>
<regex offset="after_prematch">: (ERROR)\p(\d+)</regex>
<order>status,id</order>
</decoder>
Notice that the status field will be "ERROR" and the id field will be
"8004." The logtest follows, with the final rule after that.
logtest:
**Phase 1: Completed pre-decoding.
full event: '2016 Apr 22 11:46:32 WinEvtLog:
Microsoft-Windows-AppLocker/EXE and DLL: ERROR(8004):
Microsoft-Windows-AppLocker: user:
VICTIM0.domain.com:
\\10.0.1.10\SHARE\MALWARE_FOR_DEMO\PSCP.EXE was prevented from
running.'
hostname: 'ipyr'
program_name: '(null)'
log: '2016 Apr 22 11:46:32 WinEvtLog:
Microsoft-Windows-AppLocker/EXE and DLL: ERROR(8004):
Microsoft-Windows-AppLocker: user:
VICTIM0.domain.com:
\\10.0.1.10\SHARE\MALWARE_FOR_DEMO\PSCP.EXE was prevented from
running.'
**Phase 2: Completed decoding.
decoder: 'windows'
status: 'ERROR'
id: '8004'
**Phase 3: Completed filtering (rules).
Rule id: '18103'
Level: '5'
Description: 'Windows error event.'
**Alert to be generated.
So I modified the rule you posted like so:
<rule id="100046" level="12">
<if_sid>18103</if_sid>
<status>ERROR</status> <!-- The status will be ERROR -->
<id>^8004$</id> <!-- Windows decoders seem to prefer
id for this type of info -->
<description>AppLocker - blocked program.</description>
</rule>
Using that rule gives me the following output:
**Phase 1: Completed pre-decoding.
full event: '2016 Apr 22 11:46:32 WinEvtLog:
Microsoft-Windows-AppLocker/EXE and DLL: ERROR(8004):
Microsoft-Windows-AppLocker: user:
VICTIM0.domain.com:
\\10.0.1.10\SHARE\MALWARE_FOR_DEMO\PSCP.EXE was prevented from
running.'
hostname: 'ipyr'
program_name: '(null)'
log: '2016 Apr 22 11:46:32 WinEvtLog:
Microsoft-Windows-AppLocker/EXE and DLL: ERROR(8004):
Microsoft-Windows-AppLocker: user:
VICTIM0.domain.com:
\\10.0.1.10\SHARE\MALWARE_FOR_DEMO\PSCP.EXE was prevented from
running.'
**Phase 2: Completed decoding.
decoder: 'windows'
status: 'ERROR'
id: '8004'
**Phase 3: Completed filtering (rules).
Rule id: '100046'
Level: '12'
Description: 'AppLocker - blocked program.'
**Alert to be generated.