Filter Evasion: Houdini on the Wire - Presentation Transcript
Filter Evasion Houdini on the Wire Rob Ragan ( [email_address] ) HP Application Security Center
Overview
Filters
Understanding different kinds of filters
Identify the short comings of signature development
Evasions
Examination of relevant evasion techniques
Focus on HTTP attacks
How to bypass Snort
Some Reasons to Elude a Filter
Money
Spammers
Fun
Porn
Information
Truth seekers
Illegal act
Stealing private data
Security Filters
Used to detect actions that attempt to compromise a resource
Reactions
Allow
Deny
Log
Remove
Usually a black box
Typically use signatures, which are black lists
Why is it important to understand evasion tactics?
Cyber criminals
Using obfuscation
Penetration testers
Need to keep up with cyber criminals latest techniques
Developers (filter creators)
Need to know how to properly build filters
QA
Need to know how to properly test filters
HTTP Filters Are Everywhere Filter Example Intrusion Detection Systems (IDS) Snort Web Application Firewall (WAF) ModSecurity Server Add-on IIS UrlScan Framework ASP.NET Request Validation Browser IE8 XSS Filter Application custom sanitizer See your code
New Filters
Announced 14 October 2008
The DHS is funding new IDS/IPS development
"The OISF was formed primarily to begin the development of this new IDS/IPS engine, but will over time take on new projects and challenges." http://www.openinfosecfoundation.org
Will they learn from history and other’s mistakes?
Filter Responsibility in the OSI Model
Who is responsible for each layer?
Attackers consistently moving up the stack
The Network perimeter is safer than ever
Applications are more exposed than ever
Who creates filters?
Security professionals
Open source community
Corporations
Ultimately developers need to be responsible
Proper knowledge transfer isn’t occurring
In February of 1676 Sir Issac Newton wrote in a letter to Robert Hooke “If I have seen a little further it is by standing on the shoulders of Giants.” implying that while he may have come up with the final idea he was only able to do so because of the work of those that had gone before him.
Should use simplest form before performing detection
Canocalization
Microsoft Security Bulletin MS05-004
ASP.NET Path Validation Vulnerability
The Microsoft .NET forms authentication capability for ASP.NET allows remote attackers to bypass authentication for .aspx files in restricted directories via a request containing a (1) "" (backslash) or (2) "%5C" (encoded backslash), aka "Path Validation Vulnerability.“
If the packet is too large for the link layer a router can split it into multiple fragments
Session Splicing
Purposefully delivering the payload over multiple packets to evade detection. Smaller than it needs to be.
IDS Defense
Fragment reassembly
Session reassembly
Send a reset [RST]
State of the Evasion
Does whisker’s session splicing tactic still work on Snort?
Answer: No
Why?
Session Splicing 1999 vs 2009
The current implementation in whisker will result in 1-3 characters in each packet, depending on your system and network speed
1999 2009
Bypass Snort
Pragmatic Session Splicing + Timing Attack
Use the filter’s signatures to split the payload
Vulnerable if the IDS stateful inspection timeout is less than session reassembly of the hosts it protects
Similar to fragmentation attack but instead of at the IP level we move up to the TCP level
Time Splicer
The attack is practical if we split the session on the matches found by the signature we're trying to evade
Attack:
GET /index.php?param=<script>alert(123)</script> HTTP/1.1 Host:www.target.com
Signature: Matches on <script>|</script> tags
Know the stateful inspection timeout for the IDS
Recursively find matches and split the attack string, then send each splice in a new packet with time delay between each packet
Snort Preprocessors
HTTP Inspect + Stream4
Stateful inspection
Default timeout is 30 seconds
# stream4: stateful inspection/stream reassembly for Snort
#------------------------------------------------------------ # Use in concert with the -z [all|est] command line switch to defeat # stick/snot against TCP rules. Also performs full TCP stream # reassembly, stateful inspection of TCP streams, etc. Can statefully # detect various portscan types, fingerprinting, ECN, etc.
# stateful inspection directive
# no arguments loads the defaults ( timeout 30 , memcap 8388608)
POST /rootlogin.asp HTTP/1.1
Host: zero.spidynamics.com
Keep-Alive: 300
Content-Type: application/x-www-form-urlencoded
Content-Length: 102
txtPassPhrase=&txtName=%3Cs
… WAIT 30s…
cript%3Ealert%283%29%3C%2F
… WAIT 30s…
script%3E&txtHidden=This+was+hidden+from+the+user
Default Session Timeouts
What can you do?
Fingerprint for the Server and Application technology
Fingerprint an IDS
Server Type Timeout Apache/PHP 10 minutes IIS 5.0/ASP 15 minutes IIS 6.0/ASP.NET 20 minutes IIS 7.0/ASP.NET 20 minutes
DEMO
Time Splicer
Questions?
Rob Ragan ( [email_address] )
Check out the HP Security Laboratory on the Blogosphere
Today security filters can be found on our network more
Today security filters can be found on our network perimeter, on our servers, in our frameworks and applications. As our network perimeter becomes more secure, applications become more of a target. Security filters such as IDS and WAF are relied upon to protect applications. Intrusion detection evasion techniques were pioneered over a decade ago. How are today's filters withstanding ever evolving evasion tactics? The presentation will examine how evasion techniques worked in the past and provide insight into how these techniques can still work today; with a focus on HTTP attacks. A practical new way to bypass Snort will be demonstrated. A tool to test other IDS for the vulnerability in Snort will be demonstrated. (Outerz0ne 2009) less
0 comments
Post a comment