Signature Analytics – The Tao Series (continues…)

0

Posted by Signature Analyst | Posted in Analysis, Introduction | Posted on 28-08-2010

Hey guys,

Tough times helped us catch up with other stuff. Soon(in a week or 2 at max), I will continue writing the Tao Series on Signature Analytics like I used to. I am sure that there is a lot to catch up to, but for sure we would do something cool really soon. I was also planning on releasing EmergingThreats (Semi)Automated Signature Generation Engine (which got delayed due to circumstances[my ADHD :) and of course I get distracted easily]) very soon. Kevin Ross would be helping me with the logic that he has in mind, and certain others would also be helping in the process. If you would like to contribute, feel free to let us know and we would work it out based on your liking.

Also, someone from 66.128.17.136 (Austin, TX) attempted over 400 SQL injection attempts in 1 minute and 35 seconds and went idle after that. Don’t know if it was for self-satisfaction or just a test round. It could have been a compromised host too. This IP belongs to Electric Reliability Council of Texas, Inc., and to me it sounds more like a compromised host. I will keep you posted either way and you guys should definitely feel free to give me your comments. In that way, I would know that I am not writing this for myself :) . Thanks again guys!

EF

The Tao Series – Structure

0

Posted by Signature Analyst | Posted in Analysis, Introduction, Signatures | Posted on 12-02-2010

Now that 3rd out of the 10 part series has been written, I would like to discuss more about the structure of the entire series and how we would be proceeding further.

  • Part 1. Introduction
  • Part 2. Mindset of Signature Writers
  • Part 3. Web Application Signature writing
  • Part 4. ActiveX Signatures based on CLSID’s
  • Part 5. Framework based Signatures
  • Part 6. Anomaly based Signatures
  • Part 7. Policy-based Signatures
  • Part 8. Semi-automating signature writing – Hands On
  • Part 9. Signature Testing
  • Part 10. Concluding the Series

Send me your views, opinion, comments and criticisms. Comments either way are accepted! Thank you for choosing Signature Analytics News.

The Tao of Signature Writing – Part 1

0

Posted by Signature Analyst | Posted in Analysis, Introduction, Signatures | Posted on 29-01-2010

Signature generation, analysis and testing is a complex art, that requires many parameters to be coordinated. “Tao” is “the ultimate principle of the universe”, and in here it means that signature writing requires an analyst to understand the principles in the signature universe. Since each signature format has its own structural design and components to perform pattern matching of the exploit or malicious software/code from entering into the network, one has to know the entire signature universe on the whole and how it interacts with the other universe. This might look like a multiverse theory, as seen in science fiction movies. Multiverse is also defined in Parallel universe:

“Parallel universe or alternative reality is a self-contained separate reality coexisting with one’s own. A specific group of parallel universes is called a multiverse, although this term can also be used to describe the possible parallel universes that constitute physical reality.”

We are not trying to mix up facts with fiction, but we want to help your learning curve go steep by keeping it interesting. Emerging Threats has classified its signature set, by splitting it into several domains. But most of these domains might be inter-related as they are within the same universe. We are not going to discuss about Emerging Threats Rulebase in this article, but we are going to look into the mindset that is required for becoming a signature writer in general. We are not trying to say that you could become a signature writer if and only if you have this mindset, but we are only trying to say that having this mindset could add an extra advantage towards steepening your learning curve.

If you would like to write signatures and if you believe that you are a layman in the SigUniverse, you might want to learn more about the focus of the results produced. Result is going to be a signature that when enabled performs one of the following checks:

  • Anomaly-based
  • Decoy-based
  • Malware-based
  • Exploit-based
  • Policy-based
  • and more signature triggers…

Trigger here, means that the signature is triggered when one of the above was observed. That is, if a traffic that is being monitored is something that is not according to the RFC based desciption of the protocol, then it is deviating from norm. At this point of time, it would generate an anomaly signature to trigger. Hence, one should always set a boundary or rather construct a perimeter from which they are deriving their input from. That is, you must be focused on the purpose of the signature, the data-set that you are going to use to analyze and generate the signature from, the data-set that you are going to test the signature against and other parameters or components that could help you in the process.

The first rule of thumb – KISS – Keep It Simple [Stupid]. If you do not keep it simple or if you keep it very simple, either way you would become a stupid. What we are trying to say here is, if you keep it TOO Simple then you would have many false-positive hits and if you complicate the signature to look only for a very specific thing, while the attack is also possible through many other vectors then the result would be false-negative in nature. Hence, while keeping it simple one might also want to remember that Simple does not mean that it should be small in number/quantity or easy to generate, and also that good signature does not mean that the signature has to look complex or should be so complicated to even create it. It is more of an equilibrium that we are trying to settle in for, as shown in the following image:





NOTE: This is not a real/true research output of the triggered signatures of any particular device. This is only a sample graph to help understanding the equilibrium between false-positives and false-negatives. In reality, there aren’t any specific equilibrium cases that would come as a straight line as shown above. It would be more of a regional value as shown below:





One must understand that there is no single perfect signature that can be the only solution to any given problem. There are several possibilities of arriving at a signature that is somewhere close to the end-results that you would like to obtain. But to arrive at close enough results, you should make sure that the problem set you have taken has mapped the TRUE source of the problem/issue. Let us look into this with 2 scenarios and analyze your steps.

Scenario 1.

You are a security analyst for an enterprise. Your enterprise uses Joomla for its main corporate website. You found that there is a most recent vulnerability in  Joomla. How would your proceed?

Review of the Scenario:

In this scenario, you are provided with the focus “Joomla”.  The following image shows the way you would be looking at the attack vectors:





Once you know the attack vectors, you would start looking for couple of ways to determine the next step. If you are vulnerability specialist and a reverse engineer, you would try reversing Joomla and finding out the list of vulnerabilities in it. Automated tools could give you results only to some extent, manual analysis is time consuming too. Hence, in this scenario if you are the only analyst for your company and if you are not a reverse engineer, then you would start looking out for resources that could give you a better picture of what could be the real focus on. If you came across the Exploit-DB portal from Offensive-Security group, you would notice the most recent posting [under Web exploits section] of the Joomla Component com_kunena Blind SQL Injection Vulnerability, you would wonder if you are vulnerable to that. You might want to understand the exploit vector and how the attack happens, check for privileges that are required for this to be performed, check for patches, etc. but before all that, you might want to write a simple signature for all packets that comes through the end-point device.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

[~]>> TITLE: Joomla (com_kunena) BLIND SQL Injection Vulnerability
[~]>> LANGUAGE: PHP
[~]>> DORK: N/A
[~]>> RESEARCHER: B-HUNT3|2
[~]>> CONTACT: bhunt3r[at_no_spam]gmail[dot_no_spam]com
[~]>> TESTED ON: LocalHost

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

[~]>> DESCRIPTION: Input var do is vulnerable to SQL Code Injection
[~]>> AFFECTED VERSIONS: Confirmed in 1.5.9 but probably other versions also
[~]>> RISK: Medium/High
[~]>> IMPACT: Execute Arbitrary SQL queries

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

[~]>> PROOF OF CONCEPT:

[~]>> http://[HOST]/[JOOMLA_PATH]/index.php?option=com_kunena&Itemid=86&
func=announcement&do=[SQL]

[~]>> {RETURN TRUE::RETURN FALSE} ---> VIEW TIME RESPONSE ||| HIGH: TRUE
||| LOW: FALSE

[~]>> http://server/[JOOMLA_PATH]/index.php?option=com_kunena&Itemid=86
&func=announcement&do=show', link='0wn3d', task='0wn3d' WHERE userid=62 AND
1=if(substring(@@version,1,1)=5,benchmark(999999,md5(@@version)),1)/*

[~]>> http://server/[JOOMLA_PATH]/index.php?option=com_kunena&Itemid=86&
func=announcement&do=show', link='0wn3d', task='0wn3d' WHERE userid=62 AND
1=if(substring(@@version,1,1)=4,benchmark(999999,md5(@@version)),1)/*

[~]>> Note: There are more affected vars.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Now that you have the exploit  in your hand, you could think of a pretty simple signature with the above data. With the above data, if you write a signature with just “/index.php?” as the file-frame, you would have a hit for every single access to every directory on the web-site since index.php is very common. Hence, keeping it that simple here is not a good idea, although you do not want to do an exact match of the above given example either, say “http://server/[JOOMLA_PATH]/index.php?option=com_kunena&Itemid=86&func=announcement&do=show’, link=’0wn3d’, task=’0wn3d’ WHERE userid=62 AND 1=if(substring(@@version,1,1)=4,benchmark(999999,md5(@@version)),1)/*”, because that would lead to false-negatives for sure. This is where, you would start thinking about the equilibrium.

Scenario 2.

In this scenario, you do not know the tools that are used in your corporation. You don’t know what servers are running in the DMZ , what are the various custom applications in each of them and so on. In this case, how would you focus?

In such case, you would not know what you are protecting and what you are fighting against. Something like what you see below:





NOTE: This cannot be entirely true. Although what we are trying to suggest is that, it is possible for someone to not know every possible application running on a server. In such a case, you might not know if you would have already protected it with a signature that was enabled for something else, or if you had left the loop hole open. In either way, you are pretty much doing something without having a clear focus on what is happening. This could lead to bad end-results.

In this blog, we were aiming to help you with the fact that “focus” is the most important factor of researching data to find the subset, from which you would generate a signature to protect your network. We would continue the series by talking more about the different types of signatures and how could you generate the subset of data that is most accurate in generating those signatures.

Thank you for choosing our blog! We hope that this was helpful…

Hello world!

0

Posted by Signature Analyst | Posted in Introduction | Posted on 25-01-2010

Welcome to the portal, to the world of signature analysis! This is just the pathway to the all new world, that is about to be revealed very soon. Blogging the Science of signature analysis is something that we do not find everywhere. It is easy to do something, but is quite hard to state the pathway to achieve something one step at a time. To make this easy for you, we have created this blog to ensure that we analyze and share all our views, steps taken and other stuff in creating a portal solely dedicated for signature analysis.

In Signature Analytics, we would be looking at various frameworks that help you create, test and deploy live signatures to couple of different formats. To start with, we are going for Emerging Threats format. Why? Because they are our best friends. Our mission is to do anything and everything, that makes your life easy when you enter our world [Dude! Of course it is the Signature Analysis world]. If you have any questions or something to talk about, contact us at contact.fingers[at] gmail.com.

About us:

Analyzing signatures is a complex task that involves reviewing the source to obtain a pattern, generating a pattern-matching signature, testing for false-positives, false-negatives and true-positives, and finally performing real-time analysis. Signature Analytics was started with the intent of proving an interface to the signature world, with tools and techniques that could help a layman to generate good signatures. This blog would draft the steps we are taking to create the Signature analytics portal, the process of creating the framework, things that we kept in mind while creating stuff, etc. This is more like a idea sharing portal for signature analytics.

Kevin Ross [Architect], Nagareshwar [Special Ops], Anushree Reddy [Dev] and few in the pipeline are the responsible for creating this art of signature analysis. If you wish to contribute or just say something, shoot an email to contact.fingers {at} gmail.com. This is yet another EvilFingers portal. The aim of our group is to help everyone understand the importance of security and to bring it into practice in our day-to-day life.

Thank you for choosing our blog!