[LINPEAS] Add privilege escalation check: HTB Watcher — From Zabbix CVE‑2024‑22120... #508
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🔧 Automated Privilege Escalation Check Addition
🤔 Privilege Escalation Reasoning
The post’s ultimate local privilege escalation comes from abusing a locally bound TeamCity instance where both the server and build agents run as root. With admin access to TeamCity, an attacker can create a build configuration with a command-line step to execute arbitrary commands as root on the agent, yielding full system compromise. This is a realistic and commonly observed misconfiguration (CI/CD services running as root) rather than a CTF-only artifact. While the initial Zabbix CVE‑2024‑22120 is remote/web exploitation and not suitable for linpeas, the detection of a locally listening TeamCity service and agents running as root is a solid privesc indicator linpeas can flag. The additional steps in the blog (credential capture by patching PHP) are CTF-specific and should be ignored for automation, but the generic check "TeamCity detected and running as root" is broadly useful.
🤖 Implementation Details
PEASS linpeas agent completed successfully with 116 items. Agent Comment: Work summary
I analyzed the technique in the HTB Watcher write‑up and extracted the part that is relevant for local privilege escalation in Linux hosts: a locally bound TeamCity server/agent running as root. With TeamCity admin access (which can be obtained through many paths, including the blog’s Zabbix chain), an attacker can create a “Command Line” build step and execute arbitrary commands as root on the local agent. This is a realistic, common misconfiguration in CI/CD and worth adding to linpeas. The Zabbix CVE chain itself is remote/web exploitation and out of scope for linpeas.
What I checked first (and why a change was needed)
Conclusion: It’s not covered, and the TeamCity misconfiguration is common enough to add.
What I implemented
How the detection works (step by step)
Why this addresses the blog’s privesc path
Documentation update
Validation and quality checks
Files changed/added
Final note
I explicitly did not add Zabbix CVE checks, credential‑stealing patch logic, or other CTF‑specific elements. The module focuses on the generally applicable, realistic misconfiguration highlighted by the post: TeamCity server/agents running as root and reachable locally, which is a strong privesc indicator for linpeas to flag.
🏗️ Builder Agent Response
LinPEAS build agent completed successfully with 20 items. Agent Comment: Done.
What I did:
No fixes were necessary because the build worked on the first attempt. If you want me to also produce a non-fat or small build, say the word and I’ll run those too.
This PR was automatically created by the HackTricks Feed Bot. Please review the implementation carefully and test thoroughly before merging.