Portswigger
  • Portswigger
  • Server-Side Request Forgery
    • Server-Side Request Forgery (SSRF)
  • SSRF with filter bypass via open redirection vulnerability
  • Blind SSRF with out-of-band detection
  • Cross-Site Scripting
    • Cross-Site Scripting (XSS)
  • Reflected XSS into a JS string with angle brackets and double&single quotes HTML-encoded escape
  • XSS into a template literal w/ angle brackets, single, double quotes, backslash & backticks Escaped
  • Authentication
    • Authentication
  • Username enumeration via subtly different responses
  • 2FA broken logic
  • Username enumeration via response timing
  • Username enumeration via account lock
  • Password reset poisoning via middleware
  • Path Traversal
    • Path Traversal
  • File path traversal, traversal sequences stripped with superfluous URL-decode
  • File path traversal, traversal sequences blocked with absolute path bypass
  • Business Logic Vulnerabilities
    • Business Logic Vulnerabilities
  • Insufficient workflow validation
  • Inconsistent handling of exceptional input
  • Server-Side Template Injection
    • Server-Side Template Injection
  • Basic server-side template injection
  • Basic server-side template injection (code context)
  • SQL Injection
    • SQL Injection
    • Blind SQL injection with conditional responses
  • SQL injection UNION attack, retrieving data from other tables
  • SQL injection attack, listing the database contents on non-Oracle databases
  • API Testing
    • API Testing
  • Exploiting an API endpoint using documentation
  • Exploiting a mass assignment vulnerability
  • Finding and exploiting an unused API endpoint
  • JWT ATTACK
    • JWT Attack
    • JWT authentication bypass via unverified signature
  • JWT authentication bypass via jku header injection
  • JWT authentication bypass via flawed signature verification
  • HTTP HOST HEADER ATTACKS
    • HTTP Host header attacks
  • Basic password reset poisoning
  • Host header authentication bypass
  • No SQL Injection
    • NoSQL Injection
  • Detecting NoSQL injection
  • Exploiting NoSQL operator injection to bypass authentication
  • Exploiting NoSQL injection to extract data
  • FILE UPLOAD VULNERABILITIES
    • File Upload Vulnerabilities
  • Web shell upload via obfuscated file extension
  • OAuth Authentication
    • OAuth Authentication
  • OAuth account hijacking via redirect_uri
  • ACCESS CONTROL VULNERABILITIES
    • Access Control Vulnerabilities
  • User ID controlled by request parameter with data leakage in redirect
  • User ID controlled by request parameter with password disclosure
  • User role controlled by request parameter
  • User role can be modified in user profile
  • URL-based access control can be circumvented
  • INFORMATION DISCLOSURE VULNERABILITIES
    • Information Disclosure Vulnerabilities
  • Information disclosure in version control history
  • XML external entity injection
    • XML External Entity (XXE) Injection
  • Exploiting XXE using external entities to retrieve files
  • Exploiting blind XXE to retrieve data via error messages
  • Blind XXE with out-of-band interaction
  • Blind XXE with out-of-band interaction via XML parameter entities
  • OS COMMAND INJECTION
    • OS Command Injection
  • Blind OS command injection with out-of-band data exfiltration
  • PROTOTYPE POLLUTION
    • Prototype Pollution
  • Privilege escalation via server-side prototype pollution
  • WEB CACHE POISONING
    • Web Cache Poisoning
  • Web cache poisoning via an unkeyed query parameter
Powered by GitBook
On this page

Finding and exploiting an unused API endpoint

Link: https://portswigger.net/web-security/api-testing/lab-exploiting-unused-api-endpoint

PreviousExploiting a mass assignment vulnerabilityNextJWT Attack

Last updated 3 months ago

Description:

To solve the lab, exploit a hidden API endpoint to buy a Lightweight l33t Leather Jacket. You can log in to your own account using the following credentials: wiener:peter.

Preparation:

  • Install Content Type Converter extension in Burp Suite

Proof of concept:

  1. Lakukan analisa pada web target menggunakan user testing

  2. Dari hasil analisa, mengakses halaman detail produk maka sistem akan melakukan GET request ke API /api/products/<<id_product>>/price

  3. API tersebut menarik untuk dianalisa. Ubah method request dari GET menjadi OPTIONS agar nantinya mendapatkan informasi mengenai request method mana saja yang dapat digunakan pada endpoint tersebut. Dari hasil tersebut, didapati informasi bahwa terdapat method GET dan PATCH yang dapat digunakan untuk endpoint tersebut

    GET = Mengambil data

    PATCH = Untuk update data

  4. Ubah request method menjadi PATCH dan gunakan extension yang telah diinstal untuk melakukan Convert to JSON

  5. Setelah itu, seperti yang dapat dilihat pada method GET terdapat data parameter price, pada request body inputkan parameter price kemudian inputkan nilai parameter tersebut menjadi “$0”

  6. Dapat dilihat ketika nilai price tersebut diinputkan string menampilkan pesan kesalahan yang memberi tahu bahwa parameter price harus diisi dengan bilangan integer. Maka sekarang inputkan nilai pada parameter price tersebu dengan integer 0 untuk mengubah nilai harga produk tersebut

  7. Dan produk pun berhasil berubah menjadi $0 dan lakukan pembelian barang tersebut untuk menyelesaikan tangtangan lab ini

Thanks, Stay Ethical & Happy Hacking! 🍻