Insecure Deserialization: practice machines and key commands

By Daniel Dayan ยท Updated

Insecure deserialization lets an attacker supply a crafted serialized object that triggers dangerous code during parsing. It is most common in Java, PHP, Python pickle and .NET applications. Look for serialized blobs in cookies, hidden fields and API bodies: Java streams start with rO0 in base64 and PHP uses readable O:4:"User" strings. Gadget chains in libraries on the classpath do the actual damage, and tools such as ysoserial generate them for Java. Even without a working chain, tampering with a serialized object can change roles or flags. The bug class also shows up in Jenkins, Log4j style JNDI lookups and other Java middleware, where a patched version is the only complete fix. Always confirm the framework version before sending payloads. These machines are good practice for spotting and exploiting the pattern.

Key commands

Placeholders in braces, such as {TARGET_IP}, are values you fill in for your target.

Recognise a Serialized Data Format

Spot the format of a blob found in a cookie, hidden field or API body before picking a gadget-chain tool: Java streams start with rO0 in base64 (or ac ed in hex), PHP uses readable O:4:"User" strings, and Python pickle starts with \x80.

echo "<captured_value>" | base64 -d 2>/dev/null | xxd | head -n 1

Decode a Captured Serialized Blob

Base64-decode an intercepted serialized object to a file so its structure can be inspected before building or modifying a gadget chain.

echo "<captured_value>" | base64 -d > blob.bin && xxd blob.bin | less

Keep going

Insecure Deserialization machines (15)

1 of these are machines I solved myself and are listed first within each difficulty. 10 Linux, 5 Windows.

Listed when a machine has a catalog tag that is one of: deserialization, java deserialization, log4j, pickle, ysoserial, jenkins. Capital letters, hyphens and underscores are ignored, and the tags that matched come first in each row.

Insecure Deserialization at a glance

Very Easy (2)

MachinePlatformOSTags
PennyworthJenkinsGroovyRCEDefault CredentialsHTBLinuxJenkins, Groovy, RCE, Default Credentials
UnifiedLog4jCVE-2021-44228UniFiMongoDBHTBLinuxLog4j, CVE-2021-44228, UniFi, MongoDB

Easy (4)

MachinePlatformOSTags
AlfredJenkinsPowerShellToken ImpersonationSeImpersonatePrivilegeTHMWindowsJenkins, PowerShell, Token Impersonation, SeImpersonatePrivilege
Broker IppSecJava-DeserializationActiveMQ-CVE-2023-46604Sudo-NginxHTBLinuxJava-Deserialization, ActiveMQ-CVE-2023-46604, Sudo-Nginx
Crafty IppSecLog4jMinecraftJNDIHTBWindowsLog4j, Minecraft, JNDI
Tony the TigerJava-DeserializationTHMLinuxJava-Deserialization

Medium (4)

MachinePlatformOSTags
Arkham IppSecJava-DeserializationUAC-BypassHTBWindowsJava-Deserialization, UAC-Bypass
Jacob the BossJava-DeserializationJBossCVE-2017-12149SUIDTHMLinuxJava-Deserialization, JBoss, CVE-2017-12149, SUID
Scrambled IppSecDeserializationActive DirectoryKerberoastingKerberosHTBWindowsDeserialization, Active Directory, Kerberoasting, Kerberos
Time IppSecJava-DeserializationCVE-2019-12384CVE-2019-12814CVE-2019-14439HTBLinuxJava-Deserialization, CVE-2019-12384, CVE-2019-12814, CVE-2019-14439

Hard (4)

MachinePlatformOSTags
Feline IppSecDeserializationCVE-2020-11651CVE-2020-11652CVE-2020-9484HTBLinuxDeserialization, CVE-2020-11651, CVE-2020-11652, CVE-2020-9484
InternalJenkinsWordPressTunnelingDocker-EscapeTHMLinuxJenkins, WordPress, Tunneling, Docker-Escape
Monitors IppSecJava-DeserializationCVE-2020-9496Exploit-modificationLFIHTBLinuxJava-Deserialization, CVE-2020-9496, Exploit-modification, LFI
ObjectJenkinsHTBWindowsJenkins

Insane (1)

MachinePlatformOSTags
Fatty IppSecDeserializationDirectory-TraversalSQLiThick-Client-PentestingHTBLinuxDeserialization, Directory-Traversal, SQLi, Thick-Client-Pentesting

Related techniques

Related guides: TJ Null OSCP list, OSCP exam scoring and time budget, OSCP vs CPTS, OSCP report template.

Practise it, then track it.

Log every box and the commands you used in ZeroBox.