2024-01-22 13:29:57 +00:00
id : privesc-expect
info :
name : expect - Privilege Escalation
author : daffainfo
severity : high
description : |
expect is a Unix scripting and testing utility that automates interactive applications such as telnet, ftp, passwd, fsck, rlogin, tip, and more. It uses scripts to control interactive applications, making it useful for automating tasks that involve user input.
2024-01-22 14:09:39 +00:00
reference :
2024-01-22 13:29:57 +00:00
- https://gtfobins.github.io/gtfobins/expect/
metadata :
verified : true
2024-01-29 11:58:34 +00:00
max-request : 3
2024-01-22 13:29:57 +00:00
tags : code,linux,expect,privesc
self-contained : true
code :
- engine :
- sh
- bash
source : |
whoami
- engine :
- sh
- bash
source : |
expect -c 'spawn whoami;interact'
- engine :
- sh
- bash
source : |
sudo expect -c 'spawn whoami;interact'
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")'
2024-01-22 16:20:01 +00:00
condition : or
2024-01-29 12:41:50 +00:00
# digest: 4a0a00473045022100ef34c9afb54f79ced1f089612e9c99f446f61d292d4c5ebc0ff4f4d4f5b370280220167c220d69c1e182f158399e5bbe019f17d017c4729a766b4a8bcc49d9d88fcc:922c64590222798bb761d5b6d8e72950