exploiting-sudo-suid-and-cron-misconfigurations

Escalate Linux privileges via sudo rules, SUID binaries, cron jobs, and wildcard injection.

954|172|Updated Mar 13, 2026
One-click install
npx skills add https://github.com/xalgord/xalgorix --skill exploiting-sudo-suid-and-cron-misconfigurations
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: exploiting-sudo-suid-and-cron-misconfigurations
Source: https://github.com/xalgord/xalgorix/tree/main/internal/tools/skills/data/linux-hardening/exploiting-sudo-suid-and-cron-misconfigurations
Command: npx skills add https://github.com/xalgord/xalgorix --skill exploiting-sudo-suid-and-cron-misconfigurations

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

During authorized penetration tests, testers often obtain an unprivileged shell but miss viable privilege escalation paths because they stop at surface-level checks like sudo -l. This Skill provides a systematic methodology for finding and confirming Linux local privilege escalation vectors that are commonly overlooked.

Core Features & Use Cases

  • Sudo Rule Abuse: Exploit GTFOBins shell-outs (vim, less, awk, find) and preserved environment variables (LD_PRELOAD, BASH_ENV, PYTHONPATH) to gain root code execution.
  • SUID/SGID Exploitation: Hijack SUID binaries that call commands without absolute paths via PATH manipulation or exported bash functions, and abuse root-owned wrappers running writable scripts.
  • Cron & Wildcard Injection: Exploit writable cron scripts, cron PATH hijacking, and glob argument injection against privileged tar/rsync/zip/chown/tcpdump invocations.
  • Use Case: After gaining a low-privilege shell on a Linux target, run the enumeration workflow, discover a root cron job running tar -czf backup.tgz * in a writable directory, plant --checkpoint-action files, and obtain a root shell on the next cron run.

Quick Start

Enumerate sudo rules, SUID binaries, and cron jobs on this Linux host and identify a confirmed privilege escalation path to root.

Frequently Asked Questions about exploiting-sudo-suid-and-cron-misconfigurations

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I escalate privileges on Linux using sudo misconfigurations?

Run sudo -l to list allowed commands and preserved environment variables. If a GTFOBins-capable binary like vim, less, awk, or find is allowed, shell out with commands like sudo vim -c '!sh'. If env_keep preserves LD_PRELOAD, compile a shared object that calls setuid(0) and run sudo LD_PRELOAD=/tmp/pe.so <allowed_cmd>.

How to exploit SUID binaries for privilege escalation?

Find SUID binaries with find / -perm -4000 -type f, then inspect them with strings for commands called without absolute paths. Hijack execution by prepending a writable directory to PATH with a trojan of the same name, or export a malicious bash function matching the absolute command path.

What is wildcard argument injection in cron jobs?

Wildcard injection occurs when a privileged script runs a command like tar -czf backup.tgz * over an attacker-writable directory. Filenames beginning with a dash are interpreted as flags, so planting --checkpoint=1 and --checkpoint-action=exec=sh shell.sh causes tar to execute shell.sh as root.

Which tools help enumerate Linux privilege escalation vectors?

Use sudo -l for sudo policy, find with -perm -4000/-2000 for SUID/SGID binaries, and crontab -l plus /etc/cron* inspection for scheduled jobs. pspy watches real process argv without root to catch cron PATH and wildcard abuse, while linpeas automates broad discovery.

When should these privilege escalation techniques be used?

These techniques are intended only for authorized engagements after obtaining an unprivileged shell on a target Linux system. They apply when sudo rules, SUID binaries, cron jobs, or privileged scripts contain misconfigurations, and each vector should be confirmed with a marker such as a SUID bash copy.