260 likes | 385 Views
Supported by. Web Applications Testing. By Jamie Rougvie. Disclaimer. All information presented here is for educational use only. Please only practice in a controlled environment that you own or that you have written permission to use!. Why test web application ??.
E N D
Supported by Web Applications Testing By Jamie Rougvie
Disclaimer • All information presented here is for educational use only. • Please only practice in a controlled environment that you own or that you have written permission to use! Jamie Rougvie
Why test web application ?? • Tesco web security 'flaw' probed by UK data watchdog. • 6.5 Million LinkedIn passwords leaked by hackers. • GoDaddy hacked, millions of sites go down in registrar outage. • Yahoo hacked, 450,000 passwords posted online. • IEEE exposed 100k plaintext usernames and passwords on their FTP server. Jamie Rougvie
Common tools • Web Browser • Burpsuit / ZAP there are loads of others tools and plugins to aid us when testing but the most common ones are: • Sqlmap • Nikto • Nessus • Dir Buster • BEEF • Automated scanners Netsparker, Acunetix and W3af Jamie Rougvie
What is a Proxy? Jamie Rougvie
Demo Burp Suite Jamie Rougvie
Getting Started • Browse the website • Identify functional pages • List possible attacks for functional pages • Try to implement attacks • Documentation screen shots Jamie Rougvie
Owasp Top 10 • A1: Injection • A2: Cross-Site Scripting (XSS) • A3: Broken Authentication and Session Management • A4: Insecure Direct Object References • A5: Cross-Site Request Forgery (CSRF) • A6: Security Misconfiguration • A7: Insecure Cryptographic Storage • A8: Failure to Restrict URL Access • A9: Insufficient Transport Layer Protection • A10: Unvalidated Redirects and Forwards Jamie Rougvie
A1 Injection SQL Injection
About SQL • SQL Injection attacks are the process of injecting SQL commands into SQL queries to manipulate the database which the application relies on. • Two types of SQL injection error based and blind. Jamie Rougvie
Demo of SQL Injection Jamie Rougvie
SQL Explained • We can assume the SQL statement is Select * FROM users WHERE username= ' ' AND password= ' ' • The Code we Injected' or ' '= ' • The Query that’s gets submitted isSelect * FROM users WHERE username= ' ' AND password= ' ' or ' ' = ' ' • This Result is a true statement so data from the database gets returned. Jamie Rougvie
Power of SQL Injection • Bypass login pages • Dump entire databases using a tool like Sqlmap. This will allow you to get usernames and passwords which you could then crack unless they were hashed. • People like using the same username and password on many sites so you can now try to access other sites with the login details. Jamie Rougvie
A3 XSS Cross Site Scripting
About XSS • Injecting HTML or running code (Javascript) in a user web browser • Three Types of XSS they are stored, reflected and DOM. • XSS can be found in any user supplied input COOKIES,GET,POST,HTTP HEADERS Jamie Rougvie
XSS Demo Jamie Rougvie
What can you do with an XSS attack • Steal Cookies • Redirect users • Deface website • Use BEEF Jamie Rougvie
BEEF Demo Jamie Rougvie
The Solution Always validate any input from the user on the server side! Jamie Rougvie
Common Vulnerabilities Low hanging fruit
Default Login Details • Many People make the mistake of installing applications and leaving the default settings setup on it. Example:root: password - MYSQLroot: blank – PHPMyAdmin • This may vary between versions but a quick Google search can find the correct default login. Jamie Rougvie
Weak Password • This is really common and yet so simple to fix! 123456Password123456789abc123111111There are loads more default and silly passwords! • Other bad ideas. Any Dictionary word Website Name Organisation Details Jamie Rougvie
Old Version Running • Companies don’t upgrade web servers or CMS (Content Management System) in case they break it. • This may make it easier to exploit as they would not have known security bugs fixed. Jamie Rougvie
Information Leakage • Information leaked from the site can give vital information to the attack. Information leakage can come in many forms. Example: . Jamie Rougvie
PRATICE RESOURCES • jamierougive.co.uk – My Blog • ypisg.bcs.org – Young Professional Information Security Group • http://vulnhub.com Great for all testing • hack.me - Working progress as seen in demos • www.owasp.org – Great for web app testing • www.trustedsec.com – Social Engineer Toolkit • www.dvwa.co.uk – Damn Vulnerable Web App • www.kioptrix.com – Demo Example • g0tmi1k.blogspot.co.uk BOOT 2 ROOT • http://beefproject.com/ Beef Project Jamie Rougvie
Questions!! ANY QUESTIONS ? Jamie Rougvie