Live data from Hacker News

Technical Analysis of SAP Exploit Script Used in JLR, Harrods Hacks

detect.fyi

1–10 of 14 posts

Re: Technical Analysis of SAP Exploit Script Used in JLR, Harrods Hacks

#3
post #2

Interesting, 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

#4
This 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

#5
post #3
post #2

Interesting, 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

In college, I worked for a small team in a large organization that used SAP. My team tracked everything in an Excel dashboard, and I was tasked with automating data ingestion from SAP into Excel. The only tool I had available was the SAP GUI input emulation API for VBA. It was extraordinarily painful to set up and would break every time the SAP team would change the GUI to add or remove a button. Lots of fun.

Re: Technical Analysis of SAP Exploit Script Used in JLR, Harrods Hacks

#6
post #4

This 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

#7
post #4

This 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)

As far as I can tell, the exploit works like this:

`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

#8
post #4

This 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.

What's extremely saddening is that I had to examine three pages of search results for the CVE number before finding a non-slop explanation of the bug. In the race to "explain" vulnerabilities and bugs (and sell their security solution), a whole ecosystem of slop sites citing other slop sites has appeared, and accurate, careful (and often slow!) technical analysis is being lost in the noise.

Re: Technical Analysis of SAP Exploit Script Used in JLR, Harrods Hacks

#10
Who does even run Netweaver Java AS today? Apparently some do, but that was a bad idea from the start. It is an optional server component letting Java applications run in the SAP server. In my eyes it was always an unnecessary additional source of complexity, they added it to the portfolio back when Java was the hype. Now its been pwned by an unchecked upload.

But i know that HN does not have an appreciation for SAP anyhow.

Post reply on HN