NOT TESTED!!!!!
Final refactor New download system
This commit is contained in:
@@ -3,6 +3,7 @@ import requests
|
||||
import os
|
||||
import hashlib
|
||||
import modules.vars as horsy_vars
|
||||
from rich import print
|
||||
|
||||
|
||||
def add_to_cfg(key):
|
||||
@@ -59,3 +60,22 @@ def get_report(filename):
|
||||
analysis['link'] = 'No data'
|
||||
|
||||
return analysis
|
||||
|
||||
|
||||
def scan_to_cli(filename):
|
||||
print(f"Starting virustotal scan")
|
||||
if not get_key():
|
||||
print(f"[red]Virustotal api key not found[/]")
|
||||
print(f"You can add it by entering [bold]horsy --vt \[your key][/] in terminal")
|
||||
else:
|
||||
print(f"[green]Virustotal api key found[/]")
|
||||
print(f"[italic white]If you want to disable scan, type [/][bold]horsy --vt disable[/]"
|
||||
f"[italic white] in terminal[/]")
|
||||
scan_file(filename)
|
||||
print(f"[green]Virustotal scan finished[/]")
|
||||
analysis = get_report(filename)
|
||||
print(f"[green]You can see report by opening: [white]{analysis['link']}[/]")
|
||||
print(f"{analysis['detect']['malicious']} antivirus flagged this file as malicious")
|
||||
|
||||
print(f"[green][OK] Done[/]")
|
||||
return analysis
|
||||
|
||||
Reference in New Issue
Block a user