Ejemplo n.º 1
0
 def __init__(self, configuration_path = thug.__configuration_path__):
     log.configuration_path  = configuration_path
     log.personalities_path  = os.path.join(configuration_path, "personalities") if configuration_path else None
     log.ThugOpts            = ThugOpts()
     log.ThugVulnModules     = ThugVulnModules()
     log.WebTracking         = WebTracking()
     log.MIMEHandler         = MIMEHandler()
     log.SchemeHandler       = SchemeHandler()
     log.JSClassifier        = JSClassifier()
     log.URLClassifier       = URLClassifier()
     log.SampleClassifier    = SampleClassifier()
     log.Encoding            = Encoding()
Ejemplo n.º 2
0
    def __init_classifiers(self):
        log.HTMLClassifier   = HTMLClassifier()
        log.JSClassifier     = JSClassifier()
        log.VBSClassifier    = VBSClassifier()
        log.URLClassifier    = URLClassifier()
        log.SampleClassifier = SampleClassifier()
        log.TextClassifier   = TextClassifier()

        self.classifiers_map = {
            'html'   : log.HTMLClassifier,
            'js'     : log.JSClassifier,
            'vbs'    : log.VBSClassifier,
            'url'    : log.URLClassifier,
            'sample' : log.SampleClassifier,
            'text'   : log.TextClassifier
        }
Ejemplo n.º 3
0
import thug
from thug.ThugAPI.ThugOpts import ThugOpts
from thug.DOM.HTTPSession import HTTPSession
from thug.Logging.ThugLogging import ThugLogging
from thug.Classifier.URLClassifier import URLClassifier
from thug.Classifier.SampleClassifier import SampleClassifier

configuration_path = thug.__configuration_path__

log                    = logging.getLogger("Thug")
log.configuration_path = configuration_path
log.personalities_path = os.path.join(configuration_path, "personalities") if configuration_path else None

log.ThugOpts         = ThugOpts()
log.HTTPSession      = HTTPSession()
log.URLClassifier    = URLClassifier()
log.SampleClassifier = SampleClassifier()

thug_logging = ThugLogging(thug.__version__)


class TestThugLogging:
    js       = "var i = 0;"
    cert     = "sample-certificate"
    content  = b"sample, content"
    cwd_path = os.path.dirname(os.path.realpath(__file__))
    jar_path = os.path.join(cwd_path, os.pardir, os.pardir, "tests/test_files/sample.jar")
    sample   = {'sha1': 'b13d13733c4c9406fd0e01485bc4a34170b7d326',
                'ssdeep': u'24:9EGtDqSyDVHNkCq4LOmvmuS+MfTAPxokCOB:97tG5DjQ4LDs+sTAPxLT',
                'sha256': '459bf0aeda19633c8e757c05ee06b8121a51217cea69ce60819bb34092a296a0',
                'type': 'JAR',