Prepared By:
- Khaled Atef Anter
- Noor Hossam Eldeen
- Moaaz Awad Ali
- Mahmoud Rashed
- Aya Elsayed
- Salma Elgohary
Hack The Box Machine “Lantern”
Project Duration:
9/10/2024 - 20/10/2024
- Executive Summary
- Compliance Framework Used
- Vulnerability Checklist
- Methodology
- Assessment Tools
- Proof of Concept (PoCs)
- Recommendations
- Conclusion
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.
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 | 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. |
-
Reconnaissance:
- Passive reconnaissance (social media, public resources).
- Active reconnaissance using Nmap for service discovery.
-
Scanning:
- Identified open ports and running services.
- Performed vulnerability scanning for misconfigurations.
-
Exploitation:
- Tested vulnerabilities like RCE, SSRF, and path traversal.
- Validated access control weaknesses.
-
Focus Areas:
- Authentication and authorization mechanisms.
- File upload functionality.
- Vulnerable third-party components.
-
Reporting:
- Documented findings with PoC, impact, and recommendations.
- 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.
- Description: Admin access obtained via privilege escalation.
- Steps:
- Nmap revealed port 3000 with admin login.
- Manipulated requests using “X-Skipper-Proxy”.
- Description: Exploited CVE-2022-38580 in Skipper Proxy.
- Steps: Verified vulnerable component version and crafted requests.
- Description: Malicious DLL file uploads allowed arbitrary code execution.
- Steps:
- Uploaded DLL file via Blazor, gained SSH access.
- Description: Manipulated server requests to access internal endpoints.
- Steps:
- Intercepted and modified server requests using Burp Suite.
- Description: Accessed
/etc/passwdvia manipulated file paths. - Steps:
- Edited URL parameters to traverse directories.
-
Broken Access Control:
- Implement RBAC, session validation, and unauthorized access logging.
-
RCE via File Upload:
- Validate file types, restrict upload directories, and use antivirus scanning.
-
SSRF:
- Validate and sanitize inputs; use URL allowlists.
-
Known Vulnerabilities:
- Regularly update dependencies and automate security alerts.
-
Path Traversal:
- Sanitize inputs, restrict file paths, and enforce directory whitelists.
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:
- Implementing RBAC.
- Updating vulnerable components.
- Hardening file upload mechanisms.
- Enhancing input validation.
Next Steps:
- Apply fixes and conduct re-testing.
- Establish continuous security monitoring and improvement processes.