49 lines
1.3 KiB
YAML
49 lines
1.3 KiB
YAML
id: privesc-nawk
|
|
|
|
info:
|
|
name: nawk - Privilege Escalation
|
|
author: daffainfo
|
|
severity: high
|
|
description: |
|
|
nawk is an implementation of the AWK programming language. It is a text-processing language that is commonly used for pattern scanning and processing of text files. nawk provides powerful features for data extraction, reporting, and manipulation, making it a valuable tool for text processing tasks in shell scripts and command-line environments.
|
|
reference:
|
|
- https://gtfobins.github.io/gtfobins/nawk/
|
|
metadata:
|
|
verified: true
|
|
max-request: 3
|
|
tags: code,linux,nawk,privesc,local
|
|
|
|
self-contained: true
|
|
code:
|
|
- engine:
|
|
- sh
|
|
- bash
|
|
source: |
|
|
whoami
|
|
|
|
- engine:
|
|
- sh
|
|
- bash
|
|
source: |
|
|
nawk 'BEGIN {system("whoami")}'
|
|
|
|
- engine:
|
|
- sh
|
|
- bash
|
|
source: |
|
|
sudo nawk '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: 490a0046304402203a9652dc49b3c404e11cdd93d124f05d18e06dc8d66199c14ea83e0761ceeec002207922dc474bbc053a9a488fd0b912d99a77ab120527be55d4b64b01a2499a83e0:922c64590222798bb761d5b6d8e72950 |