[LINPEAS] Add privilege escalation check: HTB Era – IDORs, PHP ssh2.exec Wrapper R... #525
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 relevant local privilege escalation in this walkthrough is: "From there, I’ll create my own signed binary to replace one that I can run with sudo to get root" and the earlier summary mentioning "a custom ELF signature mechanism to achieve full system compromise" and "Custom-Signed Binary Privilege Escalation". This indicates a local privesc pattern where:
This is not exploiting a kernel bug or a generic widely-deployed third‑party package, but a custom application logic and signing workflow specifically built for this HTB machine (custom signature mechanism, custom-signed binary, custom sudoable binary to swap). That falls in the category the instructions explicitly exclude: a highly custom configuration typical of CTF-style setups, dependent on bespoke scripts/binaries and on access to custom signing material recovered via a web IDOR. While the high-level class of issue (misconfigured trusted binary/signing pipeline) is real-world relevant, the concrete technique here depends on custom file locations, custom key material, and a particular sudo rule, none of which can be generically scanned for by linpeas without being so broad as to be noisy and not directly actionable.
The remaining parts of the blog (IDOR in webapp, PHP ssh2.exec wrapper abuse to gain the initial shell, credential reuse, SQLite hash cracking, etc.) are remote/web exploitation and initial access patterns, not local privilege escalation from an unprivileged OS user. Therefore, although the box includes a privesc step, it’s too custom/CTF‑specific to be a robust, automatable check for linpeas.
🤖 Implementation Details
PEASS linpeas agent completed successfully with 68 items. Agent Comment: Summary:
IP_Writable_root_execs(linPEAS/builder/linpeas_parts/8_interesting_perms_files/16_Writable_root_execs.sh) that enumerates root-owned executables outside user home directories that the current user can actually write to (via group/world permissions). The listing is limited to 200 entries and highlights risky paths, making issues like the writablemonitorbinary from the Era box immediately visible.Testing:
sh -n linPEAS/builder/linpeas_parts/8_interesting_perms_files/16_Writable_root_execs.shNo additional documentation updates were required because the new check follows the existing “Interesting Permissions Files” conventions.
🏗️ Builder Agent Response
LinPEAS build agent completed successfully with 14 items. Agent Comment: Build completed successfully—no issues were encountered.
Actions performed
/tmp/hacktricks_update_peuozgu2/repo/linPEAS.python3 -m builder.linpeas_builder --all --output /tmp/linpeas_fat.sh(39 s, exit code 0). The builder passed all stages (module syntax check, section generation, regex downloads, external tool fetches, sanity checks) without errors./tmp/linpeas_fat.shexists with the expected permissions and size (~16 MB).No fixes were necessary, and LinPEAS now builds cleanly using the specified command. Let me know if you’d like any further checks or a smaller build variant.
This PR was automatically created by the HackTricks Feed Bot. Please review the implementation carefully and test thoroughly before merging.