gawk - Privilege Escalation
ID: privesc-gawk
Severity: high
Author: daffainfo
Tags: code,linux,gawk,privesc,local
Description
Section titled “Description”gawk is the GNU implementation of the AWK programming language. It is a powerful text processing tool that allows for pattern scanning and processing of text files. gawk is commonly used for data extraction, reporting, and manipulation tasks in shell scripts and command-line environments.
YAML Source
Section titled “YAML Source”id: privesc-gawk
info: name: gawk - Privilege Escalation author: daffainfo severity: high description: | gawk is the GNU implementation of the AWK programming language. It is a powerful text processing tool that allows for pattern scanning and processing of text files. gawk is commonly used for data extraction, reporting, and manipulation tasks in shell scripts and command-line environments. reference: - https://gtfobins.github.io/gtfobins/gawk/ metadata: verified: true max-request: 3 tags: code,linux,gawk,privesc,local
self-contained: truecode: - engine: - sh - bash source: | whoami
- engine: - sh - bash source: | gawk 'BEGIN {system("whoami")}'
- engine: - sh - bash source: | sudo gawk 'BEGIN {system("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: 4a0a0047304502206b9e8fcc119a7ffc6dde1bc0be376e9ed77b45753332eaeabbc0c4a1cdf23f11022100babde41ad35d643b740249fcdb659919c266c55726566d53376eaeb98a2bf6a2:922c64590222798bb761d5b6d8e72950Guide to check the vulnerabilities
Section titled “Guide to check the vulnerabilities”This template is used to detect vulnerabilities in web applications. It can be used with the Nuclei tool to scan for specific patterns or behaviors.
$ nuclei -u "URL" -t "code/privilege-escalation/linux/binary/privesc-gawk.yaml"