Debug installing app, that didn't tested on VT
This commit is contained in:
@@ -91,39 +91,46 @@ def install(package):
|
||||
"You can add it by entering horsy --vt [key] in terminal")
|
||||
download_ui.logs_box.moveCursor(QtGui.QTextCursor.End)
|
||||
else:
|
||||
download_ui.logs_box.append("If you want to disable scan, type horsy --vt disable in terminal")
|
||||
download_ui.logs_box.append("Starting virustotal scan for program")
|
||||
download_ui.logs_box.moveCursor(QtGui.QTextCursor.End)
|
||||
scan_file('{2}apps/{0}/{1}'.format(r['name'], r['url'].split('/')[-1], horsy_vars.horsypath))
|
||||
analysis = get_report('{2}apps/{0}/{1}'.format(r['name'], r['url'].split('/')[-1],
|
||||
horsy_vars.horsypath))
|
||||
download_ui.logs_box.append(f"Scan finished for program \nYou can see report for program by opening: "
|
||||
f"{analysis['link']} \n"
|
||||
f"{analysis['detect']['malicious']} antivirus flagged this file as malicious")
|
||||
download_ui.logs_box.moveCursor(QtGui.QTextCursor.End)
|
||||
try:
|
||||
download_ui.logs_box.append("If you want to disable scan, type horsy --vt disable in terminal")
|
||||
download_ui.logs_box.append("Starting virustotal scan for program")
|
||||
download_ui.logs_box.moveCursor(QtGui.QTextCursor.End)
|
||||
scan_file('{2}apps/{0}/{1}'.format(r['name'], r['url'].split('/')[-1], horsy_vars.horsypath))
|
||||
analysis = get_report('{2}apps/{0}/{1}'.format(r['name'], r['url'].split('/')[-1],
|
||||
horsy_vars.horsypath))
|
||||
download_ui.logs_box.append(f"Scan finished for program \nYou can see report for program by opening: "
|
||||
f"{analysis['link']} \n"
|
||||
f"{analysis['detect']['malicious']} antivirus flagged this file as malicious")
|
||||
download_ui.logs_box.moveCursor(QtGui.QTextCursor.End)
|
||||
except:
|
||||
pass
|
||||
|
||||
if r['download']:
|
||||
download_ui.logs_box.append("")
|
||||
download_ui.logs_box.append("Starting virustotal scan for dependency")
|
||||
download_ui.logs_box.moveCursor(QtGui.QTextCursor.End)
|
||||
scan_file('{2}apps/{0}/{1}'.format(r['name'], r['download'].split('/')[-1], horsy_vars.horsypath))
|
||||
download_ui.logs_box.append(f"Scan finished for dependency")
|
||||
download_ui.logs_box.moveCursor(QtGui.QTextCursor.End)
|
||||
analysis = get_report('{2}apps/{0}/{1}'.format(r['name'], r['download'].split('/')[-1],
|
||||
horsy_vars.horsypath))
|
||||
download_ui.logs_box.append(f"You can see report for dependency by opening: {analysis['link']}")
|
||||
download_ui.logs_box.append(f"{analysis['detect']['malicious']} "
|
||||
f"antivirus flagged this file as malicious")
|
||||
download_ui.logs_box.moveCursor(QtGui.QTextCursor.End)
|
||||
if analysis['detect']['malicious'] > 0:
|
||||
download_ui.logs_box.append("")
|
||||
download_ui.logs_box.append(f"SECURITY WARNING, APP INSTALLATION STOPPED")
|
||||
download_ui.logs_box.append(f"Dependency can be malicious. "
|
||||
f"It may run now, if this added to installation config")
|
||||
download_ui.logs_box.append(f"You can disable VT check with horsy --vt disable \n"
|
||||
f"or use horsy CLI to force install")
|
||||
try:
|
||||
download_ui.logs_box.append("")
|
||||
download_ui.logs_box.append("Starting virustotal scan for dependency")
|
||||
download_ui.logs_box.moveCursor(QtGui.QTextCursor.End)
|
||||
scan_file('{2}apps/{0}/{1}'.format(r['name'], r['download'].split('/')[-1],
|
||||
horsy_vars.horsypath))
|
||||
download_ui.logs_box.append(f"Scan finished for dependency")
|
||||
download_ui.logs_box.moveCursor(QtGui.QTextCursor.End)
|
||||
analysis = get_report('{2}apps/{0}/{1}'.format(r['name'], r['download'].split('/')[-1],
|
||||
horsy_vars.horsypath))
|
||||
download_ui.logs_box.append(f"You can see report for dependency by opening: {analysis['link']}")
|
||||
download_ui.logs_box.append(f"{analysis['detect']['malicious']} "
|
||||
f"antivirus flagged this file as malicious")
|
||||
download_ui.logs_box.moveCursor(QtGui.QTextCursor.End)
|
||||
if analysis['detect']['malicious'] > 0:
|
||||
download_ui.logs_box.append("")
|
||||
download_ui.logs_box.append(f"SECURITY WARNING, APP INSTALLATION STOPPED")
|
||||
download_ui.logs_box.append(f"Dependency can be malicious. "
|
||||
f"It may run now, if this added to installation config")
|
||||
download_ui.logs_box.append(f"You can disable VT check with horsy --vt disable \n"
|
||||
f"or use horsy CLI to force install")
|
||||
download_ui.logs_box.append("")
|
||||
download_ui.logs_box.moveCursor(QtGui.QTextCursor.End)
|
||||
except:
|
||||
pass
|
||||
|
||||
if r['url'].split('.')[-1] == 'zip':
|
||||
os.remove('{2}apps/{0}/{1}'.format(r['name'], r['url'].split('/')[-1], horsy_vars.horsypath))
|
||||
|
||||
@@ -63,18 +63,21 @@ def get_report(filename):
|
||||
|
||||
|
||||
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")
|
||||
try:
|
||||
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")
|
||||
|
||||
return analysis
|
||||
return analysis
|
||||
except:
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user