SlideShare a Scribd company logo
WEB APPLICATION
PENETRATION TESTING
Anurag
Srivastava
Information
Security Researcher
PRE NULL MEET – LUCKNOW
Introduction To Web-
Application Penetration Testing
 Process to check and penetrate the security
of a web application or a website
 process involves an active analysis of the
application for any weaknesses, technical
flaws, or vulnerabilities
 Any security issues that are found will be
presented to the system owner, together
with an assessment of the impact, a
proposal for mitigation or a technical
solution.
Why Web Application
Penetration Testing ?
Common Misnomers
 “Our site is safe”
 We have Firewalls in place
 We encrypt our data
 We have IDS/IPS
 We have a privacy policy
Top Ten Critical Bugs According
To Owasp !
 Injection like Sql ,Os and Ldap
 Broken Authentication And Session
Management
 XSS – Cross Site Scripting
 Insecure Direct Object Reference
 Security Misconfiguration
 Sensitive Data Exposure
 Missing Function level Access Control
 CSRF -Cross Site Request Forgery
 Using Components with Known Vulnerabilities
 Unvalidated Redirects and Forwards
Injection
 Such As Sql,Os and LDAP Injections
 Untrusted data is sent to an
interpreter as part of a command or
query.
 Attacker’s hostile data can trick the
interpreter into executing unintended
commands or accessing data without
proper authorization.
Sql Injection
Trying the basic - 1' or '1'='1 in the
vulnerable input field in order to get the
username,password and confirm the sql
injection vulnerability
Returns true
for all 
Blind Sql Injection
I tried to execute a sql
query in the input field
here
along with a true
return value
I tried to execute the “database() “ to extract the db name.
query
Database
Name
(DVWA)
Am I Vulnerable To 'Injection'?
 Verify that all use of interpreters
clearly separates untrusted data from
the command or query
 Code analysis tools can help a
security analyst find the use of
interpreters and trace the data flow
through the application
 Poor error handling makes injection
flaws easier to discover
XSS – Cross Site Scripting
 Occurs whenever an application takes
untrusted data and sends it to a web
browser without proper validation or
escaping.
 Allows attackers to execute scripts in
the victim’s browser which can hijack
user sessions, deface web sites, or
redirect the user to malicious sites.
Introduction to Web Application Penetration Testing
Payload
Payload used :- <img
src=urloftheimage>
Stored
XSS
Payload used -
<script>alert(document.cookie)<
/script>
Am I Vulnerable To 'Cross-Site
Scripting (XSS)'?
 Vulnerable if you do not ensure that all user
supplied input is properly escaped, or you
do not verify it to be safe via input
validation, before including that input in the
output page.
 If Ajax is being used to dynamically update
the page, are you using
safe JavaScript APIs? For unsafe JavaScript
APIs, encoding or validation must also be
used.
CSRF – Cross Site Request Forgery
 Attack forces a logged-on victim’s browser
to send a forged HTTP request, including
the victim’s session cookie and any other
automatically included authentication
information, to a vulnerable web application
 Allows the attacker to force the victim’s
browser to generate requests the
vulnerable application thinks are legitimate
requests from the victim.
CSRF
Introduction to Web Application Penetration Testing
The Request doesnot have CSRF
token/access token and thus
we can take advantage to generate a
csrf
We are using the same form which our vulnerable website
uses but we are changing the value of the password and
thus resetting the password to anything we wish  ..
<form
action="http://127.0.0.1/dvwa/vulnerabilities/csrf/?"
method="GET"> New password:<br>
<input type="password" AUTOCOMPLETE="off"
name="password_new" value="anurag"><br>
Confirm new password: <br>
<input type="password" AUTOCOMPLETE="off"
name="password_conf" value="anurag"><br>
<input type="submit" value="Change"
name="Change">
</form>
Submitting the
form
Wow ! Password
has been Changed

Am I Vulnerable To 'Cross-Site
Request Forgery (CSRF)'?
 Check if any links and forms lack an
unpredictable CSRF token.
 Without such a token, attackers can forge
malicious requests.
 An alternate defense is to require the user
to prove they intended to submit the
request, either through reauthentication, or
some other proof they are a real user (e.g.,
a CAPTCHA).
Only 10 ?
NO , There are not only
10 but hundreds of
issues that could affect
the overall security of a
web application.
COUNTERMEASURES
 For Injections - Use a safe API which avoids
the use of the interpreter entirely or
provides a parameterized interface.
 For XSS - Properly escape all untrusted
data based on the HTML context (body,
attribute, JavaScript, CSS, or URL) that the
data will be placed into.
 For CSRF - Include the unique token in a
hidden field. Requiring the user to
reauthenticate, or prove they are a user
(e.g., via a CAPTCHA) can also protect
against CSRF.
Thanks !
Anurag Srivastava
Information Source –

More Related Content

PDF
Introduction to Web Application Penetration Testing
PDF
Web PenTest Sample Report
PDF
Web Application Penetration Testing
PPTX
Security testing fundamentals
PDF
PHDays 2018 Threat Hunting Hands-On Lab
PPTX
Basics of statistics
PDF
"DevOps > CI+CD "
PPT
Pentesting Using Burp Suite
Introduction to Web Application Penetration Testing
Web PenTest Sample Report
Web Application Penetration Testing
Security testing fundamentals
PHDays 2018 Threat Hunting Hands-On Lab
Basics of statistics
"DevOps > CI+CD "
Pentesting Using Burp Suite

What's hot (20)

PPTX
Security testing
PPTX
OWASP Top 10 2021 Presentation (Jul 2022)
PDF
Penetration Testing Tutorial | Penetration Testing Tools | Cyber Security Tra...
PPTX
Penetration Testing
PDF
Penetration testing & Ethical Hacking
PPT
Networking and penetration testing
PPTX
Web application security
PDF
Web application security & Testing
PPT
Application Security
PPTX
Ethical Hacking n VAPT presentation by Suvrat jain
PPTX
Penetration testing reporting and methodology
PPTX
Vulnerabilities in modern web applications
PPT
Web Application Security Testing
PPTX
OWASP Top 10 2021 What's New
PPTX
Introduction To Vulnerability Assessment & Penetration Testing
PPTX
Secure coding practices
PPT
Penetration Testing Basics
PPTX
Logging, monitoring and auditing
PPTX
PPTX
WTF is Penetration Testing v.2
Security testing
OWASP Top 10 2021 Presentation (Jul 2022)
Penetration Testing Tutorial | Penetration Testing Tools | Cyber Security Tra...
Penetration Testing
Penetration testing & Ethical Hacking
Networking and penetration testing
Web application security
Web application security & Testing
Application Security
Ethical Hacking n VAPT presentation by Suvrat jain
Penetration testing reporting and methodology
Vulnerabilities in modern web applications
Web Application Security Testing
OWASP Top 10 2021 What's New
Introduction To Vulnerability Assessment & Penetration Testing
Secure coding practices
Penetration Testing Basics
Logging, monitoring and auditing
WTF is Penetration Testing v.2
Ad

Viewers also liked (20)

PDF
Penetration testing web application web application (in) security
PDF
Axoss Web Application Penetration Testing Services
PPTX
Web application penetration testing
PPTX
Web Application Penetration Testing Introduction
PPTX
«How to start in web application penetration testing» by Maxim Dzhalamaga
PDF
Livro juris consolidada(4)
PPSX
Gıda Mühendisleri İstihdam Analizi Anketi Sonuç Bildirgesi
PDF
Blogging for a Cause
PDF
Social Media for Elementary
PDF
Social Media for Coaches
PDF
Informationsmöte förskoleklass inför läsår 15-16
PDF
Blogging for Your Business
PDF
How to work with bloggers
PDF
Live Streaming on WordPress
PDF
Föräldramöte 130911
PPTX
Religion
PDF
Föräldramöte 130821
PDF
End Hunger - Meet Kate
PDF
Infomöte 140609 1-4
PDF
Week 1 & 2: Lean Blogging: Developing the MVB
Penetration testing web application web application (in) security
Axoss Web Application Penetration Testing Services
Web application penetration testing
Web Application Penetration Testing Introduction
«How to start in web application penetration testing» by Maxim Dzhalamaga
Livro juris consolidada(4)
Gıda Mühendisleri İstihdam Analizi Anketi Sonuç Bildirgesi
Blogging for a Cause
Social Media for Elementary
Social Media for Coaches
Informationsmöte förskoleklass inför läsår 15-16
Blogging for Your Business
How to work with bloggers
Live Streaming on WordPress
Föräldramöte 130911
Religion
Föräldramöte 130821
End Hunger - Meet Kate
Infomöte 140609 1-4
Week 1 & 2: Lean Blogging: Developing the MVB
Ad

Similar to Introduction to Web Application Penetration Testing (20)

PPT
WebApps_Lecture_15.ppt
PPT
Security 101
PDF
Web application sec_3
PDF
Sql Injection and XSS
PPTX
Cyber ppt
PPT
Secure code practices
PPTX
Hackers versus Developers and Secure Web Programming
PPT
Web security 2010
PPT
PDF
OWASP Evening #10
PDF
OWASP Evening #10 Serbia
PPTX
Top web apps security vulnerabilities
PPTX
ASP.NET security vulnerabilities
PPTX
Securing the Web @RivieraDev2016
PDF
Top 10 Web App Security Risks
PDF
T04505103106
PPTX
ASP.NET Web Security
PPTX
Getting Started with API Security Testing
PPTX
Web application Security tools
WebApps_Lecture_15.ppt
Security 101
Web application sec_3
Sql Injection and XSS
Cyber ppt
Secure code practices
Hackers versus Developers and Secure Web Programming
Web security 2010
OWASP Evening #10
OWASP Evening #10 Serbia
Top web apps security vulnerabilities
ASP.NET security vulnerabilities
Securing the Web @RivieraDev2016
Top 10 Web App Security Risks
T04505103106
ASP.NET Web Security
Getting Started with API Security Testing
Web application Security tools

Recently uploaded (20)

PPTX
lesson6-211001025531lesson plan ppt.pptx
PPTX
Introduction-to-Food-Packaging-and-packaging -materials.pptx
PPTX
Anesthesia and it's stage with mnemonic and images
PPTX
AcademyNaturalLanguageProcessing-EN-ILT-M02-Introduction.pptx
PPTX
Human Mind & its character Characteristics
PPTX
Self management and self evaluation presentation
PPTX
Hydrogel Based delivery Cancer Treatment
PPTX
Relationship Management Presentation In Banking.pptx
PPTX
Tablets And Capsule Preformulation Of Paracetamol
PPTX
Tour Presentation Educational Activity.pptx
PPTX
chapter8-180915055454bycuufucdghrwtrt.pptx
PPTX
An Unlikely Response 08 10 2025.pptx
PPTX
The Effect of Human Resource Management Practice on Organizational Performanc...
PPT
The Effect of Human Resource Management Practice on Organizational Performanc...
PDF
oil_refinery_presentation_v1 sllfmfls.pdf
DOC
LSTM毕业证学历认证,利物浦大学毕业证学历认证怎么认证
PPTX
fundraisepro pitch deck elegant and modern
DOCX
ENGLISH PROJECT FOR BINOD BIHARI MAHTO KOYLANCHAL UNIVERSITY
PPTX
_ISO_Presentation_ISO 9001 and 45001.pptx
PPTX
MERISTEMATIC TISSUES (MERISTEMS) PPT PUBLIC
lesson6-211001025531lesson plan ppt.pptx
Introduction-to-Food-Packaging-and-packaging -materials.pptx
Anesthesia and it's stage with mnemonic and images
AcademyNaturalLanguageProcessing-EN-ILT-M02-Introduction.pptx
Human Mind & its character Characteristics
Self management and self evaluation presentation
Hydrogel Based delivery Cancer Treatment
Relationship Management Presentation In Banking.pptx
Tablets And Capsule Preformulation Of Paracetamol
Tour Presentation Educational Activity.pptx
chapter8-180915055454bycuufucdghrwtrt.pptx
An Unlikely Response 08 10 2025.pptx
The Effect of Human Resource Management Practice on Organizational Performanc...
The Effect of Human Resource Management Practice on Organizational Performanc...
oil_refinery_presentation_v1 sllfmfls.pdf
LSTM毕业证学历认证,利物浦大学毕业证学历认证怎么认证
fundraisepro pitch deck elegant and modern
ENGLISH PROJECT FOR BINOD BIHARI MAHTO KOYLANCHAL UNIVERSITY
_ISO_Presentation_ISO 9001 and 45001.pptx
MERISTEMATIC TISSUES (MERISTEMS) PPT PUBLIC

Introduction to Web Application Penetration Testing

  • 2. Introduction To Web- Application Penetration Testing  Process to check and penetrate the security of a web application or a website  process involves an active analysis of the application for any weaknesses, technical flaws, or vulnerabilities  Any security issues that are found will be presented to the system owner, together with an assessment of the impact, a proposal for mitigation or a technical solution.
  • 3. Why Web Application Penetration Testing ? Common Misnomers  “Our site is safe”  We have Firewalls in place  We encrypt our data  We have IDS/IPS  We have a privacy policy
  • 4. Top Ten Critical Bugs According To Owasp !  Injection like Sql ,Os and Ldap  Broken Authentication And Session Management  XSS – Cross Site Scripting  Insecure Direct Object Reference  Security Misconfiguration  Sensitive Data Exposure  Missing Function level Access Control  CSRF -Cross Site Request Forgery  Using Components with Known Vulnerabilities  Unvalidated Redirects and Forwards
  • 5. Injection  Such As Sql,Os and LDAP Injections  Untrusted data is sent to an interpreter as part of a command or query.  Attacker’s hostile data can trick the interpreter into executing unintended commands or accessing data without proper authorization.
  • 7. Trying the basic - 1' or '1'='1 in the vulnerable input field in order to get the username,password and confirm the sql injection vulnerability Returns true for all 
  • 8. Blind Sql Injection I tried to execute a sql query in the input field here along with a true return value
  • 9. I tried to execute the “database() “ to extract the db name. query Database Name (DVWA)
  • 10. Am I Vulnerable To 'Injection'?  Verify that all use of interpreters clearly separates untrusted data from the command or query  Code analysis tools can help a security analyst find the use of interpreters and trace the data flow through the application  Poor error handling makes injection flaws easier to discover
  • 11. XSS – Cross Site Scripting  Occurs whenever an application takes untrusted data and sends it to a web browser without proper validation or escaping.  Allows attackers to execute scripts in the victim’s browser which can hijack user sessions, deface web sites, or redirect the user to malicious sites.
  • 14. Payload used :- <img src=urloftheimage> Stored XSS
  • 16. Am I Vulnerable To 'Cross-Site Scripting (XSS)'?  Vulnerable if you do not ensure that all user supplied input is properly escaped, or you do not verify it to be safe via input validation, before including that input in the output page.  If Ajax is being used to dynamically update the page, are you using safe JavaScript APIs? For unsafe JavaScript APIs, encoding or validation must also be used.
  • 17. CSRF – Cross Site Request Forgery  Attack forces a logged-on victim’s browser to send a forged HTTP request, including the victim’s session cookie and any other automatically included authentication information, to a vulnerable web application  Allows the attacker to force the victim’s browser to generate requests the vulnerable application thinks are legitimate requests from the victim.
  • 18. CSRF
  • 20. The Request doesnot have CSRF token/access token and thus we can take advantage to generate a csrf
  • 21. We are using the same form which our vulnerable website uses but we are changing the value of the password and thus resetting the password to anything we wish  .. <form action="http://127.0.0.1/dvwa/vulnerabilities/csrf/?" method="GET"> New password:<br> <input type="password" AUTOCOMPLETE="off" name="password_new" value="anurag"><br> Confirm new password: <br> <input type="password" AUTOCOMPLETE="off" name="password_conf" value="anurag"><br> <input type="submit" value="Change" name="Change"> </form>
  • 23. Wow ! Password has been Changed 
  • 24. Am I Vulnerable To 'Cross-Site Request Forgery (CSRF)'?  Check if any links and forms lack an unpredictable CSRF token.  Without such a token, attackers can forge malicious requests.  An alternate defense is to require the user to prove they intended to submit the request, either through reauthentication, or some other proof they are a real user (e.g., a CAPTCHA).
  • 25. Only 10 ? NO , There are not only 10 but hundreds of issues that could affect the overall security of a web application.
  • 26. COUNTERMEASURES  For Injections - Use a safe API which avoids the use of the interpreter entirely or provides a parameterized interface.  For XSS - Properly escape all untrusted data based on the HTML context (body, attribute, JavaScript, CSS, or URL) that the data will be placed into.  For CSRF - Include the unique token in a hidden field. Requiring the user to reauthenticate, or prove they are a user (e.g., via a CAPTCHA) can also protect against CSRF.