Live data from Hacker News

Hackers use ZIP file concatenation to evade detection

bleepingcomputer.com

31–40 of 111 posts

Re: Hackers use ZIP file concatenation to evade detection

#31
post #27

Earlier quoted context omitted.

Or: better yet, just use an archive format for archival and a compression layer for compression. Don't use zip at all.

What non-compressing archive format would you suggest? tar doesn't support random access which is a non-starter for many use cases.

[deleted]

Re: Hackers use ZIP file concatenation to evade detection

#32
post #7
post #5

Earlier quoted context omitted.

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.

1000? No. There's two. Openxml and the original xls. OpenXML can be scanned for issues like any other XML file.

Alas, it's more difficult to get excel to accept that it shouldn't delete leading zeros than it is to check a spreadsheet's sus-o-scale.

Re: Hackers use ZIP file concatenation to evade detection

#33
post #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. Th…

The central directory allows zip archives to be split across multiple files on separate media without needing to read them all in for selective extraction. Not particularly useful today but invaluable in the sneakernet era with floppies.

Still useful today.

Try to transmit a 100G file through any service is usually a pain especially if one end has non-stable Internet.

Re: Hackers use ZIP file concatenation to evade detection

#34

Earlier quoted context omitted.

The central directory allows zip archives to be split across multiple files on separate media without needing to read them all in for selective extraction. Not particularly useful today but invaluable in the sneakernet era with floppies.

Still useful today. Try to transmit a 100G file through any service is usually a pain especially if one end has non-stable Internet.

I recently had to do this with about 700Gb, and yeah OneDrive hated that. I ended up concatenating tars together.

Re: Hackers use ZIP file concatenation to evade detection

#35
Not really a new technique. A long time ago in a galaxy far far away, I needed to get libraries from the internet onto an air-gapped network, and the supported way was to burn them to a disk and bring the disk to be scanned. The scanner never allowed executables so it would always reject the libraries. Can't make this up, but the supported way that InfoSec (!!) explained to us to get past the scanner was to take advantage of WinRAR being available on the network, so split the rar archive a bunch of times (foo.r01, foo.r02,...) and the scanner, being unable to parse them nor execute them, would happily rubber-stamp them and pass them along. As long as the process was followed, InfoSec was happy. Thankfully this was before the days when people were really worried about supply chain security.

Glad to see this bit of security theater recognized as such.

Re: Hackers use ZIP file concatenation to evade detection

#36
post #27

Earlier quoted context omitted.

Or: better yet, just use an archive format for archival and a compression layer for compression. Don't use zip at all.

What non-compressing archive format would you suggest? tar doesn't support random access which is a non-starter for many use cases.

DAR (Disk ARchiver)[1] looks to be a good alternative. It supports random access, encryption, and individual file compression within the archive.

[1] http://dar.linux.free.fr/

Re: Hackers use ZIP file concatenation to evade detection

#37
post #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. Th…

I don't think you understand the reason for the ZIP archive file design. Back in the late 1980s, backup media for consumers was limited to mostly floppy disks, some users had tape/another hard disk. Say you had a variable number of files to compress and write out to a ZIP archive. IF you write out the central directory first, followed by all the individually possibly compressed and/or encrypted files, you'd have to c…

The more general principle is that single source of truth is not ideal for data storage where you're worried about corruption. There's a backup MBR on your hard disk at the end, your ext4 filesystem has many backups of your superblock.

When it comes to user data the natural programmer instinct for "is exactly what I expect or fail" which is typically good design, falls to pragmatism where try your hardest to not lose data, partial results are better then nothing, is desired.

Re: Hackers use ZIP file concatenation to evade detection

#38
> To defend against concatenated ZIP files, Perception Point suggests that users and organizations use security solutions that support recursive unpacking

Yeah, or, you know, just outright reject any ZIP file that doesn't start with a file entry, where a forward-scan of the file entries doesn't match the result of the central-directory-based walk.

There is just so much malicious crud coming in via email that you just want to instantly reject anything that doesn't look 'normal', and you definitely don't want to descend into the madness of recursive unpacking, 'cuz that enables another class of well-known attacks.

And no, "but my precious use-case" simply doesn't apply, as you're practically limited to a whole 50MB per attachment anyway. Sure, "this ZIP file is also a PDF is also a PNG is also a NES cartridge which displays its own MD5" (viz https://github.com/angea/pocorgtfo/tree/master/writeups/19) has a place (and should definitely be required study material for anyone writing mail filters!), but business email ain't it.

Re: Hackers use ZIP file concatenation to evade detection

#39
post #36
post #27

Earlier quoted context omitted.

What non-compressing archive format would you suggest? tar doesn't support random access which is a non-starter for many use cases.

DAR (Disk ARchiver)[1] looks to be a good alternative. It supports random access, encryption, and individual file compression within the archive. [1] http://dar.linux.free.fr/

That seems counter to GP's suggestion of doing compression at a separate layer

Re: Hackers use ZIP file concatenation to evade detection

#40

Earlier quoted context omitted.

The central directory allows zip archives to be split across multiple files on separate media without needing to read them all in for selective extraction. Not particularly useful today but invaluable in the sneakernet era with floppies.

Still useful today. Try to transmit a 100G file through any service is usually a pain especially if one end has non-stable Internet.

That's a very bad way of solving that issue. If transmission is a problem, either use a proper retry-friendly protocol (such as bittorrent) or split the file. Using hacks on the data format just leads to additional pain
Post reply on HN