2024-01-22 13:29:57 +00:00
id : privesc-php
info :
name : PHP - Privilege Escalation
author : daffainfo
severity : high
description : |
PHP is a popular server-side scripting language that is widely used for web development. It is known for its ease of use, flexibility, and broad support for web frameworks and content management systems. PHP is commonly used to create dynamic web pages, process form data, manage sessions, and interact with databases.
reference :
- https://gtfobins.github.io/gtfobins/php/
metadata :
verified : true
2024-01-29 11:58:34 +00:00
max-request : 4
2024-01-31 17:41:31 +00:00
tags : code,linux,php,privesc,local
2024-01-22 13:29:57 +00:00
self-contained : true
code :
- engine :
- sh
- bash
source : |
whoami
- engine :
- sh
- bash
source : |
php -r 'system("whoami");'
- engine :
- sh
- bash
source : |
sudo php -r 'system("whoami");'
- engine :
- sh
- bash
source : |
php -r "posix_setuid(0); 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")'
- 'contains(code_4_response, "root")'
2024-01-22 16:20:01 +00:00
condition : or
2024-01-29 12:41:50 +00:00
# digest: 4a0a00473045022028ea37472f5069f963ba5a90ad0ce5fed2c350d85d1f2b6839c9cb7bf03b7d07022100c07c131a9b8f0c41f2216d70a623f84f282cbdb8538833e2cd16fec312c9de13:922c64590222798bb761d5b6d8e72950