Live data from Hacker News

Hackers use ZIP file concatenation to evade detection

bleepingcomputer.com

1–10 of 111 posts

Re: Hackers use ZIP file concatenation to evade detection

#3
This is sometimes used non-maliciously to concatenate zipped eBooks to a JPEG of the cover art. 4Chan's /lit/ board used to do this, but I can't find any reference to it anymore.

https://entropymine.wordpress.com/2018/11/01/about-that-jpeg...

https://github.com/Anti-Forensics/tucker

Re: Hackers use ZIP file concatenation to evade detection

#6
post #5
post #4

Encrypted ZIP files have long been a way to evade any sort of malware detection during transmission.

I doubt it still works but things I needed to get through email I would embed in word documents.

A modern word document file (.docx) is literally just a Zip archive with a special folder structure, so unless your company is scanning word document contents I can’t imagine there’s any issue.

Re: Hackers use ZIP file concatenation to evade detection

#7
post #5
post #4

Encrypted ZIP files have long been a way to evade any sort of malware detection during transmission.

I doubt it still works but things I needed to get through email I would embed in word documents.

Would probably still work. There's just too many formats which makes it very hard for a content blocker to really stop.

I pity the programmer that has to decode the 1000 versions of xls to find the binary blob that could be a virus.

Re: Hackers use ZIP file concatenation to evade detection

#8
post #4

Encrypted ZIP files have long been a way to evade any sort of malware detection during transmission.

Pretty common in corporate world. Email scanner will helpfully drop all manner of useful files between staff, so make an encrypted zip with simple password.

Re: Hackers use ZIP file concatenation to evade detection

#9
WinRAR does it right, 7zip and Windows Explorer do it wrong according to https://en.m.wikipedia.org/wiki/ZIP_(file_format)

> only files specified in the central directory at the end of the file are valid. Scanning a ZIP file for local file headers is invalid (except in the case of corrupted archives)

Re: Hackers use ZIP file concatenation to evade detection

#10
From a security perspective, and as a programmer, I've never liked ZIP files precisely because there are two mechanisms to identify the contents, the per-file header and the central directory. When you're defining a format, protocol, or w'ever, ideally there should be a single source of truth, a single valid & useable parse, etc; basically, the structure of the data or process should be intrinsically constraining. There shouldn't be a pathway for multiple implementations to produce different functional results, and ZIP archives are in my mind the archetype for getting this wrong. tar files aren't ideal, but in the abstract (ignoring issues with long file names) they don't have this problem. (tar files don't support random access, either, but better to rely on something suboptimal than something that's fundamentally broken.)

A similar security problem, though not as fundamentally baked into the format, is MIME parsing. The header section is supposed to be delimited from the body by an empty line (likewise for nested entities). But what if it's not? For better or worse, Sendmail was tolerant of the absence of an empty line and treated as headers everything up to the first line that didn't parse as a header or header continuation.[1] Later systems, like Postfix, originally copied this behavior. But Microsoft Exchange and Outlook are even more tolerant, yet in a much more horrendous way, by parsing as a header anything that looks like a Content-Type or related header immediately after the first empty line. They have similar hacks for other, similar violations. So today, depending on the receiving software, you can send messages that appear differently, including having different attachments. It's a security nightmare!

I not a Postel's Law hater, but ZIP archives and Microsoft's MIME parsing behaviors are just egregiously wrong and indefensible. And even if you think the Robustness Principle is inherently bad policy, you still have to design your formats, protocols, and systems to be as intrinsically constraining as possible. You can't rely on vendors adhering to a MUST rule in an RFC, unless it's unquestioningly crystal clear what the repercussions will be--everybody else will (because it's the natural and convenient thing to do) reject your output as trash and drop it on the floor immediately so violations never have a chance to get a foothold.

[1] MTAs don't necessarily need to care about MIME parsing, but Sendmail eventually gained features where parsing message contents mattered, setting the de facto norm (for those paying attention) until Microsoft came along.

Post reply on HN