Santi 'Log


Alarms by type
Tue, 06 Oct 2009

I want to share a new graph I have done for OSSIM "Executive Panel". It shows most generated alarms in a radar. I hope you will find it useful.



To create it just edit a graph, go to "Category -> Config Import" and paste the following:

plugin_custom_sql:: YTo0OntzOjY6InBsdWdpbiI7czoyMjoicGx 1Z2luX2NvbmZpZ19leGNoYW5nZSI7czoxMT oicGx1Z2luX29wdHMiO2E6Mjc6e3M6ODoiZ 3JhcGhfZGIiO3M6NToib3NzaW0iO3M6OToi Z3JhcGhfc3FsIjtzOjI0NDoic2VsZWN0IEN PTkNBVChTVUJTVFJJTkcoUkVQTEFDRShwbH VnaW5fc2lkLm5hbWUsImRpcmVjdGl2ZV9ld mVudDogIiwiIiksMSwxNyksIi4uLiIpLCBj b3VudCgqKSBhcyBudW0gZnJvbSBhbGFybSw gcGx1Z2luX3NpZCAKd2hlcmUgYWxhcm0ucG x1Z2luX2lkID0gcGx1Z2luX3NpZC5wbHVna W5faWQgYW5kIAphbGFybS5wbHVnaW5fc2lk ID0gcGx1Z2luX3NpZC5zaWQKZ3JvdXAgYnk gYWxhcm0ucGx1Z2luX3NpZCBsaW1pdCA4Oy I7czoxMToiZ3JhcGhfdGl0bGUiO3M6MDoiI jtzOjEwOiJncmFwaF90eXBlIjtzOjU6InJh ZGFyIjtzOjE4OiJncmFwaF9sZWdlbmRfZml lbGQiO3M6Mzoicm93IjtzOjE2OiJncmFwaF 9wbG90c2hhZG93IjtzOjE6IjEiO3M6MTU6I mdyYXBoX3BpZV90aGVtZSI7czo1OiJ3YXRl ciI7czoxNzoiZ3JhcGhfcGllXzNkYW5nbGU iO3M6MjoiNDUiO3M6MTc6ImdyYXBoX3BpZV 9leHBsb2RlIjtzOjM6ImFsbCI7czoyMToiZ 3JhcGhfcGllX2V4cGxvZGVfcG9zIjtzOjE6 IjEiO3M6MjI6ImdyYXBoX3BpZV9hbnRpYWx pYXNpbmciO3M6MToiMSI7czoxNjoiZ3JhcG hfcGllX2NlbnRlciI7czo0OiIwLjIzIjtzO jE4OiJncmFwaF9wb2ludF9sZWdlbmQiO3M6 MDoiIjtzOjE3OiJncmFwaF9zaG93X3ZhbHV lcyI7czoxOiIwIjtzOjExOiJncmFwaF9jb2 xvciI7czo3OiIjMDAwMDgwIjtzOjE0OiJnc mFwaF9ncmFkaWVudCI7czoxOiIwIjtzOjEw OiJncmFwaF9saW5rIjtzOjA6IiI7czoxNjo iZ3JhcGhfcmFkYXJfZmlsbCI7czoxOiIxIj tzOjExOiJncmFwaF95X21pbiI7czoxOiIwI jtzOjExOiJncmFwaF95X21heCI7czoxOiIw IjtzOjExOiJncmFwaF94X21pbiI7czoxOiI wIjtzOjExOiJncmFwaF94X21heCI7czoxOi IwIjtzOjExOiJncmFwaF95X3RvcCI7czoxO iIwIjtzOjExOiJncmFwaF95X2JvdCI7czox OiIwIjtzOjExOiJncmFwaF94X3RvcCI7czo xOiIwIjtzOjExOiJncmFwaF94X2JvdCI7cz oxOiIwIjtzOjE1OiJleHBvcnRlZF9wbHVna W4iO3M6MTc6InBsdWdpbl9jdXN0b21fc3Fs Ijt9czoxMToid2luZG93X29wdHMiO2E6Mzp 7czoyOiJpZCI7czozOiIxeDMiO3M6NToidG l0bGUiO3M6MTQ6IkFsYXJtcyBieSBUeXBlI jtzOjQ6ImhlbHAiO3M6MDoiIjt9czoxMToi bWV0cmljX29wdHMiO2E6NDp7czoxNDoiZW5 hYmxlX21ldHJpY3MiO3M6MToiMCI7czoxMD oibWV0cmljX3NxbCI7czowOiIiO3M6MTM6I mxvd190aHJlc2hvbGQiO2k6MDtzOjE0OiJo aWdoX3RocmVzaG9sZCI7aTowO319

And, on the other hand, if you are curious about the SQL query, here it is:

select CONCAT(SUBSTRING(REPLACE(plugin_sid.name,"directive_event: ",""),1,17),"..."), count(*) as num from alarm, plugin_sid where alarm.plugin_id = plugin_sid.plugin_id and alarm.plugin_sid = plugin_sid.sid group by alarm.plugin_sid limit 8;

posted at: 14:59 | path: /ossim/configs | permanent link to this entry | 0 comments |



Detecting ASN.1 buffer overflow attack
Tue, 08 Sep 2009

Introduction

I am posting for the first time at my recently opened blog. Hope issues discussed here will be interesting for OSSIM users and probably for some other people.

First thing I will try to explain is how to test OSSIM generating real time attacks, such as exploiting a buffer overflow against a non patched host. For this purpose we will use Micrososft ASN.1 library buffer overflow vulnerability, whose details can be found at http://www.phreedom.org/solar/exploits/msasn1-bitstring/ We can even find here an exploit called kill-bill to take advantage of the mentioned vulnerability ;-)

Now lets see steps in order to get an alarm with OSSIM and execute an action-response policy...

OSSIM configuration

1.- Detecting the intrusion with snort rules. In this case it's done by the rule "NETBIOS SMB Session Setup NTMLSSP unicode asn1 overflow attempt". I paste it here, copied from the /etc/snort/rules/netbios.rules file:

netbios.rules:alert tcp $EXTERNAL_NET any -> $HOME_NET 139 (msg:"NETBIOS SMB Session Setup NTMLSSP unicode asn1 overflow attempt"; flow:established,to_server; content:"|00|"; depth:1; content:"|FF|SMBs"; within:5; distance:3; byte_test:1,&,128,6,relative; pcre:"/^.{27}/R"; byte_test:4,&,2147483648,21,relative,little; content:!"NTLMSSP"; within:7; distance:27; asn1:double_overflow, bitstring_overflow, relative_offset 27, oversize_length 2048; reference:bugtraq,9633; reference:bugtraq,9635; reference:cve,2003-0818; reference:nessus,12052; reference:nessus,12065; reference:url,www.microsoft.com/technet/security/bulletin/MS04-007.mspx; classtype:protocol-command-decode; sid:3000; rev:4;)

2.- Next step is to create a simple directive to feed the correlation engine. It can be done at /etc/ossim/server/generic.xml. The one I have created is:

<directive id="24" name="Buffer overflow attempt against DST_IP" priority="9">
   <rule type="detector" name="Buffer overflow rule matched" reliability="9"
   occurrence="1" from="ANY" to="ANY" port_from="ANY" port_to="ANY"
   plugin_id="1001"
   plugin_sid="2383"/>
</directive>

This is the simplest form of a directive, but if we want, we can use different levels to detect more complex attacks (i.e. we can add rules matching port scans or session duration...). Here is an example of a port scan with an open port found directive (I also use it for the video demo you will find below):

<directive id="25" name="TCP Portscan against DST_IP" priority="6">
   <rule type="detector" name="TCP Portscan" reliability="5"
   occurrence="1" from="ANY" to="ANY" port_from="ANY" port_to="ANY"
   plugin_id="1122"
   plugin_sid="1">
      <rules>
         <rule type="detector" name="portscan: Open Port" reliability="+3"
         occurrence="1" from="1:SRC_IP" to="1:DST_IP" port_from="ANY" port_to="ANY"
         plugin_id="1122"
         plugin_sid="27"/>
      </rules>
   </rule>
</directive>

3.- Last thing is to configure an action (for example sending a mail) to execute when the alarm is generated. We can use the web framework to do it in a easy way.

Video demo

Well, at the end, I have decided to upload a video demo which has been made as a proof of concept of all I have been talking before. Its duration is 10:33, it has no sound but I think it's quite self explanatory. Hope you will enjoy it.


This text will be replaced

posted at: 11:09 | path: /ossim/tests | permanent link to this entry | 8 comments |



Collecting events with rsyslog
Tue, 08 Sep 2009

This article tries to be a small how-to about OSSIM events collection using rsyslog. For example lets try to configure OSSIM to collect events from a Netscreen firewall.

OSSIM agent

  1. First of all we need to active the plugin at /etc/ossim/agent/config.cfg adding a new line to our plugins list. This line could be like the following:
    netscreen=/etc/ossim/agent/plugins/netscreen-firewall.cfg
  2. Then we will set the "location" variable at the config file of the plugin we want to use. In our case this file will be at /etc/ossim/agent/plugins/netscreen-firewall.cfg (other config files can be found here too). For example lets set it this way:
    location=/var/log/netscreen-firewall.log
  3. Once finished other two steps don't forget to restart the ossim-agent daemon, so it will load the new configuration.
    /etc/init.d/ossim-agent restart

Rsyslog

Then it's time to go through rsyslogd configuration.


  1. To enable logging from remote machines we have to edit /etc/default/syslogd and set SYSLOGD variable to "-r". This line should be enough:
    SYSLOGD="-r"
  2. Then, to use rsyslog v3 native interface (I am not sure if this is needed, but just in case), we will need to set RSYSLOGD_OPTIONS variable to "-c3" at /etc/default/rsyslog file.
    RSYSLOGD_OPTIONS="-c3"
  3. Now lets edit the /etc/rsyslog.conf file. For our example I will add this lines at the beginning of the logging rules. Be aware of the comments to know what does they do.
    # Line 1: Discard logs with "action=Permit" string
    # This is just tuning, as this kind of logs are useless for our security system (as they are accepted by the firewall policy)
    :msg, contains, "action=Permit" ~

    # Line 2: If coming from "netscreen_hostname" (at /etc/hosts) send logs to /var/log/netscreen-firewall.log
    # The symbol "-" means that it wont sync every log (faster)
    :fromhost, isequal, "netscreen_hostname" -/var/log/netscreen-firewall.log

    # Line 3: Then discard all logs coming from "netscreen_hostname" so they wont be written at system log files.
    :fromhost, isequal, "netscreen_hostname" ~

    #... standard logging rules should go right here ...

    If you need more help with rsyslog.conf possibilities you can find it at: http://www.rsyslog.com/doc-rsyslog_conf_filter.html


  4. At last we just need to restart rsyslogd daemon
  5. /etc/init.d/rsyslogd restart

At this point it should be listening at port 514 (the default one), you can check it with netstat command. So, once we configure our device to send logs to our OSSIM sensor, they should be collected and correlated.


As you can see this how-to is quite simple, but I hope it can help you with your configurations or help me to remember it if needed.


Regards.

posted at: 10:55 | path: /ossim/configs | permanent link to this entry | 0 comments |



OSCON '09 submittal - Maybe next year
Sat, 07 Mar 2009

Introduction

I want to announce that there is a proposal I have done for an OSSIM workshop at the Open Source Convention this year in San Jose, California. This event will take place on 20-24 July. As it is still under review I am not completely sure about our presence there, nevertheless I am glad to share with you the submittal I have done.

OSCON website: http://en.oreilly.com/oscon2009/

On the other hand, if anybody has an interesting event going on anywhere regarding infosec, where OSSIM would fit, please drop me a letter at santiago@ossim.com, we can study a talk there.

OSSIM workshop proposal for OSCON '09

OSSIM stands for Open Source Security Information Management. It is a security system made up by the compilation of more than 15 well known tools at the Open Source field. Its goal is, based on data correlation, to provide a centralized console with all necessary information for attacks and anomalies detection, forensic analysis, policies definition and risks assessment. It also has a high level visualization interface as well as reporting and incidents managing tools.

The main idea is to do a 3 hours technical tutorial explaining the system architecture and functionalities and see it working in real time with different usage cases. To achieve this goal, I propose to follow this small index:

1.- Brief introduction of the tutorial (10 minutes).

2.- OSSIM explanation:

  • System architecture (10 min)
  • Components and their functionalities (10 min)
  • Data collection, correlation engine and policies definition (10 min)

3.- Usage cases: In order to test OSSIM features we will launch some common attacks in a virtual scenario using VMware. This way we will see real time detection, based on the correlation engine, and perform low level forensics analysis to understand as much as possible about the attack method used and its behavior.

  • Brute force attacks against Unix and Microsoft environments (10 min)
  • Buffer overflow exploits using metasploit and shellcode analysis (15 min)
  • Detecting network scans based on anomalies preprocessor (10 min)
  • Worm propagation attempt (15 min)
  • Denial of Service attack (10 min)
  • Security policies violation (10 min)
  • Network behavior real time visualization (15 min)

4.- OSSIM deployment in real networks (15 min)

5.- Honeypots data collection and correlation (20 min)

6.- Questions and others (20 min)

Tools we are going to use:

  • VMware Server
  • OSSIM (virtual machine)
  • Backtrack 3 Linux distribution (virtual machine)
  • Windows XP Pro (virtual machine)
  • Nepenthes (virtual machine)

Example: If you want to see an attack (detected with OSSIM) example video, you can check it at my blog at http://www.alienvault.com/blog/santiago/ossim/tests/index. At the conference we will explain in depth similar usage cases, so attenders will understand how to take advantage of this security system.

More info about OSSIM at: http://www.ossim.net

Confirmation

When I get an answer from OSCON people I will update this post to confirm that this workshop will really take place. And, by the way, if there is OSSIM presence in some other event please feel free to post your comments to let us know.

At last we won't be at OSCON '09

I am sorry to say that we won't be at the OSCON as they are at full capacity this year. Quoting them: "The response to our Call for Proposals was overwhelming, and we received far more than we can possibly accomodate in the program."

Nevertheless we have planned some other conferences during next months so there will be new entries at the blog announcing them :-)

posted at: 16:50 | path: /ossim/events | permanent link to this entry | 0 comments |
Tags: ossim, conference, oscon



Categories

/ (4)
    ossim/ (4)
        configs/ (2)
        events/ (1)
        tests/ (1)



Santiago Gonzalez
(feel free to get in touch)
  • Mail
  • Linkedin
  • Forums

Friend's blogs:
  • /blog/dk
  • /blog/juanma
  • /blog/jaime




RSS




< October 2009
MoTuWeThFrSaSu
    1 2 3 4
5 6 7 8 91011
12131415161718
19202122232425
262728293031 




Archives

2009-Oct
2009-Sep
2009-Mar




Tags

untagged




Made with PyBlosxom