Technical Analysis of SAP Exploit Script Used in JLR, Harrods Hacks
1–10 of 14 posts
Re: Technical Analysis of SAP Exploit Script Used in JLR, Harrods Hacks
#2In recent years, we got patches (OSS Notes) almost daily.
Re: Technical Analysis of SAP Exploit Script Used in JLR, Harrods Hacks
#3Interesting, I worked on SAP for a few years and I expect this is just the tip of the iceberg on SAP systems :( In recent years, we got patches (OSS Notes) almost daily.
Re: Technical Analysis of SAP Exploit Script Used in JLR, Harrods Hacks
#4You may as well just pop the script (mirrored here: https://gist.github.com/nneonneo/9caabf7c9d2f94711bce005e144...) into your own AI of choice and tweak the analysis to your liking.
(Note the giveaway "likely via argparse in Python" and similar constructs; the script obviously does use argparse so there's no need for hedging)
Re: Technical Analysis of SAP Exploit Script Used in JLR, Harrods Hacks
#5Interesting, I worked on SAP for a few years and I expect this is just the tip of the iceberg on SAP systems :( In recent years, we got patches (OSS Notes) almost daily.
To be honest, I've never heard anyone with SAP experience that has anything good to say about it. My N value is pretty low to be fair, but it definitely has the air of being widely disliked
Re: Technical Analysis of SAP Exploit Script Used in JLR, Harrods Hacks
#6This is just a really bad AI summary of the script. You may as well just pop the script (mirrored here: https://gist.github.com/nneonneo/9caabf7c9d2f94711bce005e144... ) into your own AI of choice and tweak the analysis to your liking. (Note the giveaway "likely via argparse in Python" and similar constructs; the script obviously does use argparse so there's no need for hedging)
Re: Technical Analysis of SAP Exploit Script Used in JLR, Harrods Hacks
#7This is just a really bad AI summary of the script. You may as well just pop the script (mirrored here: https://gist.github.com/nneonneo/9caabf7c9d2f94711bce005e144... ) into your own AI of choice and tweak the analysis to your liking. (Note the giveaway "likely via argparse in Python" and similar constructs; the script obviously does use argparse so there's no need for hedging)
`metadataupload` takes a .zip file as POST input. This endpoint can be trivially reached on any SAP instance without authentication. The .zip file can contain a .properties file, which is deserialized into a java.util.Properties instance.
Since they're using Java deserialization, it is possible to deserialize arbitrary objects. The actual exploit uses a payload generated by ysoserial (https://github.com/frohoff/ysoserial) to either execute a command directly or drop a file on the filesystem. The basic idea behind a deserialization attack is to construct an object graph such that, when deserialized, functions that run normally as part of the deserialization process end up calling arbitrary code.
Deserialization attacks are well-known in the Java world, and are very common thanks to the fact that the serializer is both easy to use and baked into the language. With a large enough codebase (or the right dependencies) you're practically guaranteed to have enough serializable types to string together an RCE.
As an example, one of the classes used in this exploit is org.apache.xalan.xsltc.trax.TemplatesImpl (https://xalan.apache.org/xalan-j/apidocs/org/apache/xalan/xs...). This class contains a serializable array of Java .class bytecodes which will be dynamically loaded if the `newTransformer` method is called; note that merely loading a Java `.class` will be enough to run arbitrary code via static constructors. Other serializable classes are used to get the `newTransformer` method to be called on the object during deserialization.
The OP post is full of nonsensical and outright incorrect fluff. This is a straightforward deserialization-to-RCE bug; the RCE is what's being used to upload arbitrary files.
Re: Technical Analysis of SAP Exploit Script Used in JLR, Harrods Hacks
#8This is just a really bad AI summary of the script. You may as well just pop the script (mirrored here: https://gist.github.com/nneonneo/9caabf7c9d2f94711bce005e144... ) into your own AI of choice and tweak the analysis to your liking. (Note the giveaway "likely via argparse in Python" and similar constructs; the script obviously does use argparse so there's no need for hedging)
100%, this is definitely slop.
Re: Technical Analysis of SAP Exploit Script Used in JLR, Harrods Hacks
#9Re: Technical Analysis of SAP Exploit Script Used in JLR, Harrods Hacks
#10But i know that HN does not have an appreciation for SAP anyhow.