Intrusion detection for web applications



Similar documents
Web Application Hacking (Penetration Testing) 5-day Hands-On Course

Web application security

FINAL DoIT v.4 PAYMENT CARD INDUSTRY DATA SECURITY STANDARDS APPLICATION DEVELOPMENT AND MAINTENANCE PROCEDURES

Magento Security and Vulnerabilities. Roman Stepanov

Where every interaction matters.

Detecting Web Application Vulnerabilities Using Open Source Means. OWASP 3rd Free / Libre / Open Source Software (FLOSS) Conference 27/5/2008

Check list for web developers

CSE598i - Web 2.0 Security OWASP Top 10: The Ten Most Critical Web Application Security Vulnerabilities

Ruby on Rails Secure Coding Recommendations

(WAPT) Web Application Penetration Testing

Hack Proof Your Webapps

The Top Web Application Attacks: Are you vulnerable?

ASP.NET MVC Secure Coding 4-Day hands on Course. Course Syllabus

Web Application Firewalls Evaluation and Analysis. University of Amsterdam System & Network Engineering MSc

State of The Art: Automated Black Box Web Application Vulnerability Testing. Jason Bau, Elie Bursztein, Divij Gupta, John Mitchell

Implementation of Web Application Firewall

Criteria for web application security check. Version

elearning for Secure Application Development

ASL IT SECURITY BEGINNERS WEB HACKING AND EXPLOITATION

Out of the Fire - Adding Layers of Protection When Deploying Oracle EBS to the Internet

Web application testing

ArcGIS Server Security Threats & Best Practices David Cordes Michael Young

OWASP and OWASP Top 10 (2007 Update) OWASP. The OWASP Foundation. Dave Wichers. The OWASP Foundation. OWASP Conferences Chair

Securing Your Web Application against security vulnerabilities. Ong Khai Wei, IT Specialist, Development Tools (Rational) IBM Software Group

WEB SECURITY CONCERNS THAT WEB VULNERABILITY SCANNING CAN IDENTIFY

Adobe Systems Incorporated

Is Drupal secure? A high-level perspective on web vulnerabilities, Drupal s solutions, and how to maintain site security

Essential IT Security Testing

Guidelines for Web applications protection with dedicated Web Application Firewall

Web Application Security Guidelines for Hosting Dynamic Websites on NIC Servers

Web Application Attacks And WAF Evasion

Web Application Security. Vulnerabilities, Weakness and Countermeasures. Massimo Cotelli CISSP. Secure

Web Application Security Considerations

Last update: February 23, 2004

Hacking de aplicaciones Web

Chapter 1 Web Application (In)security 1

Enterprise Application Security Workshop Series

National Information Security Group The Top Web Application Hack Attacks. Danny Allan Director, Security Research

WHITE PAPER. FortiWeb and the OWASP Top 10 Mitigating the most dangerous application security threats

MatriXay WEB Application Vulnerability Scanner V Overview. (DAS- WEBScan ) The best WEB application assessment tool

Project 2: Web Security Pitfalls

Barracuda Web Application Firewall vs. Intrusion Prevention Systems (IPS) Whitepaper

Rational AppScan & Ounce Products

Executive Summary On IronWASP

PCI-DSS and Application Security Achieving PCI DSS Compliance with Seeker

Cross Site Scripting in Joomla Acajoom Component

05.0 Application Development

Penta Security 3rd Generation Web Application Firewall No Signature Required.

How To Write A Web Application Vulnerability Scanner And Security Auditor

Application Layer Encryption: Protecting against Application Logic and Session Theft Attacks. Whitepaper

Mingyu Web Application Firewall (DAS- WAF) All transparent deployment for Web application gateway

THE SMARTEST WAY TO PROTECT WEBSITES AND WEB APPS FROM ATTACKS

VIDEO intypedia007en LESSON 7: WEB APPLICATION SECURITY - INTRODUCTION TO SQL INJECTION TECHNIQUES. AUTHOR: Chema Alonso

Nuclear Regulatory Commission Computer Security Office Computer Security Standard

Hardening Moodle. Concept and Realization of a Security Component in Moodle. a project by

What is Web Security? Motivation

Web Application Penetration Testing

Web Application Security

EVALUATING COMMERCIAL WEB APPLICATION SECURITY. By Aaron Parke

How To Fix A Web Application Security Vulnerability

Detecting and Exploiting XSS with Xenotix XSS Exploit Framework

Attack Vector Detail Report Atlassian

Secure development and the SDLC. Presented By Jerry

Pentests more than just using the proper tools

Web Application Guidelines

Overview of the Penetration Test Implementation and Service. Peter Kanters

How to break in. Tecniche avanzate di pen testing in ambito Web Application, Internal Network and Social Engineering

ASL IT Security Advanced Web Exploitation Kung Fu V2.0

Secure Web Application Coding Team Introductory Meeting December 1, :00 2:00PM Bits & Pieces Room, Sansom West Room 306 Agenda

OWASP Top Ten Tools and Tactics

DISA's Application Security and Development STIG: How OWASP Can Help You. AppSec DC November 12, The OWASP Foundation

DFW INTERNATIONAL AIRPORT STANDARD OPERATING PROCEDURE (SOP)

Web applications. Web security: web basics. HTTP requests. URLs. GET request. Myrto Arapinis School of Informatics University of Edinburgh

Sitefinity Security and Best Practices

Software Assurance Tools: Web Application Security Scanner Functional Specification Version 1.0

Web Application Security Assessment and Vulnerability Mitigation Tests

Web Application Security

Finding Your Way in Testing Jungle. A Learning Approach to Web Security Testing.

How To Protect A Web Application From Attack From A Trusted Environment

Ethical Hacking as a Professional Penetration Testing Technique

Application Security Vulnerabilities, Mitigation, and Consequences

Web Application Vulnerability Testing with Nessus

Web Security Testing Cookbook*

Web Application Firewall Profiling and Evasion. Michael Ritter Cyber Risk Services Deloitte

Arrow ECS University 2015 Radware Hybrid Cloud WAF Service. 9 Ottobre 2015

Bypassing Web Application Firewalls (WAFs) Ing. Pavol Lupták, CISSP, CEH Lead Security Consultant

HTTPParameter Pollution. ChrysostomosDaniel


Testing the OWASP Top 10 Security Issues

Reducing Application Vulnerabilities by Security Engineering

Playing with Web Application Firewalls

STOPPING LAYER 7 ATTACKS with F5 ASM. Sven Müller Security Solution Architect

WHITE PAPER FORTIWEB WEB APPLICATION FIREWALL. Ensuring Compliance for PCI DSS 6.5 and 6.6

Pentests more than just using the proper tools

Top 10 Web Application Security Vulnerabilities - with focus on PHP

Application Security Testing. Generic Test Strategy

Application Security Testing. Erez Metula (CISSP), Founder Application Security Expert

OWASP TOP 10 ILIA

Transcription:

Intrusion detection for web applications

Intrusion detection for web applications Łukasz Pilorz Application Security Team, Allegro.pl

Reasons for using IDS solutions known weaknesses and vulnerabilities balance between security and usability 3 rd -party applications and libraries insecure client software additional layer of security fear, uncertainty, doubt IDS, IPS or WAF?

IDS purpose data source for post-intrusion analysis real-time intrusion investigation holy grail: intrusion prevention How can we detect unknown attacks?

Positive security model accept known good mantra allowed byte ranges regular expressions allowed variables whitelist What about encoded (base64, weak encryption, multiple charsets) or complex (HTML, file upload) data?

Positive security model when application changes, whitelist has to change too lots of alerts http://p1.tld/p2/p3.php/p4/p5=p6,p7?p8&p9=p0 real-time protection? block them all! sanitizing wrong input could help Why can't we do this in the application itself?

It's easier to fix applications, than detect attacks usually true 3 rd party software and libraries unknown attack methods security filters adding new vulnerabilities example: HTML filters

HTML filters review March 2008 Tested: 5 popular anti-xss HTML filters (PHP) Results: 3/5 vulnerable to XSS (+1 already known 0-day) 2/5 included PHP code execution bugs (kses, htmlawed) alternative syntax like Textile or Markdown also not safe from XSS

Negative security model blacklist detection rules far less alerts classification by attack type, priority, etc. generic rules: often too general, false positives specific rules: very limited, often outdated How to detect unknown attacks?

Examples Snort known exploits ModSecurity Core Rules generic PHPIDS generic, focused on XSS

PHPIDS LGPL licensed IDS library for PHP applications impact rating for each malicious request could be added in auto_prepend_file, without modifying application code attempts to detect unknown attack patterns http://php-ids.org/

IDS vs OWASP Top Ten

What are we trying to detect? automated exploits automated vulnerability scanners manual attacks uncommon user behaviour intrusion vs vulnerability testing How to recognize source type?

A1 - Cross Site Scripting (XSS) most common: <script, document.cookie dangerous HTML tags and attributes breaking out of HTML attribute JavaScript keywords comparing request and response PHPIDS regular expressions

XSS from attacker's view needs just one byte to detect vulnerability, e.g., <, ( easy to make it look innocent <a href= http://tested.site.tld/page.php? id=article">interesting article</a> <script>[google Analytics]... usually needs at least several requests to prepare working attack (for custom application)

XSS detection hard to detect less common vulnerability testing patterns recognizing malicious XSS code is easier time window between finding vulnerability and developing exploit real-time detection could prevent attack How to detect DOM-based XSS or 3 rd party JavaScript/CSS modifications?

XSS reducing false positives different rules for public and private application sections check for persistent XSS after HTML filtering (response buffering or PHPIDS) don't alert when only single keyword/char matches rule (skip non-malicious XSS) raise impact rating for suspicious or missing Referer headers don't even think about trusted IPs

A2 Injection Flaws paranoid mode: blocking semicolon and quotes checking for SQL (or other language) keywords 2.0, 2-0, 2-1, 2;[query] val' ', val';[query] 2 AND 1=1, 2 AND 1=2 2 UNION...SELECT [query] /*...*/, /*!...*/ page.tld/page?var=1/*&union SELECT*/

SQL Injection relatively easy to detect malicious attacks many false positives, if we want to detect vulnerability testing good results with whitelisting reducing false positives by checking traffic between application and database (or in the application, before executing query) real-time reporting of SQL query errors

Command/Code Injection much wider range of malicious code than for SQL Injection detect vulnerability testing, not exploits reducing false positives by eliminating known vectors common commands and functions `, {${, <?, <% real-time reporting of application errors

Other injection flaws LDAP XPath XSLT HTML HTTP

A3 Malicious File Execution affects mostly PHP external URL in request (http://, ftp://) wrappers (data:, php:, ogg:, zlib:, zip:) /var/log/httpd/ /proc/self/environ + User-Agent /,../ upload containing PHP code upload filename & extension

A4 Insecure Direct Object Reference easier to fix than detect whitelisting often doesn't help we can try to detect data harvesting tools multiple requests to the same page, with different set of parameters repeating requests to a single page or a small subset of pages small mistakes in automatically generated requests (Referer, null bytes, missing headers or cookies)

A5 Cross Site Request Forgery (CSRF) why black hats love CSRF? again, it's really easier to fix than detect external or missing Referer header missing cookies Accept header user trying to perform action while logged out user trying to remind password while logged in broken application flow Referer-less redirects, clickjacking

A6 Information Leakage and Improper Error Handling monitoring outbound traffic (e.g. ModSecurity) application code, HTML comments, error messages (esp. SQL) 3 rd party software may leak undocumented or non-standard error messages what information should be treated as leakage (and how IDS knows it)? Blind SQL Injection

Forcing errors var[]=1 1.1, 1x,./1, /1, ',!, %0A, %00 wrong type of data wrong format of session identifier DoS... too many possibilities to check requests

A7 Broken Authentication and Session Management Session hijacking detection another one that is easier to fix in the application itself (or rather fix ) After identifier is stolen: IP address change during session headers changed/missing during session Before: tampering session identifiers XSS

Session hijacking attacker's view sniffing traffic Spoof IP, everything else you already have. XSS You don't need to hijack session identifier, just force the victim to do whatever you wanted. Referer header

A8/A9 Insecure Cryptographic Storage and Communications not much to do for an IDS (at least on the server side) passing base64-encoded or weakly encrypted values to the client WAF protection against tampering may be decrypted on client side and leak information general brute-force attacks detection

A10 Failure to Restrict URL Access IDS has no information about user rights in the application known vulnerabilities in libraries/include files brute-force detection may deal with fuzzing broken application flow whitelisting IPS/WAF as a hotfix solution

...

Log, block, alert 3-tier solution Tier 1: log everything you can Tier 2: detailed log of detected attack attempts Tier 3: possible intrusions and bypasses

Tier 1 log everything you can all application errors (with their context) full requests (URL, headers, cookies, body) full responses (HTTP code, headers, body)

Tier 2 detailed log of detected attack attempts IDS alerts combined data from several sources including vulnerability testing patterns including blocked/sanitized requests optionally: requests following blocked one

Tier 3 possible intrusions and bypasses alerts that require manual verification generate as much as you are able to check manually skip blocked requests