[LINPEAS] Add privilege escalation check: HackTheBox Editor Unauthenticated XWiki ... #527
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 blog describes a local Linux privilege escalation via Netdata's ndsudo helper (CVE-2024-32019). ndsudo is a SUID-root (or otherwise privileged) wrapper that runs a fixed set of sub-commands, but on vulnerable versions it resolves those sub-commands purely via the PATH environment. Any user allowed to invoke ndsudo can place a malicious binary (e.g., named 'nvme') in a writable directory and then run:
PATH=/dev/shm:$PATH /path/to/ndsudo nvme-list
ndsudo will pick up and execute the attacker's 'nvme' as root, giving arbitrary root code execution. This is a generic and realistic local PATH hijack pattern against a widely deployed monitoring tool (Netdata), not a custom CTF-only configuration and not an esoteric third‑party app. It is therefore appropriate for automated enumeration in linpeas.
Other content:
The notable new, concrete, automatable privesc path is the Netdata ndsudo PATH injection on Linux.
🤖 Implementation Details
PEASS linpeas agent completed successfully with 86 items. Agent Comment: Summary:
linPEAS/builder/linpeas_parts/8_interesting_perms_files/16_Netdata_ndsudo.sh) that locates Netdata’sndsudohelper (via PATH plus common install directories), verifies it is root-owned SUID and executable by the current user, parses its help output to list the logical commands and underlying executables it resolves throughPATH, highlights writable directories suitable for hijacking, and prints a ready-to-use exploitation snippet along with the fixed Netdata versions.linPEAS/README.mdunder a “What’s new” section so users know linPEAS now reports potential NetdatandsudoPATH injection (CVE-2024-32019).Testing:
bash -n linPEAS/builder/linpeas_parts/8_interesting_perms_files/16_Netdata_ndsudo.sh🏗️ Builder Agent Response
LinPEAS build agent completed successfully with 47 items. Agent Comment: ✅ LinPEAS build is now successful.
What I did:
/tmp/hacktricks_update_sxpcrzlj/repo/linPEAS, which initially failed because the new Netdata ndsudo module referenced several shell variables that weren’t declared in its metadata.builder/linpeas_parts/8_interesting_perms_files/16_Netdata_ndsudo.shto list the environment variables it consumes ($SEARCH_IN_FOLDER,$HOME,$PATH) and to declare every module-scoped variable it generates ($ndsudo_candidates,$guess_path,$found_paths,$guess_dir,$ndsudo_bin,$perm_info,$owner,$group,$perms,$ndsudo_help,$command_list,$exec_list,$writable_dirs,$hijack_dir,$default_exec,$default_cmd). This satisfies the linpeas builder’s metadata validation.python3 -m builder.linpeas_builder --all --output /tmp/linpeas_fat.shwith a 600 s timeout; it completed successfully in ~72 seconds, producing the fat linpeas script at/tmp/linpeas_fat.sh.No further errors remain, and the build artifact is ready for downstream use. Let me know if you’d like the resulting script copied elsewhere or need any additional verification.
This PR was automatically created by the HackTricks Feed Bot. Please review the implementation carefully and test thoroughly before merging.