Skip to content

About

A detailed penetration testing report of the HTB Lantern Machine, leveraging the OWASP Top 10 framework. Includes vulnerability analysis, Proof of Concepts (PoCs), methodology, and remediation steps. A collaborative project showcasing advanced pentesting techniques.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Pentesting Report for HTB Lantern Machine (DEPI)

Instructor: Mamdouh El-Tahiry

Company: Harvest

Group Code: DKH_ISS5_M1d

Prepared By:

  • Khaled Atef Anter
  • Noor Hossam Eldeen
  • Moaaz Awad Ali
  • Mahmoud Rashed
  • Aya Elsayed
  • Salma Elgohary

Title

Hack The Box Machine “Lantern”

Project Duration:
9/10/2024 - 20/10/2024


Table of Contents

  1. Executive Summary
  2. Compliance Framework Used
  3. Vulnerability Checklist
  4. Methodology
  5. Assessment Tools
  6. Proof of Concept (PoCs)
  7. Recommendations
  8. Conclusion

Executive Summary

This report documents a detailed penetration test on the HTB Lantern Machine, conducted using the OWASP Top 10 Framework. The assessment uncovered critical vulnerabilities such as:

  • Broken Access Control
  • Remote Code Execution (RCE)
  • Server-Side Request Forgery (SSRF)
  • File Upload Vulnerabilities
  • Path Traversal
  • CVE-2022-38580 Exploitation (Skipper Proxy)

These vulnerabilities expose the system to risks like unauthorized access, code execution, and sensitive data leakage. Each vulnerability is detailed, including proof of concept (PoC) and remediation recommendations.


Compliance Framework Used

Framework: OWASP Top 10
The focus was primarily on web application vulnerabilities to identify risks associated with Lantern's implementation.

Key Identified Vulnerabilities:

  • Broken Access Control: Unauthorized admin access via privilege escalation.
  • Using Components with Known Vulnerabilities: Exploitation of CVE-2022-38580.
  • Remote Code Execution (RCE): Malicious file uploads leading to server control.
  • Server-Side Request Forgery (SSRF): Manipulation of server requests.
  • Path Traversal: Unauthorized access to sensitive server files.

Vulnerability Checklist

Vulnerability Severity Description Impact Remediation
Broken Access Control Critical Bypass of authentication mechanisms, enabling unauthorized access. Data breaches, system compromise. Implement role-based access control (RBAC), consistent access control checks.
Using Components with Known Vulnerabilities (CVE-2022-38580) High Exploitation of outdated Skipper Proxy versions. Unauthorized access, data manipulation. Update components; use automated tools for dependency management.
Remote Code Execution (RCE) Critical File upload vulnerability allowing malicious scripts. Full server control. Enforce file validation rules, restrict file types, secure upload directories.
Server-Side Request Forgery (SSRF) Medium Manipulation of server requests to access internal services. Unauthorized internal service access. Restrict server requests, validate inputs, employ URL allowlists.
Path Traversal Medium File path manipulation to access unauthorized files. Exposure of sensitive files, privilege escalation. Validate file paths, restrict accessible directories, implement whitelists.

Methodology

  1. Reconnaissance:

    • Passive reconnaissance (social media, public resources).
    • Active reconnaissance using Nmap for service discovery.
  2. Scanning:

    • Identified open ports and running services.
    • Performed vulnerability scanning for misconfigurations.
  3. Exploitation:

    • Tested vulnerabilities like RCE, SSRF, and path traversal.
    • Validated access control weaknesses.
  4. Focus Areas:

    • Authentication and authorization mechanisms.
    • File upload functionality.
    • Vulnerable third-party components.
  5. Reporting:

    • Documented findings with PoC, impact, and recommendations.

Assessment Tools

  • Web Browser: Manual exploration and interaction.
  • Burp Suite: HTTP request analysis and vulnerability identification.
  • Nmap: Network scanning and service enumeration.
  • Feroxbuster: Directory and file brute-forcing.
  • Blazor Traffic Processor: Blazor application traffic analysis.
  • CyberChef: Data decoding and analysis.
  • SQLite3: Database exploration and query execution.
  • DotPeek: .NET decompilation and source code analysis.

Proof of Concept (PoCs)

1. Broken Access Control

  • Description: Admin access obtained via privilege escalation.
  • Steps:
    • Nmap revealed port 3000 with admin login.
    • Manipulated requests using “X-Skipper-Proxy”.

2. Using Components with Known Vulnerabilities

  • Description: Exploited CVE-2022-38580 in Skipper Proxy.
  • Steps: Verified vulnerable component version and crafted requests.

3. Remote Code Execution (RCE)

  • Description: Malicious DLL file uploads allowed arbitrary code execution.
  • Steps:
    • Uploaded DLL file via Blazor, gained SSH access.

4. Server-Side Request Forgery (SSRF)

  • Description: Manipulated server requests to access internal endpoints.
  • Steps:
    • Intercepted and modified server requests using Burp Suite.

5. Path Traversal

  • Description: Accessed /etc/passwd via manipulated file paths.
  • Steps:
    • Edited URL parameters to traverse directories.

Recommendations

  1. Broken Access Control:

    • Implement RBAC, session validation, and unauthorized access logging.
  2. RCE via File Upload:

    • Validate file types, restrict upload directories, and use antivirus scanning.
  3. SSRF:

    • Validate and sanitize inputs; use URL allowlists.
  4. Known Vulnerabilities:

    • Regularly update dependencies and automate security alerts.
  5. Path Traversal:

    • Sanitize inputs, restrict file paths, and enforce directory whitelists.

Conclusion

The assessment identified critical vulnerabilities in the HTB Lantern Machine, including Broken Access Control, RCE, SSRF, Path Traversal, and CVE-2022-38580 exploitation. Immediate remediation steps include:

  1. Implementing RBAC.
  2. Updating vulnerable components.
  3. Hardening file upload mechanisms.
  4. Enhancing input validation.

Next Steps:

  • Apply fixes and conduct re-testing.
  • Establish continuous security monitoring and improvement processes.

About

A detailed penetration testing report of the HTB Lantern Machine, leveraging the OWASP Top 10 framework. Includes vulnerability analysis, Proof of Concepts (PoCs), methodology, and remediation steps. A collaborative project showcasing advanced pentesting techniques.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors