changed the identifier from random chars to the hash of the stacktrace, this will help for a furture update where it will check if the issue is already on the bug tracker

This commit is contained in:
ekultek 2018-02-07 11:29:56 -06:00
parent 51905bbc82
commit f14bbe5645
2 changed files with 7 additions and 8 deletions

View file

@ -8,7 +8,6 @@ import shlex
import difflib
import logging
import base64
import string
import random
import socket
import struct
@ -45,7 +44,7 @@ CLONE = "https://github.com/ekultek/zeus-scanner.git"
ISSUE_LINK = "https://github.com/ekultek/zeus-scanner/issues"
# current version <major.minor.commit.patch ID>
VERSION = "1.4.13.{}".format(PATCH_ID)
VERSION = "1.5".format(PATCH_ID)
# colors to output depending on the version
VERSION_TYPE_COLORS = {"dev": 33, "stable": 92, "other": 30}
@ -670,14 +669,14 @@ def get_md5sum(url="https://raw.githubusercontent.com/Ekultek/Zeus-Scanner/maste
return True
def create_identifier(chars=string.ascii_letters):
def create_identifier(st):
"""
create the identifier for your Github issue
"""
retval = []
for _ in range(0, 7):
retval.append(random.choice(chars))
return "".join(retval)
import hashlib
obj = hashlib.md5()
obj.update(st)
return obj.hexdigest()[1:9]
def config_search_engine(**kwargs):

View file

@ -85,7 +85,7 @@ def request_issue_creation():
current_log_file = lib.core.settings.get_latest_log_file(lib.core.settings.CURRENT_LOG_FILE_PATH)
stacktrace = __extract_stacktrace(current_log_file)
identifier = lib.core.settings.create_identifier()
identifier = lib.core.settings.create_identifier(stacktrace)
issue_title = "Unhandled exception ({})".format(identifier)
ff_version = lib.core.settings.get_browser_version()
log_file_information = lib.core.settings.tails(current_log_file)