From 608fa9690b6961b237b9e38fc6ec7c0916f92d1b Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Tue, 2 Apr 2019 20:45:55 +0200 Subject: Add support for blocking files Files are blocked if blocked_reason is non-NULL. This value is currently not exposed publicly, instead a 404 will be returned. Files are scanned using virustotal.com's public API if scanned is False. Scans are performed by the fbin-scanner.py script. If a match is found, blocked_reason is set to the payload received. Files that are not in VT's database will be automatically submitted and the script will wait for the scan to complete before continuing. --- fbin/fbin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fbin/fbin.py') diff --git a/fbin/fbin.py b/fbin/fbin.py index 91fa1c9..19f82ed 100755 --- a/fbin/fbin.py +++ b/fbin/fbin.py @@ -207,7 +207,7 @@ def uploaded(hash): @app.route('/file//', endpoint = 'file') def _file(hash, ext=None, filename=None): f = get_file(hash) - if not f or not f.exists: + if not f or not f.exists or f.blocked_reason: abort(404) return send_file(f.get_path()) -- cgit v1.2.3