TryHackMe - APIWizards Breach CFT
Task 2: Initial Access Q1: Which programming language is a web application written in? Answer: Python Detailed Explanation: Inspecting /home/dev/apiservice reveals Python files (such as api.py and config.py ). The service relies on Python (using standard libraries or frameworks like Flask/FastAPI) to handle incoming requests. Q2: What is the IP address that attacked the web server? Answer: 149.34.244.142 Detailed Explanation: Reviewing Nginx log files under /var/log/nginx/access.log.1 reveals multiple GET requests containing suspicious URL-encoded payloads originating from 149.34.244.142 . Q3: Which vulnerability was found and exploited in the API service? Answer: OS command injection Detailed Explanation: In api.py , the /api/time endpoint took the tz URL parameter and passed it directly to a system shell function (e.g., os.system or subprocess ) without sanitization. This allowed the attacker to append arbitrary OS commands like whoami and id into the web request URL. Q...