krmaxwell / maltrieve

A tool to retrieve malware directly from the source for security researchers.
GNU General Public License v3.0
562 stars 184 forks source link

Feature Request: download size filter #148

Open eldraco opened 9 years ago

eldraco commented 9 years ago

Does it have some sort of download size filter? So we can avoid downloading a 1GB file?

krmaxwell commented 9 years ago

For serves that provide a Content-Length HTTP header, we could possibly do this. The caveat of course is that the spec does not require servers to provide this header and so we won't always know a file size until we grab the file.

If somebody wants to implement this, I'd like to see it this way:

This is probably a security issue, to be honest, because a malicious attacker could serve a fake stream to fill up the file system where Maltrieve stores the data. But in that case they probably won't use the Content-Length header and so this wouldn't fix that. So, separately from any code implementation as described above, the documentation should make clear that dumpdir needs to be on a non-system partition to avoid a denial of service.

I appreciate this question, it's really helpful!