News for hackers. Stuff that matters.
Re:Ask HN: How to handle user file uploads? by LinuxBender on Wednesday May 01, 2024 @07:16AM (#40221780)
I am not a proper developer so I don't have the technical details on this, but another thing I have seen done is to buy access to an API on VirusTotal [1] and submit file hashes to be compared against their database of about 70 or so virus scanners. Not foolproof, as malware can be recompiled and hidden from VT so it really only catches known-knowns but apparently some companies find it useful. I utilize it on a windows machine using ProcessExplorer that can automatically submit hashes but the API volume is limited for free / anonymous access.

[1] - https://docs.virustotal.com/reference/overview

Re:Ask HN: How to handle user file uploads? by rpigab on Thursday May 02, 2024 @04:50AM (#40234063)
If I was a malware distributor, I'd just throw a couple random bytes at the end each time I upload a malicious file, it'd still work and have a different checksum/hash.
Re:Ask HN: How to handle user file uploads? by ecaradec on Thursday May 02, 2024 @07:44AM (#40235009)
Antivirus are really stupid tools, but not that stupid. I said that from a time where I had to work around tools flagged by antivirus. Among stupid things they do are flagging a part of an executable, some nsis plugin flagged the whole package as virus as soon as you included them. I think they probably hash files by chunks, if you have too many bad chunks then you are a virus. A few bytes at the end doesn't change that.
Re:Ask HN: How to handle user file uploads? by eyegor on Saturday May 04, 2024 @06:44AM (#40256555)
I'm not sure if it's still true, but it used to be that ~half of all antivirus would flag an executable if you compressed it with UPX.
Re:Ask HN: How to handle user file uploads? by cinntaile on Saturday May 04, 2024 @07:34AM (#40256849)
You could sometimes bypass this by opening the file with a hexeditor and change a meaningless value. When UPX was popular there were also alternative file compressors that could also be used to sometimes bypass this issue.
Re:Ask HN: How to handle user file uploads? by toomuchtodo on Thursday May 02, 2024 @06:08PM (#40241922)
CISA is offering a malware analysis service now, requires a Login.gov account to use and the user be a US citizen. Unsure how it compares to VirusTotal, it’s in our backlog to spike a poc in our IR workflow.

https://www.cisa.gov/resources-tools/services/malware-next-g...

Re:Ask HN: How to handle user file uploads? by yard2010 on Saturday May 04, 2024 @12:59PM (#40258889)
I have to say this user agreement sounds like TikTok privacy policy, but my oh my! The government does its job. RESPECT.