id: privesc-xargs info: name: Xargs - Privilege Escalation author: daffainfo severity: high description: | xargs is a command in Unix and Unix-like operating systems used to build and execute command lines from standard input. reference: - https://gtfobins.github.io/gtfobins/xargs/ metadata: max-request: 3 verified: true tags: code,linux,xargs,privesc,local self-contained: true code: - engine: - sh - bash source: | whoami - engine: - sh - bash source: | xargs -a /dev/null whoami - engine: - sh - bash source: | sudo xargs -a /dev/null whoami matchers-condition: and matchers: - type: word part: code_1_response words: - "root" negative: true - type: dsl dsl: - 'contains(code_2_response, "root")' - 'contains(code_3_response, "root")' condition: or # digest: 490a0046304402205fac35cdd5142e3afd382d38b77be0b7105cfc23884e7ac5cbba8aa91cfc2bb002202b6c7ebae29c5c300052a85a39f3e30b71788d590bc40b797c1ee96c1f00f267:922c64590222798bb761d5b6d8e72950