SlideShare uma empresa Scribd logo
1 de 41
Baixar para ler offline
APPSEC 101
BREAK STUFF LIKE A PRO!
WELL, ALSMOST… 
Vladimir Garbuz
HP ALM Security Center of Excellence
Intro
 What these sessions are NOT
 What these sessions are
Contents
 AppSec testing tools
 Testing stages
 Mapping application’s content
 Input-based vulnerabilities
 Denial of Service
 Client-side controls
 Authentication mechanism
 Session management
 Logic flaws
 Application Server Vulnerabilities
 Final word on process and security RC
AppSec testing tools
 the Swiss Army Knife of AppSec – Fiddler
 not just a proxy
 inspect HTTP and HTTPS! (best served in RAW)
 modify and replay
 intercept mid-air
 setup reverse proxy mode
 get request stats
 set filters
 do text encoding
 autoresponder
 scripting in C#
AppSec testing tools
 WireShark – when Fiddler doesn’t cut it
 only passive traffic monitoring
 sees everything!
 your browser’s developer console
 socket programming in any language, e.g. Python 
 hacker’s mindset
Mapping application’s content
 read the feature specs
 monitor HTTP traffic for all user data entry points
 look at interface differences for different user roles
 discover hidden content
 ViewDocument.jsp  Delete, Upload, Edit, Create, etc.
 lookout for direct server file access (filename specified)
 lookout for verbose error messages
 lookout for debug/god-mode parameters
 lookout for disabled old/future functionality
 lookout for default content - webserver console, files,...
Input vulnerabilities
Input vulnerabilities: basic checks
 check if server correctly handles unexpected data
 negative indexes and values
 overly large integers
 zero-bytes and other string terminators (e.g. “, #, ;)
 non-existing string specified dates
 look for differences in processing of directly submitted
values AND when parsed from a user uploaded or
controlled file
 relates to ALL input-based vulnerabilities!
Input vulnerabilities: SQL injections
 use DB server management software and profiler
 submit ‘ or “ in request, not only “Edit” operations!
 SQLi can be anywhere where DB is accessed based on
user data, in any way!
 monitor for server errors AND the DB log/profiler!
 broken SQL query in DB log, error, etc?.. REPORT!
Input vulnerabilities: XSS injections
 general principle – lack of input encoding
 user submitted data is unmodified in HTML page
 from Google XSS guide: "A good test string is
 >'>"><img src=x onerror=alert(0)
 generally, raise an ALARM for any of the following 5:
 < > & " ‘
 within HTML actions and JavaScript code, additionally
 n r ’ ”  uXXXX
 sometimes escaping won’t help
 ALARM if URL protocol (http, https) can be manipulated
Input vulnerabilities: XSS injections
 reflected XSS
 when a part of URL is reflected back in HTML page
 DON’T forget to URL encode special characters! e.g.:
 http://url.com/1.jsp?param=%3E%3Cscript%3Ealert(1)
%3C%2Fscript%3E
 stored XSS
 a malicious string is added to the server once and
displayed as a part of a page to everyone viewing it
 from POST body, HTTP header, uploaded file, HTML
based server log, etc… MANY vectors!
Input vulnerabilities: XSS injections
 DOM XSS
 caused by unsafe JS during runtime inside the browser
 basically, all ALM AngularJS XSS were DOM XSS
 same principles apply (at this low level)
 monitor for special chars appearing in resulting HTML!
OK, that’s enough, I’m leaving!
Input vulns: HTTP header injection
 for each response header where user data appears
 try inserting carriage-return and line-feed symbols
 the actual symbols! “0d” and “0a” in hex
 if they are returned in server response header unmodified
 ALARM! malicious server headers can be forged or HTTP split!
Input vulns: Open redirection
 if the URL data specifies a redirection target
 try modifying or adding the redirection domain, e.g. in
 http://url.com/qcbin/authentication-point/web-ui-
login.jsp?redirect-url=%2Fui%2F
 after that, trigger an event that causes redirection, e.g.
login
 if it redirects to a different domain, ALARM!
Input vulns: OS command injection
 if you suspect (or know) some input is passed to
system shell, try adding additional commands. E.g.:
 ; cat /etc/passwd
 http://url.com/ping.jsp?ip=8.8.8.8%3B+cat+%2Fetc%2F
passwd
 if cannot get the response, try long running command
or creating a file to see if the attack was successful
 if this works or something weird happens – ALARM!
Input vulns: Path traversal
 a file path or name is directly specified?..
 try adding ../../ in sequences to backtrack out of current
directory and access server file system
 you can create a test file and try accessing it
 also run Process Monitor by Sysinternals to monitor file access
 if you gain access to other files or something fishy
happens – ALARM!
Input vulns: XML injections - XXE
 XML External Entities
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE foo [
<!ELEMENT foo ANY >
<!ENTITY xxe SYSTEM "file:///c:/boot.ini" > ] >
<username>&xxe;</username><password>……………
 if no error or file is retruned by server – ALARM!
 if gives an error, but it disappears after you remove
embedded entity and leave only declaration, ALARM!
 <username>blabla</username>
Input vulns: XML injections - DoS
 Recursive “billion laughs” attack
<?xml version="1.0"?>
<!DOCTYPE lolz [
<!ENTITY lol "lol">
<!ELEMENT lolz (#PCDATA)>
<!ENTITY lol1 "&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;">
<!ENTITY lol2 "&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;">
<!ENTITY lol3 "&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;">
<!ENTITY lol4 "&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;">
<!ENTITY lol5 "&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;">
<!ENTITY lol6 "&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;">
<!ENTITY lol7 "&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;">
<!ENTITY lol8 "&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;">
<!ENTITY lol9 "&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;">
]>
<username>&lol9;</username><password>……………
Denial of Service
Denial of Service
 API request flooding
 check if server correctly handles unexpected data
 oversized data
 zero-bytes in input
 XML “billion laughs” attack or XXE of a huge file (/dev/random or c:pagefile)
 logic fuckups (sorting)
 unpacking
 recursion
 large low entropy data
 malicious usage of regex, globbing
 asynchronous/heavy functionality invocation
 text instead of number
 ………
 thread/socket exhaustion – e.g. slow HTTP, slow request
 ………
Denial of Service
Client-side controls: Data transmission
 locate and understand all hidden fields and
parameters in client request
 try to intelligently modify them according to their
name/meaning to pwn the system
 for encoded, obfuscated or badly encrypted data
 decode/decrypt, play with it, encode/encrypt back
and replay to pwn the server
 e.g. ASP.NET ViewState is using base64 encoding, like
 YmFzZTY0IGV4YW1wbGU=
Client-side controls: User input
 find all places where client restricts input length or
JavaScript enforces some rules or logic
 always check if the server-side code does the same
 not always a vulnerability, but CAN lead to pwnage
 find all controls that are invisible/disabled for certain
user groups, but visible to others
 record a request such controls send for users who can use
them and replay them with user sessions that can’t
 servers frequently trust client-side to perform permissions
checking, which is… erhm… not very smart 
Authentication mechanism
Authentication mechanism
 Test password quality
 no/weak rules at registration OR “change password”
 attempt to log in with password variations
 e.g. make a long password and try to log in without the last
char
 change character case of one letter an see if that is successful
 ensure no “default accounts” are present in final release
Authentication mechanism
 Test username enumeration
 find ALL locations where the username is submitted, e.g.
primary login, self-registration, password change, logout,
account recovery, etc…
 attempt submitting valid and invalid user names
 check if the server responses differ in ANY way (small
typographic differences, server response time, etc.)
 ALARM on any difference
Authentication mechanism
 Test resilience to Password Guessing
 find ALL locations where user credentials are submitted
 e.g. login or badly designed “password change”
 try submitting various passwords for a user
 after ~10 times, enter valid ones
 if all this succeeds – the system is vulnerable, ALARM!
Authentication mechanism
 Check for unsafe transmission of credentials:
 in URL
 stored in cookies
 if ever transmitted from server to client
 creds are vulnerable to session, access control and XXS attacks
 should never go over HTTP
 if creds are sent over HTTPS but the login page over HTTP
 MITM attacks can steal creds, ALARM!
Authentication mechanism
 Check for insecure storage
 check all logs for credentials
 or their hashes
 check configuration files for clear-text credentials
 check for credentials saving on client-side
 in logs, in browser or client “autocomplete”, etc
 all the points are valid for both client and server side
Session Management mechanism
 Check for insecure transmission of Session Tokens
 under HTTPS, check if Secure flag is set for cookies
 verify that HTTP and HTTPS parts of application use
different cookies
Session Management mechanism
 Check Cookie scope - Domain
 domain better not be set than set liberally to a domain
 e.g. domain=server.com gives the cookie to subdomains
 Check Cookie scope - Path
 path must include only the webapp for which the cookie is
Session Management mechanism
 Check for insecure Session tokens storage
 when in URL – proxy logs, Referer header, screen 
 or visible in some logging mechanisms
Logic flaws
Logic flaws
 Check for Fail-Open conditions
 whenever the app checks user’s credentials, make a note
of all the request parameters
 for each parameter, try:
 submit an empty string as the value
 remove the name/value pair
 submit very long and very short values
 submit strings instead of numbers, and vice versa
 submit the same named parameter multiple times, with the
same and different values
 notice any unusual behavior? ALARM!
Logic flaws
 Check Multistage mechanisms
 a single action is performed via a fixed series of steps?..
 modify the steps to interfere with app’s logic, e.g:
 pass all stages, but in a different sequence
 go directly to each step in turn, and continue the normal
sequence from there
 go through the normal steps repeatedly, skipping each single
step
 be clever and try breaking the multistage process 
 see anything fishy?... ALARM!
Logic flaws
Application server vulnerabilities
 Check for default content and creds
 google info on default config of your specific server
 try default server admin accounts
 try default management console, UI
 nothing irrelevant to the web-app should be present!
Application server vulnerabilities
 Check for dangerous HTTP Methods
 try issuing a TRACE request – shouldn’t work, i.e. shouldn’t
return your request to you
 try issuing an OPTIONS request – shouldn’t work either
 not a vulnerability but may aid attacker, bad practice
Process and security RC
 don’t be afraid to bother with questions or something
suspicious – you are our helping hands
 another upside – you’ll definitely learn something new
 report every suspicious instance – even if you couldn’t
write an exploit
 prioritize security RC defects
 nothing high or critical from OWASP Top-10
Questions and Discussion

Mais conteúdo relacionado

Mais procurados

Input validation slides of web application workshop
Input validation slides of web application workshopInput validation slides of web application workshop
Input validation slides of web application workshopPayampardaz
 
In graph we trust: Microservices, GraphQL and security challenges
In graph we trust: Microservices, GraphQL and security challengesIn graph we trust: Microservices, GraphQL and security challenges
In graph we trust: Microservices, GraphQL and security challengesMohammed A. Imran
 
Web Application Firewall: Suckseed or Succeed
Web Application Firewall: Suckseed or SucceedWeb Application Firewall: Suckseed or Succeed
Web Application Firewall: Suckseed or SucceedPrathan Phongthiproek
 
OWASP top 10-2013
OWASP top 10-2013OWASP top 10-2013
OWASP top 10-2013tmd800
 
Pentesting RESTful webservices
Pentesting RESTful webservicesPentesting RESTful webservices
Pentesting RESTful webservicesMohammed A. Imran
 
Selenium Tutorial
Selenium TutorialSelenium Tutorial
Selenium Tutorialprad_123
 
Application Security Part 1 Threat Defense In Client Server Applications ...
Application Security   Part 1   Threat Defense In Client Server Applications ...Application Security   Part 1   Threat Defense In Client Server Applications ...
Application Security Part 1 Threat Defense In Client Server Applications ...Greg Sohl
 
XPATH, LDAP and Path Traversal Injection
XPATH, LDAP and Path Traversal InjectionXPATH, LDAP and Path Traversal Injection
XPATH, LDAP and Path Traversal InjectionBlueinfy Solutions
 
Top 10 Web Security Vulnerabilities (OWASP Top 10)
Top 10 Web Security Vulnerabilities (OWASP Top 10)Top 10 Web Security Vulnerabilities (OWASP Top 10)
Top 10 Web Security Vulnerabilities (OWASP Top 10)Brian Huff
 
Application Security
Application SecurityApplication Security
Application Securitynirola
 
Methods to Bypass a Web Application Firewall Eng
Methods to Bypass a Web Application Firewall EngMethods to Bypass a Web Application Firewall Eng
Methods to Bypass a Web Application Firewall EngDmitry Evteev
 
Web application attacks
Web application attacksWeb application attacks
Web application attackshruth
 
JavaEE Security
JavaEE SecurityJavaEE Security
JavaEE SecurityAlex Kim
 
Attribute-Based Access Control in Symfony
Attribute-Based Access Control in SymfonyAttribute-Based Access Control in Symfony
Attribute-Based Access Control in SymfonyAdam Elsodaney
 
Top 10 Security Vulnerabilities (2006)
Top 10 Security Vulnerabilities (2006)Top 10 Security Vulnerabilities (2006)
Top 10 Security Vulnerabilities (2006)Susam Pal
 
C sharp and asp.net interview questions
C sharp and asp.net interview questionsC sharp and asp.net interview questions
C sharp and asp.net interview questionsAkhil Mittal
 
Filter Evasion: Houdini on the Wire
Filter Evasion: Houdini on the WireFilter Evasion: Houdini on the Wire
Filter Evasion: Houdini on the WireRob Ragan
 
Static Analysis: The Art of Fighting without Fighting
Static Analysis: The Art of Fighting without FightingStatic Analysis: The Art of Fighting without Fighting
Static Analysis: The Art of Fighting without FightingRob Ragan
 

Mais procurados (20)

Input validation slides of web application workshop
Input validation slides of web application workshopInput validation slides of web application workshop
Input validation slides of web application workshop
 
In graph we trust: Microservices, GraphQL and security challenges
In graph we trust: Microservices, GraphQL and security challengesIn graph we trust: Microservices, GraphQL and security challenges
In graph we trust: Microservices, GraphQL and security challenges
 
Owasp Top 10 A1: Injection
Owasp Top 10 A1: InjectionOwasp Top 10 A1: Injection
Owasp Top 10 A1: Injection
 
Web Application Firewall: Suckseed or Succeed
Web Application Firewall: Suckseed or SucceedWeb Application Firewall: Suckseed or Succeed
Web Application Firewall: Suckseed or Succeed
 
OWASP top 10-2013
OWASP top 10-2013OWASP top 10-2013
OWASP top 10-2013
 
Pentesting RESTful webservices
Pentesting RESTful webservicesPentesting RESTful webservices
Pentesting RESTful webservices
 
Selenium Tutorial
Selenium TutorialSelenium Tutorial
Selenium Tutorial
 
Application Security Part 1 Threat Defense In Client Server Applications ...
Application Security   Part 1   Threat Defense In Client Server Applications ...Application Security   Part 1   Threat Defense In Client Server Applications ...
Application Security Part 1 Threat Defense In Client Server Applications ...
 
XPATH, LDAP and Path Traversal Injection
XPATH, LDAP and Path Traversal InjectionXPATH, LDAP and Path Traversal Injection
XPATH, LDAP and Path Traversal Injection
 
Top 10 Web Security Vulnerabilities (OWASP Top 10)
Top 10 Web Security Vulnerabilities (OWASP Top 10)Top 10 Web Security Vulnerabilities (OWASP Top 10)
Top 10 Web Security Vulnerabilities (OWASP Top 10)
 
Application Security
Application SecurityApplication Security
Application Security
 
Methods to Bypass a Web Application Firewall Eng
Methods to Bypass a Web Application Firewall EngMethods to Bypass a Web Application Firewall Eng
Methods to Bypass a Web Application Firewall Eng
 
Web application attacks
Web application attacksWeb application attacks
Web application attacks
 
JavaEE Security
JavaEE SecurityJavaEE Security
JavaEE Security
 
Attribute-Based Access Control in Symfony
Attribute-Based Access Control in SymfonyAttribute-Based Access Control in Symfony
Attribute-Based Access Control in Symfony
 
Top 10 Security Vulnerabilities (2006)
Top 10 Security Vulnerabilities (2006)Top 10 Security Vulnerabilities (2006)
Top 10 Security Vulnerabilities (2006)
 
C sharp and asp.net interview questions
C sharp and asp.net interview questionsC sharp and asp.net interview questions
C sharp and asp.net interview questions
 
Owasp top 10 2013
Owasp top 10 2013Owasp top 10 2013
Owasp top 10 2013
 
Filter Evasion: Houdini on the Wire
Filter Evasion: Houdini on the WireFilter Evasion: Houdini on the Wire
Filter Evasion: Houdini on the Wire
 
Static Analysis: The Art of Fighting without Fighting
Static Analysis: The Art of Fighting without FightingStatic Analysis: The Art of Fighting without Fighting
Static Analysis: The Art of Fighting without Fighting
 

Destaque

TakeDownCon Rocket City: Cryptanalysis by Chuck Easttom
TakeDownCon Rocket City: Cryptanalysis by Chuck Easttom TakeDownCon Rocket City: Cryptanalysis by Chuck Easttom
TakeDownCon Rocket City: Cryptanalysis by Chuck Easttom EC-Council
 
Applied cryptanalysis - stream ciphers
Applied cryptanalysis - stream ciphersApplied cryptanalysis - stream ciphers
Applied cryptanalysis - stream ciphersVlad Garbuz
 
Data Encryption Standard (DES)
Data Encryption Standard (DES)Data Encryption Standard (DES)
Data Encryption Standard (DES)Haris Ahmed
 
Digital signatures
Digital signaturesDigital signatures
Digital signaturesIshwar Dayal
 
Operating Systems: Computer Security
Operating Systems: Computer SecurityOperating Systems: Computer Security
Operating Systems: Computer SecurityDamian T. Gordon
 
Digital signature
Digital  signatureDigital  signature
Digital signatureAJAL A J
 
Seminar ppt on digital signature
Seminar ppt on digital signatureSeminar ppt on digital signature
Seminar ppt on digital signaturejolly9293
 
Cryptanalysis - basic ciphers and a bit more
Cryptanalysis - basic ciphers and a bit moreCryptanalysis - basic ciphers and a bit more
Cryptanalysis - basic ciphers and a bit moreThings Lab
 
Data encryption, Description, DES
Data encryption, Description, DESData encryption, Description, DES
Data encryption, Description, DESHuawei Technologies
 
Digital Signature
Digital SignatureDigital Signature
Digital Signaturesaurav5884
 
Introduction to Digital signatures
Introduction to Digital signaturesIntroduction to Digital signatures
Introduction to Digital signaturesRohit Bhat
 

Destaque (16)

TakeDownCon Rocket City: Cryptanalysis by Chuck Easttom
TakeDownCon Rocket City: Cryptanalysis by Chuck Easttom TakeDownCon Rocket City: Cryptanalysis by Chuck Easttom
TakeDownCon Rocket City: Cryptanalysis by Chuck Easttom
 
Applied cryptanalysis - stream ciphers
Applied cryptanalysis - stream ciphersApplied cryptanalysis - stream ciphers
Applied cryptanalysis - stream ciphers
 
Data Encryption Standard (DES)
Data Encryption Standard (DES)Data Encryption Standard (DES)
Data Encryption Standard (DES)
 
Digital signatures
Digital signaturesDigital signatures
Digital signatures
 
Digital signature
Digital signatureDigital signature
Digital signature
 
Operating Systems: Computer Security
Operating Systems: Computer SecurityOperating Systems: Computer Security
Operating Systems: Computer Security
 
Digital signature
Digital  signatureDigital  signature
Digital signature
 
Computer Security 101
Computer Security 101Computer Security 101
Computer Security 101
 
DES
DESDES
DES
 
Digital signature
Digital signatureDigital signature
Digital signature
 
Seminar ppt on digital signature
Seminar ppt on digital signatureSeminar ppt on digital signature
Seminar ppt on digital signature
 
Cryptanalysis - basic ciphers and a bit more
Cryptanalysis - basic ciphers and a bit moreCryptanalysis - basic ciphers and a bit more
Cryptanalysis - basic ciphers and a bit more
 
Computer Security
Computer SecurityComputer Security
Computer Security
 
Data encryption, Description, DES
Data encryption, Description, DESData encryption, Description, DES
Data encryption, Description, DES
 
Digital Signature
Digital SignatureDigital Signature
Digital Signature
 
Introduction to Digital signatures
Introduction to Digital signaturesIntroduction to Digital signatures
Introduction to Digital signatures
 

Semelhante a Application security 101

OWASP Secure Coding
OWASP Secure CodingOWASP Secure Coding
OWASP Secure Codingbilcorry
 
2013 OWASP Top 10
2013 OWASP Top 102013 OWASP Top 10
2013 OWASP Top 10bilcorry
 
Owasp top 10_openwest_2019
Owasp top 10_openwest_2019Owasp top 10_openwest_2019
Owasp top 10_openwest_2019Sean Jackson
 
Owasp Top 10 2017
Owasp Top 10 2017Owasp Top 10 2017
Owasp Top 10 2017SamsonMuoki
 
Joomla security nuggets
Joomla security nuggetsJoomla security nuggets
Joomla security nuggetsguestbd1cdca
 
Manindra kishore _incident_handling_n_log_analysis - ClubHack2009
Manindra kishore _incident_handling_n_log_analysis - ClubHack2009Manindra kishore _incident_handling_n_log_analysis - ClubHack2009
Manindra kishore _incident_handling_n_log_analysis - ClubHack2009ClubHack
 
Owasp first5 presentation
Owasp first5 presentationOwasp first5 presentation
Owasp first5 presentationowasp-pune
 
04. xss and encoding
04.  xss and encoding04.  xss and encoding
04. xss and encodingEoin Keary
 
4 andrii kudiurov - web application security 101
4   andrii kudiurov - web application security 1014   andrii kudiurov - web application security 101
4 andrii kudiurov - web application security 101Ievgenii Katsan
 
Steps to mitigate Top 5 OWASP Vulnerabilities 2013
Steps to mitigate Top 5 OWASP Vulnerabilities 2013Steps to mitigate Top 5 OWASP Vulnerabilities 2013
Steps to mitigate Top 5 OWASP Vulnerabilities 2013Jayasree Veliyath
 
C#Web Sec Oct27 2010 Final
C#Web Sec Oct27 2010 FinalC#Web Sec Oct27 2010 Final
C#Web Sec Oct27 2010 FinalRich Helton
 
OWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptxOWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptxjohnpragasam1
 

Semelhante a Application security 101 (20)

OWASP Secure Coding
OWASP Secure CodingOWASP Secure Coding
OWASP Secure Coding
 
2013 OWASP Top 10
2013 OWASP Top 102013 OWASP Top 10
2013 OWASP Top 10
 
Web Security
Web SecurityWeb Security
Web Security
 
Owasp top 10_openwest_2019
Owasp top 10_openwest_2019Owasp top 10_openwest_2019
Owasp top 10_openwest_2019
 
Secure Coding
Secure Coding Secure Coding
Secure Coding
 
Owasp Top 10 2017
Owasp Top 10 2017Owasp Top 10 2017
Owasp Top 10 2017
 
Joomla security nuggets
Joomla security nuggetsJoomla security nuggets
Joomla security nuggets
 
Secure coding | XSS Attacks on current Web Applications
Secure coding | XSS Attacks on current Web ApplicationsSecure coding | XSS Attacks on current Web Applications
Secure coding | XSS Attacks on current Web Applications
 
Manindra kishore _incident_handling_n_log_analysis - ClubHack2009
Manindra kishore _incident_handling_n_log_analysis - ClubHack2009Manindra kishore _incident_handling_n_log_analysis - ClubHack2009
Manindra kishore _incident_handling_n_log_analysis - ClubHack2009
 
Owasp first5 presentation
Owasp first5 presentationOwasp first5 presentation
Owasp first5 presentation
 
Owasp first5 presentation
Owasp first5 presentationOwasp first5 presentation
Owasp first5 presentation
 
Attques web
Attques webAttques web
Attques web
 
04. xss and encoding
04.  xss and encoding04.  xss and encoding
04. xss and encoding
 
Unusual Web Bugs
Unusual Web BugsUnusual Web Bugs
Unusual Web Bugs
 
Web Bugs
Web BugsWeb Bugs
Web Bugs
 
4 andrii kudiurov - web application security 101
4   andrii kudiurov - web application security 1014   andrii kudiurov - web application security 101
4 andrii kudiurov - web application security 101
 
secure php
secure phpsecure php
secure php
 
Steps to mitigate Top 5 OWASP Vulnerabilities 2013
Steps to mitigate Top 5 OWASP Vulnerabilities 2013Steps to mitigate Top 5 OWASP Vulnerabilities 2013
Steps to mitigate Top 5 OWASP Vulnerabilities 2013
 
C#Web Sec Oct27 2010 Final
C#Web Sec Oct27 2010 FinalC#Web Sec Oct27 2010 Final
C#Web Sec Oct27 2010 Final
 
OWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptxOWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptx
 

Último

Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noidabntitsolutionsrishis
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
Best Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdfBest Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdfIdiosysTechnologies1
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 

Último (20)

Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Best Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdfBest Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdf
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 

Application security 101

  • 1. APPSEC 101 BREAK STUFF LIKE A PRO! WELL, ALSMOST…  Vladimir Garbuz HP ALM Security Center of Excellence
  • 2. Intro  What these sessions are NOT  What these sessions are
  • 3. Contents  AppSec testing tools  Testing stages  Mapping application’s content  Input-based vulnerabilities  Denial of Service  Client-side controls  Authentication mechanism  Session management  Logic flaws  Application Server Vulnerabilities  Final word on process and security RC
  • 4. AppSec testing tools  the Swiss Army Knife of AppSec – Fiddler  not just a proxy  inspect HTTP and HTTPS! (best served in RAW)  modify and replay  intercept mid-air  setup reverse proxy mode  get request stats  set filters  do text encoding  autoresponder  scripting in C#
  • 5. AppSec testing tools  WireShark – when Fiddler doesn’t cut it  only passive traffic monitoring  sees everything!  your browser’s developer console  socket programming in any language, e.g. Python   hacker’s mindset
  • 6. Mapping application’s content  read the feature specs  monitor HTTP traffic for all user data entry points  look at interface differences for different user roles  discover hidden content  ViewDocument.jsp  Delete, Upload, Edit, Create, etc.  lookout for direct server file access (filename specified)  lookout for verbose error messages  lookout for debug/god-mode parameters  lookout for disabled old/future functionality  lookout for default content - webserver console, files,...
  • 8. Input vulnerabilities: basic checks  check if server correctly handles unexpected data  negative indexes and values  overly large integers  zero-bytes and other string terminators (e.g. “, #, ;)  non-existing string specified dates  look for differences in processing of directly submitted values AND when parsed from a user uploaded or controlled file  relates to ALL input-based vulnerabilities!
  • 9. Input vulnerabilities: SQL injections  use DB server management software and profiler  submit ‘ or “ in request, not only “Edit” operations!  SQLi can be anywhere where DB is accessed based on user data, in any way!  monitor for server errors AND the DB log/profiler!  broken SQL query in DB log, error, etc?.. REPORT!
  • 10. Input vulnerabilities: XSS injections  general principle – lack of input encoding  user submitted data is unmodified in HTML page  from Google XSS guide: "A good test string is  >'>"><img src=x onerror=alert(0)  generally, raise an ALARM for any of the following 5:  < > & " ‘  within HTML actions and JavaScript code, additionally  n r ’ ” uXXXX  sometimes escaping won’t help  ALARM if URL protocol (http, https) can be manipulated
  • 11. Input vulnerabilities: XSS injections  reflected XSS  when a part of URL is reflected back in HTML page  DON’T forget to URL encode special characters! e.g.:  http://url.com/1.jsp?param=%3E%3Cscript%3Ealert(1) %3C%2Fscript%3E  stored XSS  a malicious string is added to the server once and displayed as a part of a page to everyone viewing it  from POST body, HTTP header, uploaded file, HTML based server log, etc… MANY vectors!
  • 12. Input vulnerabilities: XSS injections  DOM XSS  caused by unsafe JS during runtime inside the browser  basically, all ALM AngularJS XSS were DOM XSS  same principles apply (at this low level)  monitor for special chars appearing in resulting HTML!
  • 13. OK, that’s enough, I’m leaving!
  • 14. Input vulns: HTTP header injection  for each response header where user data appears  try inserting carriage-return and line-feed symbols  the actual symbols! “0d” and “0a” in hex  if they are returned in server response header unmodified  ALARM! malicious server headers can be forged or HTTP split!
  • 15. Input vulns: Open redirection  if the URL data specifies a redirection target  try modifying or adding the redirection domain, e.g. in  http://url.com/qcbin/authentication-point/web-ui- login.jsp?redirect-url=%2Fui%2F  after that, trigger an event that causes redirection, e.g. login  if it redirects to a different domain, ALARM!
  • 16. Input vulns: OS command injection  if you suspect (or know) some input is passed to system shell, try adding additional commands. E.g.:  ; cat /etc/passwd  http://url.com/ping.jsp?ip=8.8.8.8%3B+cat+%2Fetc%2F passwd  if cannot get the response, try long running command or creating a file to see if the attack was successful  if this works or something weird happens – ALARM!
  • 17. Input vulns: Path traversal  a file path or name is directly specified?..  try adding ../../ in sequences to backtrack out of current directory and access server file system  you can create a test file and try accessing it  also run Process Monitor by Sysinternals to monitor file access  if you gain access to other files or something fishy happens – ALARM!
  • 18. Input vulns: XML injections - XXE  XML External Entities <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE foo [ <!ELEMENT foo ANY > <!ENTITY xxe SYSTEM "file:///c:/boot.ini" > ] > <username>&xxe;</username><password>……………  if no error or file is retruned by server – ALARM!  if gives an error, but it disappears after you remove embedded entity and leave only declaration, ALARM!  <username>blabla</username>
  • 19. Input vulns: XML injections - DoS  Recursive “billion laughs” attack <?xml version="1.0"?> <!DOCTYPE lolz [ <!ENTITY lol "lol"> <!ELEMENT lolz (#PCDATA)> <!ENTITY lol1 "&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;"> <!ENTITY lol2 "&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;"> <!ENTITY lol3 "&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;"> <!ENTITY lol4 "&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;"> <!ENTITY lol5 "&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;"> <!ENTITY lol6 "&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;"> <!ENTITY lol7 "&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;"> <!ENTITY lol8 "&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;"> <!ENTITY lol9 "&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;"> ]> <username>&lol9;</username><password>……………
  • 21. Denial of Service  API request flooding  check if server correctly handles unexpected data  oversized data  zero-bytes in input  XML “billion laughs” attack or XXE of a huge file (/dev/random or c:pagefile)  logic fuckups (sorting)  unpacking  recursion  large low entropy data  malicious usage of regex, globbing  asynchronous/heavy functionality invocation  text instead of number  ………  thread/socket exhaustion – e.g. slow HTTP, slow request  ………
  • 23. Client-side controls: Data transmission  locate and understand all hidden fields and parameters in client request  try to intelligently modify them according to their name/meaning to pwn the system  for encoded, obfuscated or badly encrypted data  decode/decrypt, play with it, encode/encrypt back and replay to pwn the server  e.g. ASP.NET ViewState is using base64 encoding, like  YmFzZTY0IGV4YW1wbGU=
  • 24. Client-side controls: User input  find all places where client restricts input length or JavaScript enforces some rules or logic  always check if the server-side code does the same  not always a vulnerability, but CAN lead to pwnage  find all controls that are invisible/disabled for certain user groups, but visible to others  record a request such controls send for users who can use them and replay them with user sessions that can’t  servers frequently trust client-side to perform permissions checking, which is… erhm… not very smart 
  • 26. Authentication mechanism  Test password quality  no/weak rules at registration OR “change password”  attempt to log in with password variations  e.g. make a long password and try to log in without the last char  change character case of one letter an see if that is successful  ensure no “default accounts” are present in final release
  • 27. Authentication mechanism  Test username enumeration  find ALL locations where the username is submitted, e.g. primary login, self-registration, password change, logout, account recovery, etc…  attempt submitting valid and invalid user names  check if the server responses differ in ANY way (small typographic differences, server response time, etc.)  ALARM on any difference
  • 28. Authentication mechanism  Test resilience to Password Guessing  find ALL locations where user credentials are submitted  e.g. login or badly designed “password change”  try submitting various passwords for a user  after ~10 times, enter valid ones  if all this succeeds – the system is vulnerable, ALARM!
  • 29. Authentication mechanism  Check for unsafe transmission of credentials:  in URL  stored in cookies  if ever transmitted from server to client  creds are vulnerable to session, access control and XXS attacks  should never go over HTTP  if creds are sent over HTTPS but the login page over HTTP  MITM attacks can steal creds, ALARM!
  • 30. Authentication mechanism  Check for insecure storage  check all logs for credentials  or their hashes  check configuration files for clear-text credentials  check for credentials saving on client-side  in logs, in browser or client “autocomplete”, etc  all the points are valid for both client and server side
  • 31. Session Management mechanism  Check for insecure transmission of Session Tokens  under HTTPS, check if Secure flag is set for cookies  verify that HTTP and HTTPS parts of application use different cookies
  • 32. Session Management mechanism  Check Cookie scope - Domain  domain better not be set than set liberally to a domain  e.g. domain=server.com gives the cookie to subdomains  Check Cookie scope - Path  path must include only the webapp for which the cookie is
  • 33. Session Management mechanism  Check for insecure Session tokens storage  when in URL – proxy logs, Referer header, screen   or visible in some logging mechanisms
  • 35. Logic flaws  Check for Fail-Open conditions  whenever the app checks user’s credentials, make a note of all the request parameters  for each parameter, try:  submit an empty string as the value  remove the name/value pair  submit very long and very short values  submit strings instead of numbers, and vice versa  submit the same named parameter multiple times, with the same and different values  notice any unusual behavior? ALARM!
  • 36. Logic flaws  Check Multistage mechanisms  a single action is performed via a fixed series of steps?..  modify the steps to interfere with app’s logic, e.g:  pass all stages, but in a different sequence  go directly to each step in turn, and continue the normal sequence from there  go through the normal steps repeatedly, skipping each single step  be clever and try breaking the multistage process   see anything fishy?... ALARM!
  • 38. Application server vulnerabilities  Check for default content and creds  google info on default config of your specific server  try default server admin accounts  try default management console, UI  nothing irrelevant to the web-app should be present!
  • 39. Application server vulnerabilities  Check for dangerous HTTP Methods  try issuing a TRACE request – shouldn’t work, i.e. shouldn’t return your request to you  try issuing an OPTIONS request – shouldn’t work either  not a vulnerability but may aid attacker, bad practice
  • 40. Process and security RC  don’t be afraid to bother with questions or something suspicious – you are our helping hands  another upside – you’ll definitely learn something new  report every suspicious instance – even if you couldn’t write an exploit  prioritize security RC defects  nothing high or critical from OWASP Top-10