> I can see something like this in my ossec /var/ossec/logs/alerts
> alerts.log .
>
> ** Alert 1447389519.1118: mail - web,accesslog,attack,
> 2015 Nov 13 12:38:39 ********->/var/log/httpd/access_log
> Rule: 31106 (level 6) -> 'A web attack returned code 200 (success).'
> Src IP: 10.212.*****
> 10.212.******* - - [13/Nov/2015:12:37:49 +0800] "POST
> /*********/****.php?..."
>
>
> In my active-responses.log I can see this.
>
> Fri Nov 13 12:38:40 MYT 2015 /var/ossec/active-response/bin/host-deny.sh add
> - 10.212.*****1447389519.1118 31106
> Fri Nov 13 12:38:40 MYT 2015 /var/ossec/active-response/bin/firewall-drop.sh
> add - 10.212.****** 1447389519.1118 31106
>
>
> So the only way to relate both the logs is it via the rule number 31106? So
Yes, you should match up the rule id, the source ip, and the
timestamps (there will probably be a few seconds difference in the
TS).
> this rule also relate to post activity ?
>
No clue. Let's look:
<rule id="31106" level="6">
<if_sid>31103, 31104, 31105</if_sid>
<id>^200</id>
<description>A web attack returned code 200 (success).</description>
<group>attack,</group>
</rule>
So this rule requires a 200 response from the webserver, and traffic
that triggers 31103, 31104, or 31105. What do those rules look for?
Let's find out:
<rule id="31103" level="6">
<if_sid>31100,31108</if_sid>
<url>=select%20|select+|insert%20|%20from%20|%20where%20|union%20|</url>
<url>union+|where+|null,null|xp_cmdshell</url>
<description>SQL injection attempt.</description>
<group>attack,sql_injection,</group>
</rule>
So this rule is looking for something sql related, hoping to catch
sqli. Does that apply to the POST you see (it's obfuscated beyond my
ability to decode)?
If not, let's try 31104:
<rule id="31104" level="6">
<if_sid>31100</if_sid>
<!-- Attempt to do directory transversal, simple sql injections,
- or access to the etc or bin directory (unix). -->
<url>%027|%00|%01|%7f|%2E%2E|%0A|%0D|../..|..\..|echo;|</url>
<url>cmd.exe|root.exe|_mem_bin|msadc|/winnt/|/boot.ini|</url>
<url>/x90/|default.ida|/sumthin|nsiislog.dll|chmod%|wget%|cd%20|</url>
<url>exec%20|../..//|%5C../%5C|././././|2e%2e%5c%2e|\x5C\x5C</url>
<description>Common web attack.</description>
<group>attack,</group>
</rule>
Ok, so directory traversal. It's an oldie, but a goodie. Again, the
log sample you posted is too obfuscated for me to be able to tell if
this applies. But you should be able to see if those patterns in the
<url> options are in the POST.
Since it's still not clear, we'll peek at 31105:
<rule id="31105" level="6">
<if_sid>31100</if_sid>
<url>%3Cscript|%3C%2Fscript|script>|script%3E|SRC=javascript|IMG%20|</url>
<url>%20ONLOAD=|INPUT%20|iframe%20</url>
<description>XSS (Cross Site Scripting) attempt.</description>
<group>attack,</group>
</rule>
Ooooh, XSS. Fun stuff. You can look at the <url> options to see if
those apply to your POST.
If none of these apply, we'll need to see the actual log message to
determine what's going on (you can even send it off list to me, but
make sure you tell me that's what you're doing at the beginning of the
email so I don't get too confused.).
Once you've determined why these rules are firing, you can start to
tune your rules to allow this behavior (if it's not malicious).