Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for virus inspection of specific file types #18

Closed
Luminarys opened this issue Jun 23, 2015 · 10 comments
Closed

Allow for virus inspection of specific file types #18

Luminarys opened this issue Jun 23, 2015 · 10 comments

Comments

@Luminarys
Copy link
Contributor

On files which have a MIME type of exectuable or binary, trigger a virus scan and potentially add the file to the banned file list if there's a match(this cab be detected by checking if the file gets removed by the scan).

@Guad
Copy link
Owner

Guad commented Jun 23, 2015

What virus scanner do you suggest?

@Luminarys
Copy link
Contributor Author

I'll handle that, right now I'm using clamd. Basically it should be called with popen and run on binary/executables, and if the file gets removed, it should be added to the banned list and rejection method should be returned.
On Jun 23, 2015 5:55 PM, Guad notifications@github.com wrote:What virus scanner do you suggest?

—Reply to this email directly or view it on GitHub.

@Luminarys
Copy link
Contributor Author

The exe/dll/com ending scans should be fine for now, but MIME based detection of executables would be optimal. Also, we should write a function which takes a list of files to ban, adds their hashes, names, etc. to the banlist and deletes them all. I'm doing this at the moment.

@Guad
Copy link
Owner

Guad commented Jun 24, 2015

Alright

@Guad Guad closed this as completed Jun 24, 2015
@Luminarys
Copy link
Contributor Author

Are we using detection based on MIME types?

@Guad
Copy link
Owner

Guad commented Jun 24, 2015

Wouldn't application/octet-stream give a lot of non executables?

@Luminarys
Copy link
Contributor Author

Does windows run files which don't have an exe extension? It shouldn't be a big deal though, I have a cron job running virus scans every 24 hours, I'll just have it update the banlist when it runs.

@Guad
Copy link
Owner

Guad commented Jun 24, 2015

An attacker could upload his payload under any extension and then rename it after downloading it and execute it on a victim's computer. Virus scans should be enough I guess.

@Luminarys
Copy link
Contributor Author

I don't know how good the MIME type detection is for flask, but the idea is to detect any binary/executable type and scan it regardless of extension/file name. This can be something to be changed down the road though; for now it should be fine.

@Guad
Copy link
Owner

Guad commented Jun 24, 2015

You can test it yourself, just add print(file.content_type)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants