️ OWASP API Top 10 — TryHackMe Walkthrough (Part 2)
好的,我现在要帮用户总结这篇文章的内容。用户的要求是用中文总结,控制在100字以内,不需要特定的开头,直接写描述。 首先,我需要通读整篇文章,了解其主要内容。文章分为两部分,第一部分讨论了核心API漏洞,如BOLA、身份验证问题和数据泄露。第二部分转向后端问题,包括数据处理不当、配置错误、注入攻击、遗留API暴露和日志故障。 接下来,我需要提取关键点:文章分为两部分,第一部分讲核心漏洞,第二部分深入后端安全问题。每种漏洞都有例子和修复方法。最后强调了信任输入和配置错误带来的风险。 现在我要把这些信息浓缩到100字以内。确保涵盖主要漏洞类型、影响以及修复措施,并突出从用户层面到后端系统的转变。 可能的结构:文章分两部分探讨API安全问题。第一部分讲核心漏洞如BOLA和身份验证问题。第二部分深入后端问题如注入攻击、配置错误等。每种漏洞都有示例和修复方法。结论强调信任输入和配置错误的风险。 最后检查字数是否在限制内,并确保语言简洁明了。 </think> 文章分两部分探讨API安全问题:第一部分聚焦核心漏洞如BOLA、身份验证失效等;第二部分深入后端风险,包括注入攻击、配置错误、日志缺陷等。每种漏洞均配以示例及修复建议,强调信任输入与配置不当的危害。 2026-4-11 15:46:56 Author: infosecwriteups.com(查看原文) 阅读量:1 收藏

📌 Introduction

In Part 1, we explored core API vulnerabilities like BOLA, Broken Authentication, and Data Exposure. These primarily revolved around authorization and authentication flaws.

Now in Part 2, things get more backend-heavy and dangerous — focusing on:

  • Improper data handling
  • Misconfigurations
  • Injection attacks
  • Legacy API exposure
  • Logging failures

👉 APIs are the backbone of modern applications, and misconfigurations here can lead to full system compromise ([TryHackMe][1])

Press enter or click to view image in full size

📌 Task 1 — Environment Setup

We start by launching the TryHackMe machine which includes:

  • Windows VM
  • Talend API Tester
  • Laravel-based vulnerable APIs

This setup allows us to simulate real-world API exploitation scenarios instead of just theory.

📌 Task 2 — Vulnerability VI: Mass Assignment

🧠 Understanding the Vulnerability

Mass Assignment occurs when backend frameworks automatically bind user input to database fields.

👉 If not filtered properly, attackers can inject extra parameters and manipulate data.

⚔️ Exploitation

We attempt to create a user but include a hidden field:

POST /apirule6/user
name=attacker&username=hacker&password=pass123&credit=1000

➡️ Here, credit should NOT be user-controlled.

➡️ But due to mass assignment, backend blindly accepts it.

💥 Impact

  • Privilege escalation
  • Data tampering
  • Business logic abuse

🔐 Fix

  • Use allowlist (fillable)
  • Block sensitive fields (guarded)
  • Never trust client-side input

✅ Result

Even when we send credit=1000, secure endpoint enforces:

➡️ Final credit → 50

📌 Task 3 — Vulnerability VII: Security Misconfiguration

🧠 Understanding the Vulnerability

Security misconfiguration happens when:

  • Debug mode is enabled
  • Error messages expose internals
  • Default configs are not hardened

⚔️ Exploitation

Triggering an error:

GET /apirule7/ping_v

➡️ Instead of a clean response, we get full stack trace.

💥 Impact

  • File paths exposed
  • Internal architecture revealed
  • Helps attackers plan targeted attacks

🔐 Fix

  • Disable debug in production
  • Implement proper error handling
  • Hide stack traces

✅ Result

  • HTTP Code → 500
  • Error ID → 1401

📌 Task 4 — Vulnerability VIII: Injection

🧠 Understanding the Vulnerability

Injection occurs when user input is directly executed by backend queries.

Get Aditya Bhatt’s stories in your inbox

Join Medium for free to get updates from this writer.

Remember me for faster sign in

👉 Classic example: SQL Injection

⚔️ Exploitation

We bypass login using:

POST /apirule8/user/login_v
username=admin&password=' OR 1=1--

➡️ ' OR 1=1-- makes condition always true ➡️ Authentication bypass achieved 🗿

💥 Impact

  • Authentication bypass
  • Data extraction
  • Remote Code Execution (in severe cases)

🔐 Fix

  • Parameterized queries
  • Input validation
  • ORM usage

✅ Result

Secure endpoint returns:

➡️ 403 Forbidden

📌 Task 5 — Vulnerability IX: Improper Assets Management

🧠 Understanding the Vulnerability

Old API versions often remain active and become forgotten attack surfaces.

⚔️ Exploitation

We target deprecated API:

POST /apirule9/v1/user/login
username=Alice&password=##!@#!!

➡️ Old API leaks extra sensitive data.

Press enter or click to view image in full size

💥 Impact

  • Sensitive data leakage
  • Access to outdated insecure logic
  • Potential full system compromise

🔐 Fix

  • Remove deprecated APIs
  • Maintain API inventory
  • Use proper versioning

✅ Result

  • Balance → 100
  • Country → USA

📌 Task 6 — Vulnerability X: Insufficient Logging & Monitoring

🧠 Understanding the Vulnerability

If logging is weak or missing:

➡️ Attacks happen silently

➡️ No traceability

⚔️ Exploitation

Trigger logging endpoint:

GET /apirule10/logging

➡️ Logs metadata like IP, browser, etc.

💥 Impact

  • No forensic evidence
  • Delayed detection
  • Persistent attacker presence

🔐 Fix

  • Implement SIEM systems
  • Log all critical actions
  • Monitor anomalies

✅ Result

➡️ HTTP Response → 200

📌 Conclusion

This part highlights a crucial shift:

👉 From user-level vulnerabilities → backend/system-level failures

Press enter or click to view image in full size

🧠 Final Insights

Across both parts, a pattern emerges:

  • Trusting input → Injection / Mass Assignment
  • Poor configs → Info leaks
  • Legacy systems → Hidden attack surfaces
  • No monitoring → Undetected breaches

🚀 Final Take

APIs don’t fail because they’re complex — they fail because developers trust too much and validate too little.


文章来源: https://infosecwriteups.com/%EF%B8%8F-owasp-api-top-10-tryhackme-walkthrough-part-2-b9d1100e2660?source=rss----7b722bfd1b8d---4
如有侵权请联系:admin#unsafe.sh