id
int64 0
458k
| file_name
stringlengths 4
119
| file_path
stringlengths 14
227
| content
stringlengths 24
9.96M
| size
int64 24
9.96M
| language
stringclasses 1
value | extension
stringclasses 14
values | total_lines
int64 1
219k
| avg_line_length
float64 2.52
4.63M
| max_line_length
int64 5
9.91M
| alphanum_fraction
float64 0
1
| repo_name
stringlengths 7
101
| repo_stars
int64 100
139k
| repo_forks
int64 0
26.4k
| repo_open_issues
int64 0
2.27k
| repo_license
stringclasses 12
values | repo_extraction_date
stringclasses 433
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
12,900
|
MutationEvent.py
|
buffer_thug/thug/DOM/W3C/Events/MutationEvent.py
|
#!/usr/bin/env python
from .Event import Event
# Introduced in DOM Level 2
class MutationEvent(Event):
MODIFICATION = 1 # The Attr was just added
ADDITION = 2 # The Attr was modified in place
REMOVAL = 3 # The Attr was just removed
EventTypes = (
"DOMSubtreeModified",
"DOMNodeInserted",
"DOMNodeRemoved",
"DOMNodeRemovedFromDocument",
"DOMNodeInsertedIntoDocument",
"DOMAttrModified",
"DOMCharacterDataModified",
)
def __init__(self):
Event.__init__(self)
self._relatedNode = None
self._prevValue = None
self._newValue = None
self._attrName = None
self._attrChange = None
@property
def relatedNode(self):
return self._relatedNode
@property
def prevValue(self):
return self._prevValue
@property
def newValue(self):
return self._newValue
@property
def attrName(self):
return self._attrName
@property
def attrChange(self):
return self._attrChange
def initMutationEvent(
self,
eventTypeArg,
canBubbleArg,
cancelableArg,
relatedNodeArg,
prevValueArg,
newValueArg,
attrNameArg,
attrChangeArg,
):
self.initEvent(eventTypeArg, canBubbleArg, cancelableArg)
self._relatedNode = relatedNodeArg
self._prevValue = prevValueArg
self._newValue = newValueArg
self._attrName = attrNameArg
self._attrChange = attrChangeArg
| 1,557
|
Python
|
.py
| 55
| 20.981818
| 65
| 0.636913
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,901
|
EventListener.py
|
buffer_thug/thug/DOM/W3C/Events/EventListener.py
|
#!/usr/bin/env python
import logging
log = logging.getLogger("Thug")
# Introduced in DOM Level 2
class EventListener:
def __init__(self): # pragma: no cover
pass
def handleEvent(self, evt): # pragma: no cover
log.debug("handleEvent(%s)", evt)
| 274
|
Python
|
.py
| 9
| 26.222222
| 51
| 0.673077
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,902
|
UIEvent.py
|
buffer_thug/thug/DOM/W3C/Events/UIEvent.py
|
#!/usr/bin/env python
from .Event import Event
# Introduced in DOM Level 2
class UIEvent(Event):
EventTypes = ("DOMFocusIn", "DOMFocusOut", "DOMActivate")
def __init__(self):
Event.__init__(self)
self._view = None
self._detail = 0
@property
def view(self):
return self._view
@property
def detail(self):
return self._detail
def initUIEvent(
self, eventTypeArg, canBubbleArg, cancelableArg, viewArg=None, detailArg=0
):
self.initEvent(eventTypeArg, canBubbleArg, cancelableArg)
self._view = viewArg
self._detail = detailArg
| 634
|
Python
|
.py
| 21
| 23.857143
| 82
| 0.647934
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,903
|
MessageEvent.py
|
buffer_thug/thug/DOM/W3C/Events/MessageEvent.py
|
#!/usr/bin/env python
from .Event import Event
class MessageEvent(Event):
EventTypes = ("message",)
def __init__(self, event_type="message", options=None):
Event.__init__(self)
self.initMessageEvent(event_type, options)
def __init_options(self, options):
_options = dict(options) if options else {}
self._data = _options.get("data", None) if _options else None
self._origin = _options.get("origin", "") if _options else None
self._lastEventId = _options.get("lastEventId", "") if _options else None
self._source = _options.get("source", None) if _options else None
self._ports = _options.get("ports", []) if _options else []
@property
def data(self):
return self._data
@property
def origin(self):
return self._origin
@property
def lastEventId(self):
return self._lastEventId
@property
def source(self):
return self._source
@property
def ports(self):
return self._ports
def initMessageEvent(self, event_type="message", options=None):
self._type = event_type
self.__init_options(options)
| 1,174
|
Python
|
.py
| 32
| 29.8125
| 81
| 0.635398
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,904
|
EventException.py
|
buffer_thug/thug/DOM/W3C/Events/EventException.py
|
#!/usr/bin/env python
from thug.DOM.JSClass import JSClass
# Introduced in DOM Level 2
class EventException(RuntimeError, JSClass):
UNSPECIFIED_EVENT_TYPE_ERR = (
0 # If the Event's type was not specified by initializing the event before the
)
# method was called. Specification of the Event's type as null or an empty
# string will also trigger this exception.
def __init__(self, code):
super().__init__(code)
self.code = code
| 477
|
Python
|
.py
| 12
| 34.75
| 87
| 0.698482
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,905
|
DocumentEvent.py
|
buffer_thug/thug/DOM/W3C/Events/DocumentEvent.py
|
#!/usr/bin/env python
from thug.DOM.W3C.Core.DOMException import DOMException
from .HTMLEvent import HTMLEvent
from .MouseEvent import MouseEvent
from .MutationEvent import MutationEvent
from .StorageEvent import StorageEvent
from .UIEvent import UIEvent
EventMap = {
"HTMLEvent": HTMLEvent,
"HTMLEvents": HTMLEvent,
"MouseEvent": MouseEvent,
"MouseEvents": MouseEvent,
"MutationEvent": MutationEvent,
"MutationEvents": MutationEvent,
"StorageEvent": StorageEvent,
"UIEvent": UIEvent,
"UIEvents": UIEvent,
}
# Introduced in DOM Level 2
class DocumentEvent:
def __init__(self, doc):
self.doc = doc
def createEvent(self, eventType):
if eventType not in EventMap:
raise DOMException(DOMException.NOT_SUPPORTED_ERR)
return EventMap[eventType]()
| 828
|
Python
|
.py
| 26
| 27.5
| 62
| 0.739623
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,906
|
Cookies.py
|
buffer_thug/thug/WebTracking/Cookies.py
|
#!/usr/bin/env python
#
# Cookies.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
import logging
import datetime
log = logging.getLogger("Thug")
MAX_COOKIE_EXPIRES_DAYS = 365
class Cookies:
now = datetime.datetime.now()
cookie_expires_delta = datetime.timedelta(days=MAX_COOKIE_EXPIRES_DAYS)
def __init__(self):
self.cookie_id = 1
self.cookies = set()
def _inspect_cookie_expires(self, cookie):
if not cookie.expires:
return
expires = datetime.datetime.fromtimestamp(cookie.expires)
if self.now + self.cookie_expires_delta < expires:
log.warning( # pragma: no cover
"[TRACKING] [Cookie #%s] Expiring at %s (more than %s days from now)",
self.cookie_id,
expires,
MAX_COOKIE_EXPIRES_DAYS,
)
if self.now > expires: # pragma: no cover
log.warning(
"[TRACKING] [Cookie #%s] Expired at %s", self.cookie_id, expires
)
def _inspect_cookie_domain_initial_dot(self, cookie):
if cookie.domain_specified and cookie.domain_initial_dot:
log.warning(
"[TRACKING] [Cookie #%s] Domain starting with initial dot: %s",
self.cookie_id,
cookie.domain,
)
def _inspect_cookie_path(self, cookie):
if cookie.path_specified:
log.warning("[TRACKING] [Cookie #%s] Path: %s", self.cookie_id, cookie.path)
def _inspect_cookie_port(self, cookie):
if cookie.port_specified: # pragma: no cover
log.warning("[TRACKING] [Cookie #%s] Port: %s", self.cookie_id, cookie.port)
def _inspect_cookie_secure(self, cookie):
if cookie.secure:
log.warning("[TRACKING] [Cookie #%s] Secure flag set", self.cookie_id)
def _do_inspect_cookies(self, response):
for cookie in response.cookies:
self.cookies.add(cookie)
log.warning("[TRACKING] [Cookie #%s] %s", self.cookie_id, cookie.value)
self._inspect_cookie_expires(cookie)
self._inspect_cookie_domain_initial_dot(cookie)
self._inspect_cookie_path(cookie)
self._inspect_cookie_port(cookie)
self._inspect_cookie_secure(cookie)
self.cookie_id += 1
def inspect(self, response):
if response.history:
for r in response.history:
self._do_inspect_cookies(r)
self._do_inspect_cookies(response)
| 3,120
|
Python
|
.py
| 73
| 34.424658
| 88
| 0.639485
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,907
|
WebStorage.py
|
buffer_thug/thug/WebTracking/WebStorage.py
|
#!/usr/bin/env python
#
# WebStorage.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
import logging
log = logging.getLogger("Thug")
class WebStorage:
def __init__(self):
self.storage = {}
@staticmethod
def inspect_set_item(storage, key, value):
log.warning("[TRACKING] [%s setItem] %s = %s", storage, key, value)
@staticmethod
def inspect_remove_item(storage, key):
log.warning("[TRACKING] [%s removeItem] %s", storage, key)
@staticmethod
def inspect_clear(storage):
log.warning("[TRACKING] [%s clear]", storage)
| 1,176
|
Python
|
.py
| 31
| 34.741935
| 75
| 0.725594
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,908
|
WebTracking.py
|
buffer_thug/thug/WebTracking/WebTracking.py
|
#!/usr/bin/env python
#
# WebTracking.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
import logging
from .Cookies import Cookies
from .WebStorage import WebStorage
log = logging.getLogger("Thug")
class WebTracking:
def __init__(self):
self.cookies = Cookies()
self.webstorage = WebStorage()
def inspect_response(self, response):
if not log.ThugOpts.web_tracking: # pragma: no cover
return
self.cookies.inspect(response)
def inspect_storage_setitem(self, storage, key, value):
if not log.ThugOpts.web_tracking:
return
self.webstorage.inspect_set_item(storage, key, value)
def inspect_storage_removeitem(self, storage, key):
if not log.ThugOpts.web_tracking:
return
self.webstorage.inspect_remove_item(storage, key)
def inspect_storage_clear(self, storage):
if not log.ThugOpts.web_tracking:
return
self.webstorage.inspect_clear(storage)
| 1,594
|
Python
|
.py
| 41
| 33.95122
| 70
| 0.722727
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,909
|
ThugPlugins.py
|
buffer_thug/thug/Plugins/ThugPlugins.py
|
#!/usr/bin/env python
#
# ThugPlugins.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
import os
import sys
import logging
from zope.interface.verify import verifyObject
from zope.interface.exceptions import BrokenImplementation
import thug
from thug.Plugins.IPlugin import IPlugin
log = logging.getLogger("Thug")
PLUGINS_PATH = thug.__plugins_path__
HANDLER_NAME = "Handler"
HANDLER_MODULE = f"{HANDLER_NAME}.py"
FIRST_LOW_PRIO = 1000
PRE_ANALYSIS_PLUGINS = "PRE"
POST_ANALYSIS_PLUGINS = "POST"
sys.path.append(PLUGINS_PATH)
class ThugPlugins:
def __init__(self, phase, thugObj):
self.phase = phase
self.thugObj = thugObj
self.plugins = {}
self.last_low_prio = FIRST_LOW_PRIO
self.get_plugins()
def __call__(self): # pragma: no cover
self.run()
def handle_low_prio_plugin(self):
plugin_prio = self.last_low_prio
self.last_low_prio += 1
return plugin_prio
def get_plugin_prio(self, plugin_info):
if len(plugin_info) < 3:
return self.handle_low_prio_plugin()
try:
plugin_prio = int(plugin_info[2])
except ValueError:
plugin_prio = self.handle_low_prio_plugin()
return plugin_prio
def get_plugins(self):
plugins = {}
for p in os.listdir(PLUGINS_PATH):
if not p.startswith(self.phase):
continue
pkg = os.path.join(PLUGINS_PATH, p)
if not os.path.isdir(pkg): # pragma: no cover
continue
if HANDLER_MODULE not in os.listdir(pkg): # pragma: no cover
continue
plugin_info = p.split("-")
if len(plugin_info) < 2: # pragma: no cover
continue
plugin_name = p
plugin_prio = self.get_plugin_prio(plugin_info)
plugins[plugin_name] = plugin_prio
self.plugins = sorted(plugins.items(), key=lambda x: x[1])
def run(self):
for plugin in self.plugins:
name, prio = plugin
source = f"{name}.{HANDLER_NAME}"
module = __import__(source)
components = source.split(".")[1:]
for component in components:
module = getattr(module, component)
handler = getattr(module, "Handler", None)
if handler:
log.warning(
"[PLUGIN][%s] Phase: %s_ANALYSIS Priority: %d",
name.split("-")[1],
self.phase,
prio,
)
p = handler()
try:
verifyObject(IPlugin, p)
p.run(self.thugObj, log)
except BrokenImplementation as e: # pragma: no cover
log.warning("[%s] %s", source, e)
| 3,438
|
Python
|
.py
| 92
| 28.641304
| 73
| 0.605778
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,910
|
IPlugin.py
|
buffer_thug/thug/Plugins/IPlugin.py
|
#!/usr/bin/env python
#
# IPlugin.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
import zope.interface
class IPlugin(zope.interface.Interface):
def run(thug, log):
"""
This method is called when the plugin is invoked
Parameters:
@thug: Thug class main instance
@log: Thug root logger
"""
pass
| 956
|
Python
|
.py
| 27
| 32.037037
| 70
| 0.731892
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,911
|
Handler.py
|
buffer_thug/thug/Plugins/plugins/POST-TestPlugin-999/Handler.py
|
#!/usr/bin/env python
#
# TestPlugin.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
from zope.interface import implementer
from thug.Plugins.IPlugin import IPlugin
@implementer(IPlugin)
class Handler:
def run(self, thug, log):
log.debug(thug)
log.debug(log)
| 878
|
Python
|
.py
| 24
| 34.583333
| 70
| 0.772941
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,912
|
Handler.py
|
buffer_thug/thug/Plugins/plugins/PRE-TestPlugin-999/Handler.py
|
#!/usr/bin/env python
#
# TestPlugin.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
from zope.interface import implementer
from thug.Plugins.IPlugin import IPlugin
@implementer(IPlugin)
class Handler:
def run(self, thug, log):
log.debug(thug)
log.debug(log)
| 878
|
Python
|
.py
| 24
| 34.583333
| 70
| 0.772941
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,913
|
Windows.py
|
buffer_thug/thug/OS/Windows.py
|
#!/usr/bin/env python
#
# Windows.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
security_sys = (
"afwcore.sys",
"avgtpx86.sys",
"avipbb.sys",
"BkavAuto.sys",
"catflt.sys",
"cmderd.sys",
"eamon.sys",
"econceal.sys",
"EstRtw.sys",
"FortiRdr.sys",
"FStopW.sys",
"HookHelp.sys",
"ImmunetProtect.sys",
"kl1.sys",
"klflt.sys",
"klif.sys",
"kneps.sys",
"MpFilter.sys",
"nvcw32mf.sys",
"Parity.sys",
"prl_boot.sys",
"prl_fs.sys",
"prl_kmdd.sys",
"prl_memdev.sys",
"prl_mouf.sys",
"prl_pv32.sys",
"prl_sound.sys",
"prl_strg.sys",
"prl_tg.sys",
"prl_time.sys",
"protreg.sys",
"SophosBootDriver.sys",
"SYMEVENT.SYS",
"SysGuard.sys",
"tmactmon.sys",
"tmcomm.sys",
"tmevtmgr.sys",
"TMEBC32.sys",
"tmeext.sys",
"tmnciesc.sys",
"tmtdi.sys",
"vbengnt.sys",
"vm3dmp.sys",
"vmhgfs.sys",
"vmusbmouse.sys",
"vmmouse.sys",
"vmhgfs.sys",
"vmnet.sys",
"vmusbmouse.sys",
"vmx86.sys",
"vmxnet.sys",
"VBoxGuest.sys",
"VBoxMouse.sys",
"VBoxSF.sys",
"VBoxVideo.sys",
"WpsHelper.sys",
"7z.exe",
"a2cmd.exe",
"acs.exe",
"agb.exe",
"ARKIT.EXE",
"asOEHook.dll",
"avcuf32.dll",
"AYLaunch.exe",
"AVG Secure Search_toolbar.dll",
"avgdttbx.dll",
"avp.exe",
"avzkrnl.dll",
"BdProvider.dll",
"Bka.exe",
"cfgconv.exe",
"DoScan.exe",
"drwebsp.dll",
"egui.exe",
"EMET.dll",
"Fiddler.exe",
"FortiClient.exe",
"FPWin.exe",
"fsesgui.exe",
"fsgkiapi.dll",
"FSLSP.DLL",
"fshook32.dll",
"klwtblc.dll",
"instapi.dll",
"ips.exe",
"iTunesHelper.exe",
"KVPopup.exe",
"LangSel.exe",
"McShield.dll",
"mfc42.dll",
"muis.dll",
"mytilus3.dll",
"mytilus3_worker.dll",
"nse.exe",
"nsphsvr.exe",
"pctsGui.exe",
"RavMonD.exe",
"remote_eka_prague_loader.dll",
"SavMain.exe",
"setup_nativelook.exe",
"shellex.dll",
"shortcut.exe",
"SOPHOS~1.DLL",
"sqlvdi.dll",
"SUPERAntiSpyware.exe",
"TPAutoConnSvc.exe",
"unGuardX.exe",
"uninst.exe",
"uiWinMgr.exe",
"V3Main.exe",
"Vrmonnt.exe",
"winpers.exe",
"WinRAR.exe",
"wpsman.dll",
"WZSHLSTB.DLL",
"ZipSendB.dll",
)
win32_folders = (
"c:\\windows",
"c:\\windows\\system32",
"c:\\windows\\system32\\drivers",
"c:\\windows\\system32\\drivers\\etc",
)
win32_files = ("c:\\windows\\system32\\drivers\\etc\\hosts",)
win32_registry = {
"hklm\\software\\microsoft\\windows nt\\currentversion\\systemroot": "C:\\Windows",
"hklm\\software\\microsoft\\windows\\currentversion\\explorer\\shell folders\\common desktop": "",
}
win32_registry_map = {
"hklm\\software\\microsoft\\windows\\currentversion\\programfilesdir": "ProgramFiles",
}
| 3,503
|
Python
|
.py
| 149
| 19.161074
| 102
| 0.622946
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,914
|
Encoding.py
|
buffer_thug/thug/Encoding/Encoding.py
|
#!/usr/bin/env python
#
# Encoding.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
import charset_normalizer
class Encoding:
@staticmethod
def detect(data):
if isinstance(data, str):
data = data.encode()
return charset_normalizer.detect(data)
| 878
|
Python
|
.py
| 24
| 33.916667
| 70
| 0.756471
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,915
|
BaseLogging.py
|
buffer_thug/thug/Logging/BaseLogging.py
|
#!/usr/bin/env python
#
# BaseLogging.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
import os
import errno
import hashlib
import logging
import datetime
import tempfile
log = logging.getLogger("Thug")
class BaseLogging:
def __init__(self):
self.baseDir = None
@staticmethod
def check_module(module, config):
if not getattr(log.ThugOpts, f"{module}_logging", True):
return False
return config.getboolean(module, "enable")
def set_basedir(self, url):
if self.baseDir:
return
t = datetime.datetime.now()
m = hashlib.md5() # nosec
m.update(url.encode("utf8"))
cwd = os.getcwd()
base = os.getenv(
"THUG_LOGBASE",
cwd if os.access(cwd, os.W_OK) else tempfile.mkdtemp(),
)
self.baseDir = os.path.join(
base, "thug-logs", m.hexdigest(), t.strftime("%Y%m%d%H%M%S")
)
if not log.ThugOpts.file_logging:
return
try:
os.makedirs(self.baseDir)
except OSError as e:
if e.errno == errno.EEXIST:
pass
else: # pragma: no cover
raise
thug_csv = os.path.join(base, "thug-logs", "thug.csv")
csv_line = f"{m.hexdigest()},{url}\n"
if os.path.exists(thug_csv):
with open(thug_csv, encoding="utf-8", mode="r") as fd:
for line in fd.readlines():
if line == csv_line:
return
with open(thug_csv, encoding="utf-8", mode="at+") as fd:
fd.write(csv_line)
def set_absbasedir(self, basedir):
self.baseDir = basedir
if not log.ThugOpts.file_logging:
return
try:
os.makedirs(self.baseDir)
except OSError as e:
if e.errno == errno.EEXIST:
pass
else:
raise
| 2,546
|
Python
|
.py
| 75
| 25.92
| 72
| 0.603997
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,916
|
LoggingModules.py
|
buffer_thug/thug/Logging/LoggingModules.py
|
#!/usr/bin/env python
#
# LoggingModules.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
from .modules import JSON
from .modules import MongoDB
from .modules import ElasticSearch
LoggingModules = {
"json": JSON.JSON,
"mongodb": MongoDB.MongoDB,
"elasticsearch": ElasticSearch.ElasticSearch,
}
| 902
|
Python
|
.py
| 25
| 34.52
| 70
| 0.780571
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,917
|
ThugLogging.py
|
buffer_thug/thug/Logging/ThugLogging.py
|
#!/usr/bin/env python
#
# ThugLogging.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
import os
import operator
import types
import copy
import uuid
import random
import string
import errno
import hashlib
import logging
import configparser
from thug.Analysis.awis.AWIS import AWIS
from thug.Analysis.context.ContextAnalyzer import ContextAnalyzer
from thug.Analysis.favicon.Favicon import Favicon
from thug.Analysis.honeyagent.HoneyAgent import HoneyAgent
from thug.Analysis.screenshot.Screenshot import Screenshot
from thug.Analysis.shellcode.Shellcode import Shellcode
from .BaseLogging import BaseLogging
from .SampleLogging import SampleLogging
from .LoggingModules import LoggingModules
from .Features import Features
log = logging.getLogger("Thug")
class ThugLogging(BaseLogging, SampleLogging):
eval_min_length_logging = 4
def __init__(self):
BaseLogging.__init__(self)
SampleLogging.__init__(self)
self.AWIS = AWIS()
self.ContextAnalyzer = ContextAnalyzer()
self.Favicon = Favicon()
self.Features = Features()
self.HoneyAgent = HoneyAgent()
self.Screenshot = Screenshot()
self.Shellcode = Shellcode()
self.baseDir = None
self.formats = set()
self.frames = {}
self.meta = {}
self.meta_refresh = []
self.methods_cache = {}
self.redirections = {}
self.retrieved_urls = set()
self.shellcodes = set()
self.shellcode_urls = set()
self.ssl_certs = {}
self.url = ""
self.windows = {}
self.__init_hook_symbols()
self.__init_pyhooks()
self.__init_config()
@staticmethod
def get_random_name():
return "".join(
random.choice(string.ascii_lowercase) for _ in range(random.randint(10, 32))
)
def __init_hook_symbols(self):
for name in (
"eval",
"write",
):
setattr(
self,
f"{name}_symbol",
(
self.get_random_name(),
self.get_random_name(),
),
)
def __init_pyhooks(self):
hooks = log.PyHooks.get("ThugLogging", None)
if hooks is None:
return
get_method_function = operator.attrgetter("__func__")
get_method_self = operator.attrgetter("__self__")
for label, hook in hooks.items():
name = f"{label}_hook"
_hook = get_method_function(hook) if get_method_self(hook) else hook
method = types.MethodType(_hook, ThugLogging)
setattr(self, name, method)
def __init_config(self):
conf_file = os.path.join(log.configuration_path, "thug.conf")
if not os.path.exists(conf_file): # pragma: no cover
log.critical(
"Logging subsystem not initialized (configuration file not found)"
)
return
self.modules = {}
config = configparser.ConfigParser()
config.read(conf_file)
for name, module in LoggingModules.items():
if self.check_module(name, config):
self.modules[name.strip()] = module()
for m in self.modules.values():
for fmt in getattr(m, "formats", tuple()):
self.formats.add(fmt) # pragma: no cover
def resolve_method(self, name):
if name in self.methods_cache:
return self.methods_cache[name]
methods = []
for module in self.modules.values():
m = getattr(module, name, None)
if m:
methods.append(m)
self.methods_cache[name] = methods
return methods
def clear(self):
self.Features.clear()
def set_url(self, url):
self.clear()
self.url = url
for m in self.resolve_method("set_url"):
m(url)
if log.ThugOpts.awis: # pragma: no cover
report = log.ThugLogging.AWIS.query(url)
if not report:
return
for m in self.resolve_method("log_awis"):
m(report)
def add_behavior_warn(
self,
description=None,
cve=None,
snippet=None,
method="Dynamic Analysis",
verbose=True,
):
for m in self.resolve_method("add_behavior_warn"):
m(description, cve, snippet, method)
if verbose or log.ThugOpts.verbose or log.ThugOpts.debug:
log.warning(description)
def check_snippet(self, s):
return len(s) < self.eval_min_length_logging
def add_code_snippet(
self,
snippet,
language,
relationship,
method="Dynamic Analysis",
check=False,
force=False,
):
if not log.ThugOpts.code_logging and not force:
return None
if check and self.check_snippet(snippet):
return None
tag = uuid.uuid4()
for m in self.resolve_method("add_code_snippet"):
m(snippet, language, relationship, tag.hex, method)
return tag.hex
def add_shellcode_snippet(self, snippet, language, relationship, method):
tag = uuid.uuid4()
for m in self.resolve_method("add_shellcode_snippet"):
m(snippet, language, relationship, tag.hex, method)
return tag.hex
def log_file(self, data, url=None, params=None, sampletype=None):
if isinstance(data, bytearray):
data = bytes(data)
sample = self.build_sample(data, url, sampletype)
if sample is None:
return None
return self.__log_file(sample, data, url, params)
def __log_file(self, sample, data, url=None, params=None):
for m in self.resolve_method("log_file"):
m(copy.deepcopy(sample), url, params)
if sample["type"] in ("JAR",):
self.HoneyAgent.analyze(data, sample, self.baseDir, params)
log.SampleClassifier.classify(data, sample["md5"])
return sample
def log_event(self):
for m in self.resolve_method("export"):
m(self.baseDir)
for m in self.resolve_method("log_event"): # pragma: no cover
m(self.baseDir)
if log.ThugOpts.file_logging:
log.warning("Thug analysis logs saved at %s", self.baseDir)
def log_connection(self, source, destination, method, flags=None):
"""
Log the connection (redirection, link) between two pages
@source The origin page
@destination The page the user is made to load next
@method Link, iframe, .... that moves the user from source to destination
@flags Additional information flags. Existing are: "exploit"
"""
if flags is None:
flags = {}
for m in self.resolve_method("log_connection"):
m(source, destination, method, flags)
def log_location(self, url, data, flags=None):
"""
Log file information for a given url
@url URL we fetched this file from
@data File dictionary data
Keys:
- content Content
- md5 MD5 checksum
- sha256 SHA-256 checksum
- ssdeep Ssdeep hash
- fsize Content size
- ctype Content type (whatever the server says it is)
- mtype Calculated MIME type
@flags Additional information flags
"""
if flags is None:
flags = {}
for m in self.resolve_method("log_location"):
m(url, data, flags=flags)
def log_exploit_event(
self, url, module, description, cve=None, data=None, forward=True
):
"""
Log file information for a given url
@url URL where this exploit occurred
@module Module/ActiveX Control, ... that gets exploited
@description Description of the exploit
@cve CVE number (if available)
@forward Forward log to add_behavior_warn
"""
if forward:
self.add_behavior_warn(f"[{module}] {description}", cve=cve)
for m in self.resolve_method("log_exploit_event"):
m(url, module, description, cve=cve, data=data)
def log_image_ocr(self, url, result, forward=True):
"""
Log the results of images OCR-based analysis
@url Image URL
@result OCR analysis result
@forward Forward log to log.warning
"""
if forward:
log.warning("[OCR] Result: %s (URL: %s)", result, url)
for m in self.resolve_method("log_image_ocr"):
m(url, result)
def log_classifier(self, classifier, url, rule, tags="", meta=None):
"""
Log classifiers matching for a given url
@classifier Classifier name
@url URL where the rule match occurred
@rule Rule name
@meta Rule meta
@tags Rule tags
"""
self.add_behavior_warn(
f"[{classifier.upper()} Classifier] URL: {url} "
f"(Rule: {rule}, Classification: {tags})"
)
if meta is None:
meta = {} # pragma: no cover
for m in self.resolve_method("log_classifier"):
m(classifier, url, rule, tags, meta)
hook = getattr(self, "log_classifier_hook", None)
if hook:
hook(classifier, url, rule, tags, meta) # pylint:disable=not-callable
def log_cookies(self):
for m in self.resolve_method("log_cookies"):
m()
def log_redirect(self, response, window):
self.log_cookies()
if not response.history:
if "Set-Cookie" in response.headers:
log.CookieClassifier.classify(
response.url, response.headers["Set-Cookie"]
)
if response.url:
log.URLClassifier.classify(response.url)
log.HTTPSession.fetch_ssl_certificate(response.url)
return None
final = response.url
while final is None: # pragma: no cover
for h in reversed(response.history):
final = h.url
for h in response.history:
if "Set-Cookie" in h.headers:
log.CookieClassifier.classify(h.url, h.headers["Set-Cookie"])
location = h.headers.get("location", None)
self.add_behavior_warn(
f"[HTTP Redirection (Status: {h.status_code})] "
f"Content-Location: {h.url} --> Location: {location}"
)
location = log.HTTPSession.normalize_url(window, location)
self.log_connection(h.url, location, "http-redirect")
log.HTMLClassifier.classify(h.url, h.content)
log.URLClassifier.classify(h.url)
log.HTTPSession.fetch_ssl_certificate(h.url)
ctype = h.headers.get("content-type", "unknown")
md5 = hashlib.md5() # nosec
md5.update(h.content)
sha256 = hashlib.sha256()
sha256.update(h.content)
mtype = log.Magic.get_mime(h.content)
data = {
"content": h.content,
"status": h.status_code,
"md5": md5.hexdigest(),
"sha256": sha256.hexdigest(),
"fsize": len(h.content),
"ctype": ctype,
"mtype": mtype,
}
self.log_location(h.url, data)
log.URLClassifier.classify(final)
log.HTTPSession.fetch_ssl_certificate(final)
return final
def log_href_redirect(self, referer, url):
if not url: # pragma: no cover
return
self.add_behavior_warn(
f"[HREF Redirection (document.location)] Content-Location: {referer} --> Location: {url}"
)
self.log_connection(referer, url, "href")
def log_certificate(self, url, certificate):
if not log.ThugOpts.cert_logging:
return
self.add_behavior_warn(
f"[Certificate]{os.linesep} {certificate}", verbose=False
)
for m in self.resolve_method("log_certificate"): # pragma: no cover
m(url, certificate)
def log_analysis_module(self, dirname, sample, report, module, fmt="json"):
filename = f"{sample['md5']}.{fmt}"
self.store_content(dirname, filename, report)
method = f"log_{module}"
for m in self.resolve_method(method): # pragma: no cover
m(sample, report)
def log_honeyagent(self, dirname, sample, report):
self.log_analysis_module(dirname, sample, report, "honeyagent")
def log_favicon(self, url, favicon):
dhash = self.Favicon.eval_dhash(favicon)
if dhash is None: # pragma: no cover
return
self.add_behavior_warn(f"[Favicon] URL: {url} (dhash: {dhash})")
for m in self.resolve_method("log_favicon"):
m(url, dhash)
def log_screenshot(self, url, screenshot):
"""
Log the screenshot of the analyzed page
@url URL
@screenshot Screenshot
"""
dirname = os.path.join(self.baseDir, "analysis", "screenshots")
filename = f"{hashlib.sha256(screenshot).hexdigest()}.jpg"
self.store_content(dirname, filename, screenshot)
for m in self.resolve_method("log_screenshot"): # pragma: no cover
m(url, screenshot)
@staticmethod
def store_content(dirname, filename, content):
"""
This method is meant to be used when a content (downloaded
pages, samples, reports, etc. ) has to be saved in a flat
file.
@dirname The directory where to store content
@filename The file where to store content
@content The content to be stored
"""
if not log.ThugOpts.file_logging:
return None
try:
os.makedirs(dirname)
except OSError as e:
if e.errno == errno.EEXIST:
pass
else: # pragma: no cover
raise
fname = os.path.join(dirname, filename)
try:
with open(fname, "wb") as fd:
fd.write(content)
except Exception as e: # pragma: no cover,pylint:disable=broad-except
log.warning(str(e))
return fname
| 15,290
|
Python
|
.py
| 386
| 29.642487
| 101
| 0.586701
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,918
|
SampleLogging.py
|
buffer_thug/thug/Logging/SampleLogging.py
|
#!/usr/bin/env python
#
# SampleLogging.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
import os
import base64
import logging
import hashlib
import zipfile
import tempfile
import pefile
import ssdeep
import magic
log = logging.getLogger("Thug")
class SampleLogging:
doc_mime_types = (
"application/msword",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
)
rtf_mime_types = (
"text/rtf",
"application/rtf",
)
MB = 1024 * 1024
MAX_CAB_FILE_SIZE = 32 * MB
MAX_DOC_FILE_SIZE = 32 * MB
MAX_ELF_FILE_SIZE = 32 * MB
MAX_JAR_FILE_SIZE = 32 * MB
MAX_PDF_FILE_SIZE = 32 * MB
MAX_PE_FILE_SIZE = 32 * MB
MAX_RTF_FILE_SIZE = 32 * MB
MAX_SWF_FILE_SIZE = 32 * MB
def __init__(self):
self.types = ("PE", "ELF", "PDF", "JAR", "SWF", "DOC", "RTF", "CAB")
def is_pe(self, data):
if len(data) > self.MAX_PE_FILE_SIZE:
return False # pragma: no cover
try:
pefile.PE(data=data, fast_load=True)
except Exception: # pylint:disable=broad-except
return False
return True
@staticmethod
def get_imphash(data):
try:
pe = pefile.PE(data=data)
except Exception: # pylint:disable=broad-except
return None
return pe.get_imphash()
def is_pdf(self, data):
if len(data) > self.MAX_PDF_FILE_SIZE:
return False # pragma: no cover
data = data.encode() if isinstance(data, str) else data
return data[:1024].find(b"%PDF") != -1
def is_elf(self, data):
if len(data) > self.MAX_ELF_FILE_SIZE:
return False # pragma: no cover
data = data.encode() if isinstance(data, str) else data
return data.startswith(b"\x7fELF")
def is_jar(self, data):
result = False
if len(data) > self.MAX_JAR_FILE_SIZE:
return result # pragma: no cover
data = data.encode() if isinstance(data, str) else data
_, jar = tempfile.mkstemp()
with open(jar, "wb") as fd:
fd.write(data)
try:
with zipfile.ZipFile(jar) as z:
result = any(t.endswith(".class") for t in z.namelist())
except Exception: # pylint:disable=broad-except
pass
os.remove(jar)
return result
def is_swf(self, data):
if len(data) > self.MAX_SWF_FILE_SIZE:
return False # pragma: no cover
data = data.encode() if isinstance(data, str) else data
return data.startswith(b"CWS") or data.startswith(b"FWS")
def is_doc(self, data):
if len(data) > self.MAX_DOC_FILE_SIZE:
return False # pragma: no cover
data = data.encode() if isinstance(data, str) else data
return log.Magic.get_mime(data) in self.doc_mime_types
def is_rtf(self, data):
if len(data) > self.MAX_RTF_FILE_SIZE:
return False # pragma: no cover
return magic.from_buffer(data, mime=True) in self.rtf_mime_types
def is_cab(self, data):
if len(data) > self.MAX_CAB_FILE_SIZE:
return False # pragma: no cover
data = data.encode() if isinstance(data, str) else data
return data.startswith(b"MSCF")
def get_sample_type(self, data):
for t in self.types:
p = getattr(self, f"is_{t.lower()}", None)
if p and p(data):
return t
return None
def build_sample(self, data, url=None, sampletype=None):
if not data:
return None
p = {}
if sampletype:
data = data.encode() if isinstance(data, str) else data
p["type"] = sampletype
else:
p["type"] = self.get_sample_type(data)
if p["type"] is None:
return None
p["md5"] = hashlib.md5(data).hexdigest() # nosec
p["sha1"] = hashlib.sha1(data).hexdigest() # nosec
p["sha256"] = hashlib.sha256(data).hexdigest()
p["ssdeep"] = ssdeep.hash(data)
if p["type"] in ("PE",):
imphash = self.get_imphash(data)
if imphash:
p["imphash"] = imphash
if url:
p["url"] = url
p["data"] = base64.b64encode(data).decode()
return p
| 4,945
|
Python
|
.py
| 135
| 28.837037
| 82
| 0.605787
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,919
|
Features.py
|
buffer_thug/thug/Logging/Features.py
|
#!/usr/bin/env python
#
# Features.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
import logging
log = logging.getLogger("Thug")
class Features:
counters = (
"activex_count",
"addeventlistener_count",
"alert_count",
"appendchild_count",
"attachevent_count",
"body_count",
"characters_count",
"clonenode_count",
"createdocumentfragment_count",
"createelement_count",
"data_uri_count",
"detachevent_count",
"dispatchevent_count",
"document_write_count",
"embed_count",
"embed_string_count",
"eval_count",
"external_javascript_count",
"external_javascript_characters_count",
"external_javascript_whitespaces_count",
"form_string_count",
"frame_string_count",
"getcomputedstyle_count",
"head_count",
"hidden_count",
"html_count",
"iframe_count",
"iframe_small_width_count",
"iframe_small_height_count",
"iframe_small_area_count",
"iframe_string_count",
"inline_javascript_count",
"inline_javascript_characters_count",
"inline_javascript_whitespaces_count",
"inline_vbscript_count",
"inline_vbscript_characters_count",
"inline_vbscript_whitespaces_count",
"insertbefore_count",
"meta_refresh_count",
"noscript_count",
"object_count",
"object_small_width_count",
"object_small_height_count",
"object_small_area_count",
"object_string_count",
"removeattribute_count",
"removechild_count",
"removeeventlistener_count",
"replacechild_count",
"setattribute_count",
"setinterval_count",
"settimeout_count",
"title_count",
"url_count",
"whitespaces_count",
)
def __init__(self):
self.features = {}
def __getattr__(self, key):
if key.startswith("increase_"):
counter = key.split("increase_")[1]
if counter in self.counters:
return lambda: self.increase(counter)
if key.startswith("add_"):
counter = key.split("add_")[1]
if counter in self.counters:
return lambda value: self.add(counter, value)
raise AttributeError # pragma: no cover
def clear(self):
self.features = {}
def init_features(self, url):
if url in self.features:
return
self.features[url] = {}
for counter in self.counters:
self.features[url][counter] = 0
@property
def features_url(self):
if log.ThugOpts.local:
return log.ThugLogging.url
url = getattr(log, "last_url", None)
return url if url else log.DFT.window.url
def increase(self, key):
if not log.ThugOpts.features_logging: # pragma: no cover
return
url = self.features_url
self.init_features(url)
self.features[url][key] += 1
def add(self, key, value):
if not log.ThugOpts.features_logging: # pragma: no cover
return
url = self.features_url
self.init_features(url)
self.features[url][key] += value
| 3,897
|
Python
|
.py
| 115
| 26.008696
| 70
| 0.618655
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,920
|
ElasticSearch.py
|
buffer_thug/thug/Logging/modules/ElasticSearch.py
|
#!/usr/bin/env python
#
# ElasticSearch.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
import os
import logging
import configparser
try:
import elasticsearch
ELASTICSEARCH_MODULE = True
except ImportError: # pragma: no cover
ELASTICSEARCH_MODULE = False
from .JSON import JSON
log = logging.getLogger("Thug")
class ElasticSearch(JSON):
def __init__(self):
JSON.__init__(self, provider=True)
self.enabled = False
if not ELASTICSEARCH_MODULE: # pragma: no cover
return
if not log.ThugOpts.elasticsearch_logging:
return
if not self.__init_elasticsearch():
return
self.enabled = True
def __init_config(self):
self.opts = {}
conf_file = os.path.join(log.configuration_path, "thug.conf")
if not os.path.exists(conf_file):
return False
config = configparser.ConfigParser()
config.read(conf_file)
self.opts["enable"] = config.getboolean("elasticsearch", "enable")
if not self.opts["enable"]:
return False
self.opts["url"] = config.get("elasticsearch", "url")
self.opts["index"] = config.get("elasticsearch", "index")
return True
def __init_elasticsearch(self):
if not self.__init_config():
return False
self.es = elasticsearch.Elasticsearch(self.opts["url"])
if not self.es.ping():
log.warning("[WARNING] ElasticSearch instance not properly initialized")
return False
self.es.options(ignore_status=404).indices.create(index=self.opts["index"])
return True
def export(self, basedir): # pylint:disable=unused-argument
if not self.enabled:
return None
res = self.es.index(index=self.opts["index"], document=self.data)
return res["_id"]
| 2,479
|
Python
|
.py
| 66
| 31.212121
| 84
| 0.673786
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,921
|
MongoDB.py
|
buffer_thug/thug/Logging/modules/MongoDB.py
|
#!/usr/bin/env python
#
# MongoDB.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
import os
import base64
import logging
import datetime
import configparser
import pymongo
import gridfs
from pymongo.errors import DuplicateKeyError
import thug
from .ExploitGraph import ExploitGraph
log = logging.getLogger("Thug")
class MongoDB:
def __init__(self):
self.enabled = True
if not self.__init_config():
return
self.__init_db()
self.chain_id = self.make_counter(0)
def __init_config(self):
self.opts = {}
if log.ThugOpts.mongodb_address:
self.opts["host"] = log.ThugOpts.mongodb_address
self.opts["enable"] = True
return True
conf_file = os.path.join(log.configuration_path, "thug.conf")
if not os.path.exists(conf_file): # pragma: no cover
self.enabled = False
return False
config = configparser.ConfigParser()
config.read(conf_file)
self.opts["enable"] = config.getboolean("mongodb", "enable")
if self.opts["enable"]: # pragma: no cover
self.opts["host"] = config.get("mongodb", "host")
return True
self.enabled = False
return False
def __init_db(self):
client = getattr(pymongo, "MongoClient", None)
try:
connection = client(self.opts["host"])
except Exception: # pylint:disable=broad-except
log.warning("[MongoDB] MongoDB instance not available")
self.enabled = False
return
db = connection.thug
self.analyses = db.analyses
self.awis = db.awis
self.behaviors = db.behaviors
self.certificates = db.certificates
self.classifiers = db.classifiers
self.codes = db.codes
self.connections = db.connections
self.cookies = db.cookies
self.exploits = db.exploits
self.favicons = db.favicons
self.graphs = db.graphs
self.honeyagent = db.honeyagent
self.images = db.images
self.json = db.json
self.locations = db.locations
self.samples = db.samples
self.screenshots = db.screenshots
self.urls = db.urls
dbfs = connection.thugfs
self.fs = gridfs.GridFS(dbfs)
self.__build_indexes()
def __build_indexes(self):
self.urls.create_index("url", unique=True)
@staticmethod
def make_counter(p):
_id = p
while True:
yield _id
_id += 1
def __get_url(self, url):
entry = self.urls.find_one({"url": url})
return entry["_id"] if entry else None
def get_url(self, url):
try:
entry = self.urls.insert_one({"url": url}).inserted_id
except DuplicateKeyError:
entry = self.__get_url(url)
return entry
def set_url(self, url):
if not self.enabled:
return
self.graph = ExploitGraph(url)
self.url_id = self.get_url(url)
if self.url_id is None: # pragma: no cover
log.warning("[MongoDB] MongoDB internal error")
self.enabled = False
return
analysis = {
"url_id": self.url_id,
"timestamp": str(datetime.datetime.now()),
"thug": {
"version": thug.__version__,
"jsengine": {
"engine": thug.__jsengine__,
"version": thug.__jsengine_version__,
},
"personality": {"useragent": log.ThugOpts.useragent},
"plugins": {
"acropdf": self.get_vuln_module("acropdf"),
"javaplugin": self.get_vuln_module("_javaplugin"),
"shockwaveflash": self.get_vuln_module("shockwave_flash"),
},
"options": {
"local": log.ThugOpts.local,
"nofetch": log.ThugOpts.no_fetch,
"proxy": log.ThugOpts._proxy,
"events": log.ThugOpts.events,
"delay": log.ThugOpts.delay,
"referer": log.ThugOpts.referer,
"timeout": log.ThugOpts.timeout,
"threshold": log.ThugOpts.threshold,
"extensive": log.ThugOpts.extensive,
},
},
}
self.analysis_id = self.analyses.insert_one(analysis).inserted_id
log.warning("[MongoDB] Analysis ID: %s", str(self.analysis_id))
@staticmethod
def get_vuln_module(module):
disabled = getattr(log.ThugVulnModules, f"{module}_disabled", True)
if disabled:
return "disabled"
return getattr(log.ThugVulnModules, module)
def log_location(self, url, data, flags=None):
if not self.enabled:
return
if flags is None:
flags = {}
content = data.get("content", None)
content_id = (
self.fs.put(content, mtype=data.get("mtype", None)) if content else None
)
location = {
"analysis_id": self.analysis_id,
"url_id": self.get_url(url),
"status": data.get("status", None),
"content_id": content_id,
"content-type": data.get("ctype", None),
"md5": data.get("md5", None),
"sha256": data.get("sha256", None),
"ssdeep": data.get("ssdeep", None),
"flags": flags,
"size": data.get("fsize", None),
"mime-type": data.get("mtype", None),
}
self.locations.insert_one(location)
def log_connection(self, source, destination, method, flags=None):
if not self.enabled:
return
if flags is None:
flags = {}
connection = {
"analysis_id": self.analysis_id,
"chain_id": next(self.chain_id),
"source_id": self.get_url(source),
"destination_id": self.get_url(destination),
"method": method,
"flags": flags,
}
self.connections.insert_one(connection)
self.graph.add_connection(source, destination, method)
def log_exploit_event(self, url, module, description, cve=None, data=None):
"""
Log file information for a given url
@url URL where this exploit occurred
@module Module/ActiveX Control, ... that gets exploited
@description Description of the exploit
@cve CVE number (if available)
"""
if not self.enabled:
return
exploit = {
"analysis_id": self.analysis_id,
"url_id": self.get_url(url),
"module": module,
"description": description,
"cve": cve,
"data": data,
}
self.exploits.insert_one(exploit)
def log_classifier(self, classifier, url, rule, tags="", meta=None):
"""
Log classifiers matching for a given url
@classifier Classifier name
@url URL where the rule match occurred
@rule Rule name
@meta Rule meta
@tags Rule tags
"""
if not self.enabled:
return
classification = {
"analysis_id": self.analysis_id,
"url_id": self.get_url(url),
"classifier": classifier,
"rule": rule,
"meta": meta if meta else {},
"tags": tags,
}
self.classifiers.insert_one(classification)
def log_image_ocr(self, url, result):
"""
Log the results of images OCR-based analysis
@url Image URL
@result OCR analysis result
"""
if not self.enabled:
return
image = {
"analysis_id": self.analysis_id,
"classifier": "OCR",
"url_id": self.get_url(url),
"result": result,
}
self.images.insert_one(image)
def log_screenshot(self, url, screenshot):
"""
Log the base64-encoded screenshot of the analyzed page
@url URL
@screenshot URL screenshot
"""
if not self.enabled:
return
content = base64.b64encode(screenshot)
item = {
"analysis_id": self.analysis_id,
"url": self.get_url(url),
"screenshot": content.decode(),
}
self.screenshots.insert_one(item)
def log_favicon(self, url, dhash):
"""
Log the favicon dhash
@url URL
@dhash dhash
"""
if not self.enabled:
return
item = {
"analysis_id": self.analysis_id,
"url": self.get_url(url),
"dhash": dhash,
}
self.favicons.insert_one(item)
def log_cookies(self):
attrs = (
"comment",
"comment_url",
"discard",
"domain",
"domain_initial_dot",
"domain_specified",
"expires",
"name",
"path",
"path_specified",
"port",
"port_specified",
"rfc2109",
"secure",
"value",
"version",
)
for cookie in log.HTTPSession.cookies:
item = {
"analysis_id": self.analysis_id,
}
for attr in attrs:
value = getattr(cookie, attr, None)
if value is None:
continue
item[attr] = value
self.cookies.insert_one(item)
def get_url_from_location(self, md5):
result = self.locations.find_one({"analysis_id": self.analysis_id, "md5": md5})
if not result: # pragma: no cover
return None
return result["url_id"]
def log_file(self, data, url=None, params=None): # pylint:disable=unused-argument
if not self.enabled:
return
r = dict(data)
result = self.samples.find_one(
{
"analysis_id": self.analysis_id,
"type": data["type"],
"md5": data["md5"],
"sha1": data["sha1"],
}
)
if result:
return
r["sample_id"] = self.fs.put(data["data"])
r.pop("data", None)
if url: # pragma: no cover
url_id = self.get_url(url)
r.pop("url", None)
else:
url_id = self.get_url_from_location(data["md5"])
r["analysis_id"] = self.analysis_id
r["url_id"] = url_id
self.samples.insert_one(r)
def log_json(self, basedir):
if not self.enabled:
return
if not log.ThugOpts.json_logging:
return
p = log.ThugLogging.modules.get("json", None)
if p is None:
return
self._log_json(basedir, p) # pragma: no cover
def _log_json(self, basedir, p): # pragma: no cover
m = getattr(p, "get_json_data", None)
if m is None:
return
report = m(basedir)
analysis = {"analysis_id": self.analysis_id, "report": report}
self.json.insert_one(analysis)
def log_event(self, basedir):
if not self.enabled:
return
self.log_json(basedir)
G = self.graph.draw()
if G is None: # pragma: no cover
return
graph = {"analysis_id": self.analysis_id, "graph": G}
self.graphs.insert_one(graph)
@staticmethod
def fix(data, drop_spaces=True):
"""
Fix data encoding
@data data to encode properly
"""
if not data:
return str()
try:
if isinstance(data, str):
enc_data = data
else:
enc = log.Encoding.detect(data)
encoding = enc["encoding"] if enc["encoding"] else "utf-8"
enc_data = data.decode(encoding)
return enc_data.replace("\n", "").strip() if drop_spaces else enc_data
except UnicodeDecodeError: # pragma: no cover
return str()
def add_code_snippet(
self, snippet, language, relationship, tag, method="Dynamic Analysis"
):
if not self.enabled:
return
code = {
"analysis_id": self.analysis_id,
"snippet": self.fix(snippet, drop_spaces=False),
"language": self.fix(language),
"relationship": self.fix(relationship),
"tag": self.fix(tag),
"method": self.fix(method),
}
self.codes.insert_one(code)
def add_shellcode_snippet(
self, snippet, language, relationship, tag, method="Dynamic Analysis"
):
if not self.enabled:
return
code = {
"analysis_id": self.analysis_id,
"snippet": base64.b64encode(
snippet.encode() if isinstance(snippet, str) else snippet
),
"language": self.fix(language),
"relationship": self.fix(relationship),
"tag": self.fix(tag),
"method": self.fix(method),
}
self.codes.insert_one(code)
def add_behavior(
self, description=None, cve=None, snippet=None, method="Dynamic Analysis"
):
if not self.enabled: # pragma: no cover
return
if not cve and not description:
return
behavior = {
"analysis_id": self.analysis_id,
"description": self.fix(description),
"cve": self.fix(cve),
"snippet": self.fix(snippet, drop_spaces=False),
"method": self.fix(method),
"timestamp": str(datetime.datetime.now()),
}
self.behaviors.insert_one(behavior)
def add_behavior_warn(
self, description=None, cve=None, snippet=None, method="Dynamic Analysis"
):
if not self.enabled:
return
self.add_behavior(description, cve, snippet, method)
def log_certificate(self, url, certificate):
if not self.enabled:
return
certificate = {
"analysis_id": self.analysis_id,
"url_id": self.get_url(url),
"certificate": certificate,
}
self.certificates.insert_one(certificate)
def log_awis(self, report): # pragma: no cover
if not self.enabled:
return
awis = {"analysis_id": self.analysis_id, "report": report}
self.awis.insert_one(awis)
def log_analysis_module(self, collection, sample, report):
if not self.enabled:
return # pragma: no cover
s = self.samples.find_one(
{
"analysis_id": self.analysis_id,
"md5": sample["md5"],
"sha1": sample["sha1"],
}
)
if not s: # pragma: no cover
return
r = {"analysis_id": self.analysis_id, "sample_id": s["_id"], "report": report}
collection.insert_one(r)
def log_honeyagent(self, sample, report):
self.log_analysis_module(self.honeyagent, sample, report)
| 16,005
|
Python
|
.py
| 449
| 25.106904
| 87
| 0.544665
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,922
|
ExploitGraph.py
|
buffer_thug/thug/Logging/modules/ExploitGraph.py
|
#!/usr/bin/env python
#
# ExploitGraph.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
import json
import logging
import networkx
from networkx.readwrite import json_graph
log = logging.getLogger("Thug")
class ExploitGraph:
def __init__(self, url):
self.G = networkx.MultiDiGraph(url=url, name="thug-exploit-graph")
def add_connection(self, source, destination, method):
self.G.add_node(source)
self.G.add_node(destination)
self.G.add_edge(source, destination, method=method)
def draw(self):
G = networkx.convert_node_labels_to_integers(self.G, label_attribute="url")
d = json_graph.node_link_data(G)
return json.dumps(d)
| 1,293
|
Python
|
.py
| 33
| 35.878788
| 83
| 0.74361
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,923
|
Mapper.py
|
buffer_thug/thug/Logging/modules/Mapper.py
|
#!/usr/bin/env python
#
# Mapper.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
# Author: Thorsten Sick <thorsten.sick@avira.com> from Avira
# (developed for the iTES Project http://ites-project.org)
#
# Changes:
# - pydot support (Angelo Dell'Aera <angelo.dellaera@honeynet.org>)
# - Replace pydot with pygraphviz (Angelo Dell'Aera <angelo.dellaera@honeynet.org>)
import os
import json
from urllib.parse import urlparse
try:
import pygraphviz
PYGRAPHVIZ_MODULE = True
except ImportError: # pragma: no cover
PYGRAPHVIZ_MODULE = False
class DictDiffer:
"""
Calculate the difference between two dictionaries as:
(1) items added
(2) items removed
(3) keys same in both but changed values
(4) keys same in both and unchanged values
"""
def __init__(self, current_dict, past_dict):
self.current_dict = current_dict
self.past_dict = past_dict
self.set_current = set(current_dict.keys())
self.set_past = set(past_dict.keys())
self.intersect = self.set_current.intersection(self.set_past)
def added(self):
return self.set_current - self.intersect
def removed(self):
return self.set_past - self.intersect
def changed(self):
return set(
o for o in self.intersect if self.past_dict[o] != self.current_dict[o]
)
def unchanged(self):
return set(
o for o in self.intersect if self.past_dict[o] == self.current_dict[o]
)
def anychange(self):
return self.added() or self.removed() or self.changed()
class Mapper:
"""
Map URL relationships
"""
markup_types = (
"text/html",
"text/xml",
"text/css",
)
image_types = ("image/",)
exec_types = (
"application/javascript",
"text/javascript",
"application/x-javascript",
)
def __init__(self, resdir, simplify=False):
"""
@resdir : Directory to store the result svg in
@simplify : Reduce the urls to server names
"""
self.simplify = simplify
self.data = {"locations": [], "connections": []}
self.first_track = True # flag indicating that we did not follow a track yet
self.__init_graph(resdir)
def __init_graph(self, resdir):
if not PYGRAPHVIZ_MODULE:
return # pragma: no cover
graphdir = os.path.abspath(os.path.join(resdir, os.pardir))
self.svgfile = os.path.join(graphdir, "graph.svg")
self.graph = pygraphviz.AGraph(strict=False, directed=True, rankdir="LR")
@staticmethod
def _check_content_type(loc, t):
return loc["content-type"] and loc["content-type"].lower().startswith(t)
def _check_types(self, loc, _types):
for t in _types:
if self._check_content_type(loc, t):
return True
return False
def check_markup(self, loc):
return self._check_types(loc, self.markup_types)
def check_image(self, loc):
return self._check_types(loc, self.image_types)
def check_exec(self, loc):
return self._check_types(loc, self.exec_types)
def get_shape(self, loc):
# Markup
if self.check_markup(loc):
return "box"
# Images
if self.check_image(loc):
return "oval"
# Executable stuff
if self.check_exec(loc):
return "hexagon"
return None
@staticmethod
def get_fillcolor(loc):
if "error" in loc["flags"]:
return "orange"
return None
@staticmethod
def get_color(con):
if con["method"] in ("iframe",):
return "orange"
return None
@staticmethod
def normalize_url(url):
if url.endswith("/"):
return url[:-1]
return url
def dot_from_data(self):
# Create dot from data
if "locations" in self.data:
for loc in self.data["locations"]:
if loc["display"] is False:
continue
url = self.normalize_url(loc["url"])
self.graph.add_node(url)
node = self.graph.get_node(url)
shape = self.get_shape(loc)
if shape:
node.attr["shape"] = shape # pylint:disable=no-member
fillcolor = self.get_fillcolor(loc)
if fillcolor:
node.attr["style"] = "filled" # pylint:disable=no-member
node.attr["fillcolor"] = fillcolor # pylint:disable=no-member
if "connections" in self.data:
# Add edges
count = 1
for con in self.data["connections"]:
if con["display"] is False:
continue
_s = self.normalize_url(con["source"])
source = self.graph.get_node(_s)
if not source: # pragma: no cover
source = _s
_d = self.normalize_url(con["destination"])
destination = self.graph.get_node(_d)
if not destination: # pragma: no cover
destination = _d
self.graph.add_edge(source, destination)
edge = self.graph.get_edge(source, destination)
edge.attr["label"] = f"[{count}] {con['method']}" # pylint:disable=no-member
count += 1
color = self.get_color(con)
if color:
edge.attr["color"] = color # pylint:disable=no-member
def add_location(self, loc):
"""
Add location information to location data
"""
loc["display"] = True
if self.simplify:
url = urlparse(loc["url"]).netloc
if url:
loc["url"] = url
for a in self.data["locations"]:
d = DictDiffer(a, loc)
if not d.anychange():
return
self.data["locations"].append(loc)
def add_weak_location(self, url):
"""
Generate a weak location for the given url.
"""
for location in self.data["locations"]:
if location["url"] == url:
return
loc = {
"mimetype": "",
"url": url,
"size": 0,
"flags": {},
"sha256": None,
"content-type": None,
"display": True,
"md5": None,
}
self.add_location(loc)
def add_connection(self, con):
"""
Add connection information to connection data
"""
con["display"] = True
if self.simplify:
url = urlparse(con["source"]).netloc
if url:
con["source"] = url
url = urlparse(con["destination"]).netloc
if url:
con["destination"] = url
self.add_weak_location(con["source"])
self.add_weak_location(con["destination"])
for a in self.data["connections"]:
d = DictDiffer(a, con)
if not d.anychange():
return
self.data["connections"].append(con)
def add_data(self, data):
if not PYGRAPHVIZ_MODULE:
return # pragma: no cover
# Add nodes
if "locations" in data:
for loc in data["locations"]:
self.add_location(loc)
if "connections" in data:
for con in data["connections"]:
self.add_connection(con)
def add_file(self, filename):
"""
Add data file
"""
try:
with open(filename, encoding="utf-8", mode="r") as fd:
self.add_data(json.load(fd))
except ValueError:
pass
def write_svg(self):
"""
Create SVG file
"""
if not PYGRAPHVIZ_MODULE:
return # pragma: no cover
self.dot_from_data()
try:
self.graph.layout(prog="dot")
self.graph.draw(self.svgfile, format="svg")
except Exception: # pragma: no cover,pylint:disable=broad-except
pass
def activate(self, conto):
"""
Iterate through data and set display for hot connections
"""
tofix = []
for connection in self.data["connections"]:
if connection["display"] is False and connection["destination"] == conto:
connection["display"] = True
tofix.append(connection["source"])
for location in self.data["locations"]:
if location["url"] == conto or location["url"] in tofix:
location["display"] = True
for elem in tofix:
self.activate(elem)
def follow_track(self, end):
"""
Follow the track between entry point of the analysis and the exploit URL.
Remove all non-relevant stuff
@end: end url to track the connections to
"""
if self.first_track:
for con in self.data["connections"]:
con["display"] = False
for loc in self.data["locations"]:
loc["display"] = False
self.first_track = False
self.activate(end)
def write_text(self):
"""
Return text representation
"""
res = ""
for con in self.data["connections"]:
if con["display"]:
res += f'{str(con["source"])} -- {str(con["method"])} --> {str(con["destination"])} {os.linesep}'
return res
| 10,257
|
Python
|
.py
| 285
| 26.207018
| 113
| 0.56214
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,924
|
JSON.py
|
buffer_thug/thug/Logging/modules/JSON.py
|
#!/usr/bin/env python
#
# JSON.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
# Author: Thorsten Sick <thorsten.sick@avira.com> from Avira
# (developed for the iTES Project http://ites-project.org)
import os
import io
import json
import base64
import logging
import datetime
import thug
from .Mapper import Mapper
log = logging.getLogger("Thug")
class JSON:
def __init__(self, provider=False):
self._tools = (
{
"id": "json-log",
"Name": "Thug",
"Version": thug.__version__,
"Vendor": None,
"Organization": "The Honeynet Project",
},
)
self.associated_code = None
self.object_pool = None
self.signatures = []
self.cached_data = None
self.provider = provider
self.data = {
"url": None,
"timestamp": str(datetime.datetime.now()),
"logtype": "json-log",
"thug": {
"version": thug.__version__,
"jsengine": {
"engine": thug.__jsengine__,
"version": thug.__jsengine_version__,
},
"personality": {"useragent": log.ThugOpts.useragent},
"plugins": {
"acropdf": self.get_vuln_module("acropdf"),
"javaplugin": self.get_vuln_module("_javaplugin"),
"shockwaveflash": self.get_vuln_module("shockwave_flash"),
},
"options": {
"local": log.ThugOpts.local,
"nofetch": log.ThugOpts.no_fetch,
"proxy": log.ThugOpts._proxy,
"events": log.ThugOpts.events,
"delay": log.ThugOpts.delay,
"referer": log.ThugOpts.referer,
"timeout": log.ThugOpts.timeout,
"threshold": log.ThugOpts.threshold,
"extensive": log.ThugOpts.extensive,
},
},
"awis": [],
"behavior": [],
"classifiers": [],
"code": [],
"connections": [],
"cookies": [],
"exploits": [],
"favicons": [],
"files": [],
"images": [],
"locations": [],
"screenshots": [],
}
@property
def json_enabled(self):
return (
log.ThugOpts.json_logging
or "json" in log.ThugLogging.formats
or self.provider
)
@staticmethod
def get_vuln_module(module):
disabled = getattr(log.ThugVulnModules, f"{module}_disabled", True)
if disabled:
return "disabled"
return getattr(log.ThugVulnModules, module)
@staticmethod
def fix(data, drop_spaces=True):
"""
Fix data encoding
@data data to encode properly
"""
if not data:
return str()
try:
if isinstance(data, str):
enc_data = data
else:
enc = log.Encoding.detect(data)
encoding = enc["encoding"] if enc["encoding"] else "utf-8"
enc_data = data.decode(encoding)
return enc_data.replace("\n", "").strip() if drop_spaces else enc_data
except UnicodeDecodeError: # pragma: no cover
return str()
def set_url(self, url):
if not self.json_enabled:
return
self.data["url"] = url
def add_code_snippet(
self, snippet, language, relationship, tag, method="Dynamic Analysis"
):
if not self.json_enabled:
return
self.data["code"].append(
{
"snippet": self.fix(snippet),
"language": self.fix(language),
"relationship": self.fix(relationship),
"tag": self.fix(tag),
"method": self.fix(method),
}
)
def add_shellcode_snippet(
self, snippet, language, relationship, tag, method="Dynamic Analysis"
):
if not self.json_enabled:
return
s = base64.b64encode(snippet.encode())
self.data["code"].append(
{
"snippet": s.decode(),
"language": self.fix(language),
"relationship": self.fix(relationship),
"tag": self.fix(tag),
"method": self.fix(method),
}
)
def log_connection(self, source, destination, method, flags=None):
"""
Log the connection (redirection, link) between two pages
@source The origin page
@destination The page the user is made to load next
@method Link, iframe, .... that moves the user from source to destination
@flags Additional information flags. Existing are: "exploit"
"""
if not self.json_enabled:
return
if flags is None:
flags = {}
if "exploit" in flags and flags["exploit"]:
self.add_behavior_warn(f"[Exploit] {source} -- {method} --> {destination}")
else:
self.add_behavior_warn(f"{source} -- {method} --> {destination}")
self.data["connections"].append(
{
"source": self.fix(source),
"destination": self.fix(destination),
"method": method,
"flags": flags,
}
)
def get_content(self, data):
content = "NOT AVAILABLE"
if not log.ThugOpts.code_logging:
return content
try:
content = self.fix(data.get("content", "NOT AVAILABLE"))
except Exception as e: # pragma: no cover,pylint:disable=broad-except
log.info("[ERROR][get_content] %s", str(e))
return content
def log_location(self, url, data, flags=None):
"""
Log file information for a given url
@url URL we fetched data from
@data File dictionary data
Keys:
- content Content
- md5 MD5 checksum
- sha256 SHA-256 checksum
- ssdeep Ssdeep hash
- fsize Content size
- ctype Content type (whatever the server says it is)
- mtype Calculated MIME type
@flags Additional information flags (known flags: "error")
"""
if not self.json_enabled:
return
if flags is None:
flags = {}
self.data["locations"].append(
{
"url": self.fix(url),
"content": self.get_content(data),
"status": data.get("status", None),
"content-type": data.get("ctype", None),
"md5": data.get("md5", None),
"sha256": data.get("sha256", None),
"ssdeep": data.get("ssdeep", None),
"flags": flags,
"size": data.get("fsize", None),
"mimetype": data.get("mtype", None),
}
)
def log_exploit_event(self, url, module, description, cve=None, data=None):
"""
Log file information for a given url
@url URL where this exploit occurred
@module Module/ActiveX Control, ... that gets exploited
@description Description of the exploit
@cve CVE number (if available)
"""
if not self.json_enabled:
return
self.data["exploits"].append(
{
"url": self.fix(url),
"module": module,
"description": description,
"cve": cve,
"data": data,
}
)
def log_image_ocr(self, url, result):
"""
Log the results of images OCR-based analysis
@url Image URL
@result OCR analysis result
"""
if not self.json_enabled:
return
self.data["images"].append(
{"url": self.fix(url), "classifier": "OCR", "result": result}
)
def log_classifier(self, classifier, url, rule, tags="", meta=None):
"""
Log classifiers matching for a given url
@classifier Classifier name
@url URL where the rule match occurred
@rule Rule name
@meta Rule meta
@tags Rule tags
"""
if not self.json_enabled:
return
item = {
"classifier": classifier,
"url": self.fix(url),
"rule": rule,
"meta": meta if meta else {},
"tags": tags,
}
if item not in self.data["classifiers"]:
self.data["classifiers"].append(item)
def log_screenshot(self, url, screenshot):
"""
Log the base64-encoded screenshot of the analyzed page
@url URL
@screenshot URL screenshot
"""
if not self.json_enabled:
return
content = base64.b64encode(screenshot)
self.data["screenshots"].append(
{"url": self.fix(url), "screenshot": content.decode()}
)
def log_favicon(self, url, dhash):
"""
Log the favicon dhash
@url URL
@dhash dhash
"""
if not self.json_enabled:
return
self.data["favicons"].append({"url": self.fix(url), "dhash": dhash})
def log_awis(self, report):
self.data["awis"].append(report) # pragma: no cover
def log_cookies(self):
attrs = (
"comment",
"comment_url",
"discard",
"domain",
"domain_initial_dot",
"domain_specified",
"expires",
"name",
"path",
"path_specified",
"port",
"port_specified",
"rfc2109",
"secure",
"value",
"version",
)
for cookie in log.HTTPSession.cookies:
item = {}
for attr in attrs:
value = getattr(cookie, attr, None)
if value is None:
continue
item[attr] = value
if item not in self.data["cookies"]:
self.data["cookies"].append(item)
def add_behavior(
self, description=None, cve=None, snippet=None, method="Dynamic Analysis"
):
if not cve and not description:
return
self.data["behavior"].append(
{
"description": self.fix(description),
"cve": self.fix(cve),
"snippet": self.fix(snippet, drop_spaces=False),
"method": self.fix(method),
"timestamp": str(datetime.datetime.now()),
}
)
def add_behavior_warn(
self, description=None, cve=None, snippet=None, method="Dynamic Analysis"
):
if not self.json_enabled:
return
self.add_behavior(description, cve, snippet, method)
def log_file(self, data, url=None, params=None): # pylint:disable=unused-argument
if not self.json_enabled:
return
if data not in self.data["files"]:
self.data["files"].append(data)
def export(self, basedir): # pylint:disable=unused-argument
if not self.json_enabled:
return
output = io.StringIO()
if log.ThugOpts.features_logging and (
log.ThugOpts.verbose or log.ThugOpts.debug
):
log.warning(log.ThugLogging.Features.features)
self.data["features"] = log.ThugLogging.Features.features
json.dump(self.data, output, sort_keys=False, indent=4)
if log.ThugOpts.json_logging and log.ThugOpts.file_logging:
logdir = os.path.join(basedir, "analysis", "json")
log.ThugLogging.store_content(
logdir, "analysis.json", output.getvalue().encode()
)
m = Mapper(logdir)
m.add_data(self.data)
m.write_svg()
self.cached_data = output
def get_json_data(self, basedir): # pylint:disable=unused-argument
if self.cached_data:
return self.cached_data.getvalue()
return None
| 13,218
|
Python
|
.py
| 365
| 24.852055
| 88
| 0.52015
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,925
|
ActiveX.py
|
buffer_thug/thug/ActiveX/ActiveX.py
|
#!/usr/bin/env python
#
# ActiveX.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
# import new
import logging
from .CLSID import CLSID
log = logging.getLogger("Thug")
acropdf = (
"acropdf.pdf",
"pdf.pdfctrl",
"CA8A9780-280D-11CF-A24D-444553540000",
)
shockwave = (
"shockwaveflash.shockwaveflash",
"shockwaveflash.shockwaveflash.1",
"shockwaveflash.shockwaveflash.9",
"shockwaveflash.shockwaveflash.10",
"shockwaveflash.shockwaveflash.11",
"shockwaveflash.shockwaveflash.12",
"swctl.swctl",
"swctl.swctl.8",
"233C1507-6A77-46A4-9443-F871F945D258",
)
silverlight = ("agcontrol.agcontrol",)
java_deployment_toolkit = (
"CAFEEFAC-DEC7-0000-0000-ABCDEFFEDCBA",
"8AD9C840-044E-11D1-B3E9-00805F499D93",
)
class _ActiveXObject:
def __init__(self, window, cls, typename="name"):
self.funcattrs = {}
self._window = window
obj = None
methods = {}
self.cls = cls
self.shockwave = log.ThugVulnModules.shockwave_flash.split(".")[0]
self.shockwave_flash = {
"shockwaveflash.shockwaveflash": self.shockwave,
"shockwaveflash.shockwaveflash.1": self.shockwave,
"shockwaveflash.shockwaveflash.9": "9",
"shockwaveflash.shockwaveflash.10": "10",
"shockwaveflash.shockwaveflash.11": "11",
"shockwaveflash.shockwaveflash.12": "12",
}
if typename == "id":
if len(cls) > 5 and cls[:6].lower() == "clsid:":
cls = cls[6:].upper()
if cls.startswith("{") and cls.endswith("}"):
cls = cls[1:-1]
if typename == "name":
cls = cls.lower()
# Adobe Acrobat Reader
if cls in acropdf and log.ThugVulnModules.acropdf_disabled:
log.warning("Unknown ActiveX Object: %s", cls)
raise TypeError()
# Shockwave Flash
if cls in shockwave and log.ThugVulnModules.shockwave_flash_disabled:
log.warning("Unknown ActiveX Object: %s", cls)
raise TypeError()
if cls in self.shockwave_flash:
if cls in (
"shockwaveflash.shockwaveflash",
"shockwaveflash.shockwaveflash.1",
):
version = self.shockwave_flash[cls]
cls = f"shockwaveflash.shockwaveflash.{version}"
if self.shockwave not in (self.shockwave_flash[cls],):
log.warning("Unknown ActiveX Object: %s", cls)
raise TypeError()
_cls = cls
# Java Deployment Toolkit
if cls in java_deployment_toolkit and log.ThugVulnModules.javaplugin_disabled:
log.warning("Unknown ActiveX Object: %s", cls)
raise TypeError()
# JavaPlugin
if cls.lower().startswith("javaplugin"):
if log.ThugVulnModules.javaplugin_disabled or not cls.endswith(
log.ThugVulnModules.javaplugin
):
log.warning("Unknown ActiveX Object: %s", cls)
raise TypeError()
_cls = "javaplugin"
# JavaWebStart
if cls.lower().startswith("javawebstart.isinstalled"):
if log.ThugVulnModules.javaplugin_disabled or not cls.endswith(
log.ThugVulnModules.javawebstart_isinstalled
):
log.warning("Unknown ActiveX Object: %s", cls)
raise TypeError()
_cls = "javawebstart.isinstalled"
if cls in silverlight and log.ThugVulnModules.silverlight_disabled:
log.warning("Unknown ActiveX Object: %s", cls)
raise TypeError()
for c in CLSID:
if _cls in c[typename]:
obj = c
break
if not obj:
log.warning("Unknown ActiveX Object: %s", cls)
raise TypeError()
if log.ThugOpts.activex_ready:
log.warning("ActiveXObject: %s", cls)
if log.ThugOpts.features_logging and log.ThugOpts.activex_ready:
log.ThugLogging.Features.increase_activex_count()
for method_name, method in obj["methods"].items():
_method = method.__get__(self, _ActiveXObject)
setattr(self, method_name, _method)
methods[method] = _method
for attr_name, attr_value in obj["attrs"].items():
setattr(self, attr_name, attr_value)
for attr_name, attr_value in obj["funcattrs"].items():
self.funcattrs[attr_name] = methods[attr_value]
if cls.lower() in ("wscript.shell",):
self.scriptFullName = log.ThugLogging.url if log.ThugOpts.local else ""
def __setattr__(self, name, value):
self.__dict__[name] = value
if name in self.funcattrs:
self.funcattrs[name](value)
def __getattr__(self, name):
for key, value in self.__dict__.items():
if key.lower() == name.lower():
return value
if name in self.funcattrs:
value = self.funcattrs[name]()
self.__dict__[name] = value
return value
if name not in ("__watchpoints__",):
log.warning("Unknown ActiveX Object (%s) attribute: %s", self.cls, name)
raise AttributeError
def register_object(s, clsid):
methods = {}
obj = None
if not clsid.startswith("clsid:"):
log.warning("Unknown ActiveX object: %s", clsid)
return
clsid = clsid[6:].upper()
if clsid.startswith("{") and clsid.endswith("}"):
clsid = clsid[1:-1]
# Adobe Acrobat Reader
if clsid in acropdf and log.ThugVulnModules.acropdf_disabled:
log.warning("Unknown ActiveX Object: %s", clsid)
raise TypeError()
# Shockwave Flash
if clsid in shockwave and log.ThugVulnModules.shockwave_flash_disabled:
log.warning("Unknown ActiveX Object: %s", clsid)
raise TypeError()
# Java Deployment Toolkit
if clsid in java_deployment_toolkit and log.ThugVulnModules.javaplugin_disabled:
log.warning("Unknown ActiveX Object: %s", clsid)
raise TypeError()
for c in CLSID:
if clsid in c["id"]:
obj = c
break
if obj is None:
log.warning("Unknown ActiveX object: %s", clsid)
raise TypeError()
log.warning("ActiveXObject: %s", clsid)
for method_name, method in obj["methods"].items():
_method = method.__get__(s, s.__class__)
setattr(s, method_name, _method)
methods[method] = _method
for attr_name, attr_value in obj["attrs"].items():
setattr(s, attr_name, attr_value)
for attr_name, attr_value in obj["funcattrs"].items():
if "funcattrs" not in s.__dict__:
s.__dict__["funcattrs"] = {}
s.__dict__["funcattrs"][attr_name] = methods[attr_value]
| 7,458
|
Python
|
.py
| 182
| 31.994505
| 86
| 0.61761
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,926
|
CLSID.py
|
buffer_thug/thug/ActiveX/CLSID.py
|
#!/usr/bin/env python
#
# CLSID.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
import io
from .modules import AcroPDF
from .modules import AdodbRecordset
from .modules import AdodbStream
from .modules import AnswerWorks
from .modules import AolAmpX
from .modules import AolICQ
from .modules import AOLAttack
from .modules import BaiduBar
from .modules import BitDefender
from .modules import CABrightStor
from .modules import CGAgent
from .modules import Comodo
from .modules import ConnectAndEnterRoom
from .modules import CreativeSoftAttack
from .modules import DirectShow
from .modules import DivX
from .modules import DLinkMPEG
from .modules import Domino
from .modules import DPClient
from .modules import DVRHOSTWeb
from .modules import EnjoySAP
from .modules import FacebookPhotoUploader
from .modules import FileUploader
from .modules import GatewayWeblaunch
from .modules import GLIEDown2
from .modules import Gogago
from .modules import GomWeb
from .modules import HPInfo
from .modules import ICQToolbar
from .modules import IMWebControl
from .modules import InternetCleverSuite
from .modules import JavaDeploymentToolkit
from .modules import JetAudioDownloadFromMusicStore
from .modules import Kingsoft
from .modules import MacrovisionFlexNet
from .modules import MicrosoftWorks7Attack
from .modules import MicrosoftXMLDOM
from .modules import MicrosoftXMLHTTP
from .modules import Move
from .modules import MSRICHTXT
from .modules import MSVFP
from .modules import MSXML2DOMDocument
from .modules import MyspaceUploader
from .modules import NamoInstaller
from .modules import NCTAudioFile2
from .modules import NeoTracePro
from .modules import NessusScanCtrl
from .modules import OfficeOCX
from .modules import OurgameGLWorld
from .modules import PPlayer
from .modules import PTZCamPanel
from .modules import QuantumStreaming
from .modules import QvodCtrl
from .modules import RDSDataSpace
from .modules import RealPlayer
from .modules import RediffBolDownloaderAttack
from .modules import RegistryPro
from .modules import RisingScanner
from .modules import RtspVaPgCtrl
from .modules import ScriptingDictionary
from .modules import ScriptingEncoder
from .modules import ScriptingFileSystemObject
from .modules import ShellApplication
from .modules import Shockwave
from .modules import ShockwaveFlash9
from .modules import ShockwaveFlash10
from .modules import ShockwaveFlash11
from .modules import ShockwaveFlash12
from .modules import SilverLight
from .modules import SinaDLoader
from .modules import SnapshotViewer
from .modules import SonicWallNetExtenderAddRouteEntry
from .modules import Spreadsheet
from .modules import SSReaderPdg2
from .modules import StormConfig
from .modules import StormMps
from .modules import SymantecAppStream
from .modules import SymantecBackupExec
from .modules import System
from .modules import StreamAudioChainCast
from .modules import Toshiba
from .modules import UniversalUpload
from .modules import UUSeeUpdate
from .modules import VisualStudioDTE80
from .modules import VLC
from .modules import VsaIDEDTE
from .modules import VsmIDEDTE
from .modules import WebViewFolderIcon
from .modules import WindowsMediaPlayer
from .modules import WinNTSystemInfo
from .modules import WinZip
from .modules import WMEncProfileManager
from .modules import WMP
from .modules import WScriptShell
from .modules import WScriptShortcut
from .modules import WScriptNetwork
from .modules import XMLDOMParseError
from .modules import XUpload
from .modules import YahooJukebox
from .modules import YahooMessengerCyft
from .modules import YahooMessengerYVerInfo
from .modules import YahooMessengerYwcvwr
from .modules import ZenturiProgramCheckerAttack
CLSID = [
# AcroPDF.PDF
{
"id": ("CA8A9780-280D-11CF-A24D-444553540000",),
"name": (
"acropdf.pdf",
"pdf.pdfctrl",
),
"attrs": {},
"funcattrs": {},
"methods": {
"GetVersions": AcroPDF.GetVersions,
"GetVariable": AcroPDF.GetVariable,
},
},
# AcubeFileCtrl
{
"id": (),
"name": ("acubefilectrl.acubefilectrlctrl.1",),
"attrs": {},
"funcattrs": {},
"methods": {},
},
# Adodb.Recordset
{
"id": (),
"name": ("adodb.recordset",),
"attrs": {
"Fields": AdodbRecordset.Fields(),
},
"funcattrs": {},
"methods": {},
},
# Adodb.Stream
{
"id": (),
"name": ("adodb.stream",),
"attrs": {
"Charset": "Unicode",
"type": 1,
"Type": 1,
"Mode": 3,
"Position": 0,
"position": 0,
"_files": {},
"_current": None,
},
"funcattrs": {"position": AdodbStream.setPosition, "Size": AdodbStream.getSize},
"methods": {
"Open": AdodbStream.open,
"Read": AdodbStream.Read,
"Write": AdodbStream.Write,
"SaveToFile": AdodbStream.SaveToFile,
"SaveTofile": AdodbStream.SaveToFile,
"LoadFromFile": AdodbStream.LoadFromFile,
"ReadText": AdodbStream.ReadText,
"WriteText": AdodbStream.WriteText,
"Close": AdodbStream.Close,
"setPosition": AdodbStream.setPosition,
"getSize": AdodbStream.getSize,
},
},
# AnswerWorks
{
"id": ("C1908682-7B2C-4AB0-B98E-183649A0BF84",),
"name": ("awapi4.answerworks.1"),
"attrs": {},
"funcattrs": {},
"methods": {
"GetHistory": AnswerWorks.GetHistory,
"GetSeedQuery": AnswerWorks.GetSeedQuery,
"SetSeedQuery": AnswerWorks.SetSeedQuery,
},
},
# AolAmpX
{
"id": (
"B49C4597-8721-4789-9250-315DFBD9F525",
"FA3662C3-B8E8-11D6-A667-0010B556D978",
"FE0BD779-44EE-4A4B-AA2E-743C63F2E5E6",
),
"name": (),
"attrs": {},
"funcattrs": {},
"methods": {
"AppendFileToPlayList": AolAmpX.AppendFileToPlayList,
"ConvertFile": AolAmpX.ConvertFile,
},
},
# AolICQ
{
"id": (),
"name": ("icqphone.sipxphonemanager.1",),
"attrs": {},
"funcattrs": {},
"methods": {
"DownloadAgent": AolICQ.DownloadAgent,
},
},
# AOLAttack
{
"id": ("189504B8-50D1-4AA8-B4D6-95C8F58A6414",),
"name": (
"sb.superbuddy",
"sb.superbuddy.1",
),
"attrs": {},
"funcattrs": {},
"methods": {
"LinkSBIcons": AOLAttack.LinkSBIcons,
},
},
# BaiduBar
{
"id": ("A7F05EE4-0426-454F-8013-C41E3596E9E9",),
"name": ("baidubar.tool",),
"attrs": {},
"funcattrs": {},
"methods": {
"DloadDS": BaiduBar.DloadDS,
},
},
# BitDefender
{
"id": ("5D86DDB5-BDF9-441B-9E9E-D4730F4EE499",),
"name": (),
"attrs": {},
"funcattrs": {},
"methods": {
"initx": BitDefender.initx,
},
},
# CABrightStor
{
"id": ("BF6EFFF3-4558-4C4C-ADAF-A87891C5F3A3",),
"name": ("listctrl.listctrlctrl.1",),
"attrs": {},
"funcattrs": {},
"methods": {
"AddColumn": CABrightStor.AddColumn,
},
},
# CGAgent
{
"id": ("75108B29-202F-493C-86C5-1C182A485C4C",),
"name": ("cgagent.agent.1",),
"attrs": {},
"funcattrs": {},
"methods": {
"CreateChinagames": CGAgent.CreateChinagames,
},
},
# Comodo
{
"id": ("309F674D-E4D3-46BD-B9E2-ED7DFD7FD176",),
"name": (),
"attrs": {},
"funcattrs": {},
"methods": {
"ExecuteStr": Comodo.ExecuteStr,
},
},
# ConnectAndEnterRoom
{
"id": ("AE93C5DF-A990-11D1-AEBD-5254ABDD2B69",),
"name": ("glchat.glchatctrl.1",),
"attrs": {},
"funcattrs": {},
"methods": {
"ConnectAndEnterRoom": ConnectAndEnterRoom.ConnectAndEnterRoom,
},
},
# CreativeSoftAttack
{
"id": ("0A5FD7C5-A45C-49FC-ADB5-9952547D5715",),
"name": (),
"attrs": {
"cachefolder": "",
},
"funcattrs": {
"cachefolder": CreativeSoftAttack.Setcachefolder,
},
"methods": {
"Setcachefolder": CreativeSoftAttack.Setcachefolder,
},
},
# DirectShow
{
"id": ("0955AC62-BF2E-4CBA-A2B9-A63F772D46CF",),
"name": (),
"attrs": {
"data": "",
"width": "1",
"height": "1",
},
"funcattrs": {
"data": DirectShow.Setdata,
},
"methods": {
"Setdata": DirectShow.Setdata,
},
},
# DivX
{
"id": ("D050D736-2D21-4723-AD58-5B541FFB6C11",),
"name": (),
"attrs": {"onload": None, "onmousemove": None, "onclick": None},
"funcattrs": {},
"methods": {
"SetPassword": DivX.SetPassword,
},
},
# DLinkMPEG
{
"id": ("A93B47FD-9BF6-4DA8-97FC-9270B9D64A6C",),
"name": (),
"attrs": {"Url": ""},
"funcattrs": {
"Url": DLinkMPEG.SetUrl,
},
"methods": {
"SetUrl": DLinkMPEG.SetUrl,
},
},
# Domino
{
"id": (
"E008A543-CEFB-4559-912F-C27C2B89F13B",
"3BFFE033-BF43-11D5-A271-00A024A51325",
"983A9C21-8207-4B58-BBB8-0EBC3D7C5505",
),
"name": (),
"attrs": {
"General_ServerName": "",
"General_JunctionName": "",
"Mail_MailDbPath": "",
},
"funcattrs": {
"General_ServerName": Domino.SetGeneral_ServerName,
"General_JunctionName": Domino.SetGeneral_JunctionName,
"Mail_MailDbPath": Domino.SetMail_MailDbPath,
},
"methods": {
"SetGeneral_ServerName": Domino.SetGeneral_ServerName,
"SetGeneral_JunctionName": Domino.SetGeneral_JunctionName,
"SetMail_MailDbPath": Domino.SetMail_MailDbPath,
"InstallBrowserHelperDll": Domino.InstallBrowserHelperDll,
},
},
# DPClient
{
"id": ("EEDD6FF9-13DE-496B-9A1C-D78B3215E266",),
"name": ("dpclient.vod.1",),
"attrs": {},
"funcattrs": {},
"methods": {
"DownURL2": DPClient.DownURL2,
},
},
# DuZoneRPSSO
{
"id": (),
"name": ("duzonerpsso.duzonerpssoctrl.1",),
"attrs": {},
"funcattrs": {},
"methods": {},
},
# DVRHOSTWeb
{
"id": ("D64CF6D4-45DF-4D8F-9F14-E65FADF2777C",),
"name": ("pdvratl.pdvrocx.1",),
"attrs": {},
"funcattrs": {},
"methods": {
"TimeSpanFormat": DVRHOSTWeb.TimeSpanFormat,
},
},
# EasyPayPlugin
{
"id": (),
"name": ("easypayplugin.epplugin.1",),
"attrs": {},
"funcattrs": {},
"methods": {},
},
# EnjoySAP
{
"id": ("2137278D-EF5C-11D3-96CE-0004AC965257",),
"name": (
"rfcguisink.rfcguisink.1",
"kweditcontrol.kwedit.1",
),
"attrs": {},
"funcattrs": {},
"methods": {
"LaunchGui": EnjoySAP.LaunchGui,
"PrepareToPostHTML": EnjoySAP.PrepareToPostHTML,
"Comp_Download": EnjoySAP.Comp_Download,
},
},
# FacebookPhotoUploader
{
"id": (
"6E5E167B-1566-4316-B27F-0DDAB3484CF7",
"5C6698D9-7BE4-4122-8EC5-291D84DBD4A0",
"BA162249-F2C5-4851-8ADC-FC58CB424243",
),
"name": ("thefacebook.facebookphotouploader4.4.1",),
"attrs": {
"ExtractIptc": "",
"ExtractExif": "",
},
"funcattrs": {
"ExtractIptc": FacebookPhotoUploader.SetExtractIptc,
"ExtractExif": FacebookPhotoUploader.SetExtractExif,
},
"methods": {
"SetExtractIptc": FacebookPhotoUploader.SetExtractIptc,
"SetExtractExif": FacebookPhotoUploader.SetExtractExif,
},
},
# FileUploader
{
"id": ("C36112BF-2FA3-4694-8603-3B510EA3B465",),
"name": ("fileuploader.fuploadctl.1",),
"attrs": {"HandwriterFilename": ""},
"funcattrs": {
"HandwriterFilename": FileUploader.SetHandwriterFilename,
},
"methods": {
"SetHandwriterFilename": FileUploader.SetHandwriterFilename,
},
},
# Flash
{
"id": ("D27CDB6E-AE6D-11CF-96B8-444553540000",),
"name": (),
"attrs": {},
"funcattrs": {},
"methods": {},
},
# GatewayWeblaunch
{
"id": (
"93CEA8A4-6059-4E0B-ADDD-73848153DD5E",
"97BB6657-DC7F-4489-9067-51FAB9D8857E",
),
"name": (),
"attrs": {},
"funcattrs": {},
"methods": {
"DoWebLaunch": GatewayWeblaunch.DoWebLaunch,
},
},
# GLIEDown2
{
"id": ("F917534D-535B-416B-8E8F-0C04756C31A8",),
"name": ("gliedown.iedown.1",),
"attrs": {},
"funcattrs": {},
"methods": {
"IEStartNative": GLIEDown2.IEStartNative,
},
},
# Gogago
{
"id": ("7966A32A-5783-4F0B-824C-09077C023080",),
"name": (),
"attrs": {},
"funcattrs": {},
"methods": {
"Download": Gogago.Download,
},
},
# GomWeb
{
"id": ("DC07C721-79E0-4BD4-A89F-C90871946A31",),
"name": ("gomwebctrl.gommanager.1",),
"attrs": {},
"funcattrs": {},
"methods": {
"OpenURL": GomWeb.OpenURL,
},
},
# HPInfo
{
"id": (
"62DDEB79-15B2-41E3-8834-D3B80493887A",
"7CB9D4F5-C492-42A4-93B1-3F7D6946470D",
),
"name": (
"hpinfodll.hpinfo.1",
"hprulesengine.contentcollection.1",
),
"attrs": {},
"funcattrs": {},
"methods": {
"LaunchApp": HPInfo.LaunchApp,
"SetRegValue": HPInfo.SetRegValue,
"GetRegValue": HPInfo.GetRegValue,
"EvaluateRules": HPInfo.EvaluateRules,
"SaveToFile": HPInfo.SaveToFile,
"ProcessRegistryData": HPInfo.ProcessRegistryData,
},
},
# Icona SpA C6 Messenger
{
"id": ("C1B7E532-3ECB-4E9E-BB3A-2951FFE67C61",),
"name": (),
"attrs": {},
"funcattrs": {},
"methods": {},
},
# ICQToolbar
{
"id": ("855F3B16-6D32-4FE6-8A56-BBB695989046",),
"name": (),
"attrs": {},
"funcattrs": {},
"methods": {
"GetPropertyById": ICQToolbar.GetPropertyById,
},
},
# IMWebControl
{
"id": ("7C3B01BC-53A5-48A0-A43B-0C67731134B9",),
"name": ("imweb.imwebcontrol.1",),
"attrs": {},
"funcattrs": {},
"methods": {
"ProcessRequestEx": IMWebControl.ProcessRequestEx,
"SetHandler": IMWebControl.SetHandler,
},
},
# IniWallet
{
"id": (),
"name": ("iniwallet61.iniwallet61ctrl.1",),
"attrs": {},
"funcattrs": {},
"methods": {},
},
# InternetCleverSuite
{
"id": ("E8F92847-7C21-452B-91A5-49D93AA18F30",),
"name": (),
"attrs": {},
"funcattrs": {},
"methods": {
"GetToFile": InternetCleverSuite.GetToFile,
},
},
# JavaDeploymentToolkit
{
"id": (
"CAFEEFAC-DEC7-0000-0000-ABCDEFFEDCBA",
"CAFEEFAC-DEC7-0000-0001-ABCDEFFEDCBA",
"8AD9C840-044E-11D1-B3E9-00805F499D93",
),
"name": (),
"attrs": {},
"funcattrs": {},
"methods": {
"launch": JavaDeploymentToolkit.launch,
"launchApp": JavaDeploymentToolkit.launchApp,
},
},
# JavaPlugin
{"id": (), "name": ("javaplugin",), "attrs": {}, "funcattrs": {}, "methods": {}},
# JavaWebStart.isInstalled
{
"id": (),
"name": ("javawebstart.isinstalled",),
"attrs": {},
"funcattrs": {},
"methods": {},
},
# JetAudioDownloadFromMusicStore
{
"id": ("8D1636FD-CA49-4B4E-90E4-0A20E03A15E8",),
"name": (),
"attrs": {},
"funcattrs": {},
"methods": {
"DownloadFromMusicStore": JetAudioDownloadFromMusicStore.DownloadFromMusicStore,
},
},
# Kingsoft
{
"id": ("D82303B7-A754-4DCB-8AFC-8CF99435AACE",),
"name": (),
"attrs": {},
"funcattrs": {},
"methods": {
"SetUninstallName": Kingsoft.SetUninstallName,
},
},
# MacrovisionFlexNet
{
"id": (
"FCED4482-7CCB-4E6F-86C9-DCB22B52843C",
"85A4A99C-8C3D-499E-A386-E0743DFF8FB7",
"E9880553-B8A7-4960-A668-95C68BED571E",
),
"name": (),
"attrs": {"ScheduleInterval": 0},
"funcattrs": {},
"methods": {
"Initialize": MacrovisionFlexNet.Initialize,
"CreateJob": MacrovisionFlexNet.CreateJob,
"DownloadAndExecute": MacrovisionFlexNet.DownloadAndExecute,
"DownloadAndInstall": MacrovisionFlexNet.DownloadAndInstall,
"AddFileEx": MacrovisionFlexNet.AddFileEx,
"AddFile": MacrovisionFlexNet.AddFile,
"SetPriority": MacrovisionFlexNet.SetPriority,
"SetNotifyFlags": MacrovisionFlexNet.SetNotifyFlags,
"RunScheduledJobs": MacrovisionFlexNet.RunScheduledJobs,
},
},
# MicrosoftWorks7Attack
{
"id": ("00E1DB59-6EFD-4CE7-8C0A-2DA3BCAAD9C6",),
"name": (),
"attrs": {
"WksPictureInterface": 0,
},
"funcattrs": {
"WksPictureInterface": MicrosoftWorks7Attack.SetWksPictureInterface,
},
"methods": {
"SetWksPictureInterface": MicrosoftWorks7Attack.SetWksPictureInterface,
},
},
# MicrosoftXMLDOM
{
"id": (),
"name": (
"microsoft.xmldom",
"msxml2.domdocument.3.0",
),
"attrs": {
"async": False,
"parseError": XMLDOMParseError.XMLDOMParseError(),
},
"funcattrs": {},
"methods": {
"loadXML": MicrosoftXMLDOM.loadXML,
"createElement": MicrosoftXMLDOM.createElement,
},
},
# MicrosoftXMLHTTP
{
"id": (),
"name": (
"msxml2.xmlhttp",
"microsoft.xmlhttp",
"msxml2.xmlhttp.6.0",
"winhttp.winhttprequest.5.1",
),
"attrs": {
"bstrMethod": "",
"bstrUrl": "",
"varAsync": True,
"varUser": None,
"varPassword": None,
"status": 200,
"statusText": "200",
"requestHeaders": {},
"responseHeaders": {},
"responseBody": "",
"responseText": "",
"responseType": "",
"responseURL": "",
"responseXML": "",
"response": "",
"readyState": 0,
"timeout": 0,
"mimeType": "",
"onerror": None,
"onload": None,
"onloadstart": None,
"onprogress": None,
"onreadystatechange": None,
"onabort": None,
"ontimeout": None,
"withCredentials": False,
},
"funcattrs": {
"onreadystatechange": MicrosoftXMLHTTP.setOnReadyStateChange,
},
"methods": {
"abort": MicrosoftXMLHTTP.abort,
"open": MicrosoftXMLHTTP.open,
"send": MicrosoftXMLHTTP.send,
"setRequestHeader": MicrosoftXMLHTTP.setRequestHeader,
"getResponseHeader": MicrosoftXMLHTTP.getResponseHeader,
"getAllResponseHeaders": MicrosoftXMLHTTP.getAllResponseHeaders,
"overrideMimeType": MicrosoftXMLHTTP.overrideMimeType,
"addEventListener": MicrosoftXMLHTTP.addEventListener,
"removeEventListener": MicrosoftXMLHTTP.removeEventListener,
"dispatchEvent": MicrosoftXMLHTTP.dispatchEvent,
"waitForResponse": MicrosoftXMLHTTP.waitForResponse,
"setOnReadyStateChange": MicrosoftXMLHTTP.setOnReadyStateChange,
"setTimeouts": MicrosoftXMLHTTP.setTimeouts,
},
},
# Move
{
"id": ("6054D082-355D-4B47-B77C-36A778899F48",),
"name": ("qmpupgrade.upgrade.1",),
"attrs": {},
"funcattrs": {},
"methods": {
"Upgrade": Move.Upgrade,
},
},
# MSRICHTXT
{
"id": (
"3B7C8860-D78F-101B-B9B5-04021C009402",
"B617B991-A767-4F05-99BA-AC6FCABB102E",
),
"name": (),
"attrs": {"Text": ""},
"funcattrs": {},
"methods": {
"SaveFile": MSRICHTXT.SaveFile,
},
},
# MSVFP
{
"id": (
"A7CD2320-6117-11D7-8096-0050042A4CD2",
"008B6010-1F3D-11D1-B0C8-00A0C9055D74",
),
"name": (),
"attrs": {},
"funcattrs": {},
"methods": {
"foxcommand": MSVFP.foxcommand,
"FoxCommand": MSVFP.foxcommand,
"DoCmd": MSVFP.foxcommand,
"docmd": MSVFP.foxcommand,
},
},
# MSXML2.DOMDocument
{
"id": ("F6D90F11-9C73-11D3-B32E-00C04F990BB4",),
"name": ("msxml2.domdocument", "msxml2.domdocument.6.0"),
"attrs": {
"object": MSXML2DOMDocument,
},
"funcattrs": {},
"methods": {
"definition": MSXML2DOMDocument.definition,
},
},
# MyspaceUploader
{
"id": ("48DD0448-9209-4F81-9F6D-D83562940134",),
"name": ("aurigma.imageuploader.4.1",),
"attrs": {"Action": ""},
"funcattrs": {
"Action": MyspaceUploader.SetAction,
},
"methods": {
"SetAction": MyspaceUploader.SetAction,
},
},
# NamoInstaller
{
"id": ("AF465549-1D22-4140-A273-386FA8877E0A",),
"name": (),
"attrs": {},
"funcattrs": {},
"methods": {
"Install": NamoInstaller.Install,
},
},
# NCTAudioFile2
{
"id": ("77829F14-D911-40FF-A2F0-D11DB8D6D0BC",),
"name": ("nctaudiofile2.audiofile.1",),
"attrs": {},
"funcattrs": {},
"methods": {
"SetFormatLikeSample": NCTAudioFile2.SetFormatLikeSample,
},
},
# NeoTracePro
{
"id": ("3E1DD897-F300-486C-BEAF-711183773554",),
"name": (),
"attrs": {},
"funcattrs": {},
"methods": {
"TraceTarget": NeoTracePro.TraceTarget,
},
},
# NessusScanCtrl
{
"id": ("A47D5315-321D-4DEE-9DB3-18438023193B",),
"name": (),
"attrs": {},
"funcattrs": {},
"methods": {
"deleteReport": NessusScanCtrl.deleteReport,
"deleteNessusRC": NessusScanCtrl.deleteNessusRC,
"saveNessusRC": NessusScanCtrl.saveNessusRC,
"addsetConfig": NessusScanCtrl.addsetConfig,
},
},
# OfficeOCX
{
"id": (
"97AF4A45-49BE-4485-9F55-91AB40F288F2", # Office
"97AF4A45-49BE-4485-9F55-91AB40F22B92", # PowerPoint
"97AF4A45-49BE-4485-9F55-91AB40F22BF2", # Word
"18A295DA-088E-42D1-BE31-5028D7F9B965", # Excel
),
"name": (),
"attrs": {},
"funcattrs": {},
"methods": {
"OpenWebFile": OfficeOCX.OpenWebFile,
},
},
# OurgameGLWorld
{
"id": ("61F5C358-60FB-4A23-A312-D2B556620F20",),
"name": ("hangameplugincn18.hangameplugincn18.1"),
"attrs": {},
"funcattrs": {},
"methods": {
"hgs_startGame": OurgameGLWorld.hgs_startGame,
"hgs_startNotify": OurgameGLWorld.hgs_startNotify,
},
},
# PPlayer
{
"id": (
"F3E70CEA-956E-49CC-B444-73AFE593AD7F",
"5EC7C511-CD0F-42E6-830C-1BD9882F3458",
),
"name": ("pplayer.xpplayer.1",),
"attrs": {
"FlvPlayerUrl": "",
"Logo": "",
},
"funcattrs": {
"FlvPlayerUrl": PPlayer.SetFlvPlayerUrl,
"Logo": PPlayer.SetLogo,
},
"methods": {
"DownURL2": PPlayer.DownURL2,
"SetFlvPlayerUrl": PPlayer.SetFlvPlayerUrl,
"SetLogo": PPlayer.SetLogo,
},
},
# PTZCamPanel
{
"id": ("A86934DA-C3D6-4C1C-BD83-CA4F14B362DE",),
"name": (),
"attrs": {},
"funcattrs": {},
"methods": {
"ConnectServer": PTZCamPanel.ConnectServer,
},
},
# QuantumStreaming
{
"id": ("E473A65C-8087-49A3-AFFD-C5BC4A10669B",),
"name": ("qsp2ie.qsp2ie",),
"attrs": {},
"funcattrs": {},
"methods": {
"UploadLogs": QuantumStreaming.UploadLogs,
},
},
# QvodCtrl
{
"id": ("F3D0D36F-23F8-4682-A195-74C92B03D4AF",),
"name": ("qvodinsert.qvodctrl.1",),
"attrs": {
"URL": "",
"url": "",
},
"funcattrs": {
"URL": QvodCtrl.SetURL,
"url": QvodCtrl.SetURL,
},
"methods": {
"SetURL": QvodCtrl.SetURL,
},
},
# RDS.DataSpace
{
"id": (
"BD96C556-65A3-11D0-983A-00C04FC29E36",
"BD96C556-65A3-11D0-983A-00C04FC29E30",
"AB9BCEDD-EC7E-47E1-9322-D4A210617116",
"0006F033-0000-0000-C000-000000000046",
"0006F03A-0000-0000-C000-000000000046",
"7F5B7F63-F06F-4331-8A26-339E03C0AE3D",
"06723E09-F4C2-43c8-8358-09FCD1DB0766",
"639F725F-1B2D-4831-A9FD-874847682010",
"BA018599-1DB3-44f9-83B4-461454C84BF8",
"D0C07D56-7C69-43F1-B4A0-25F5A11FAB19",
"E8CCCDDF-CA28-496b-B050-6C07C962476B",
"6E32070A-766D-4EE6-879C-DC1FA91D2FC3",
"6414512B-B978-451D-A0D8-FCFDF33E833C",
),
"name": (
"rdsdataspace",
"rds.dataspace",
),
"attrs": {},
"funcattrs": {},
"methods": {
"CreateObject": RDSDataSpace.CreateObject,
},
},
# RealPlayer
{
"id": (
"FDC7A535-4070-4B92-A0EA-D9994BCC0DC5",
"2F542A2E-EDC9-4BF7-8CB1-87C9919F7F93",
"0FDF6D6B-D672-463B-846E-C6FF49109662",
"224E833B-2CC6-42D9-AE39-90B6A38A4FA2",
"3B46067C-FD87-49B6-8DDD-12F0D687035F",
"3B5E0503-DE28-4BE8-919C-76E0E894A3C2",
"44CCBCEB-BA7E-4C99-A078-9F683832D493",
"A1A41E11-91DB-4461-95CD-0C02327FD934",
"CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA",
),
"name": (
"ierpctl.ierpctl",
"ierpctl.ierpctl.1",
),
"attrs": {
"Console": "",
},
"funcattrs": {
"Console": RealPlayer.SetConsole,
},
"methods": {
"DoAutoUpdateRequest": RealPlayer.DoAutoUpdateRequest,
"PlayerProperty": RealPlayer.PlayerProperty,
"Import": RealPlayer.Import,
"SetConsole": RealPlayer.SetConsole,
},
},
# RediffBolDownloaderAttack
{
"id": ("BADA82CB-BF48-4D76-9611-78E2C6F49F03",),
"name": (),
"attrs": {
"url": "",
"start": "",
"fontsize": 14,
"barcolor": "EE4E00",
},
"funcattrs": {
"url": RediffBolDownloaderAttack.Seturl,
},
"methods": {
"Seturl": RediffBolDownloaderAttack.Seturl,
},
},
# RegistryPro
{
"id": ("D5C839EB-DA84-4F98-9D42-2074C2EE9EFC",),
"name": (),
"attrs": {},
"funcattrs": {},
"methods": {
"DeleteKey": RegistryPro.DeleteKey,
"About": RegistryPro.About,
},
},
# RisingScanner
{
"id": ("E4E2F180-CB8B-4DE9-ACBB-DA745D3BA153",),
"name": (),
"attrs": {
"BaseURL": "",
"Encardid": "",
},
"funcattrs": {},
"methods": {
"UpdateEngine": RisingScanner.UpdateEngine,
},
},
# RtspVaPgCtrl
{
"id": ("361E6B79-4A69-4376-B0F2-3D1EBEE9D7E2",),
"name": ("rtspvapgdecoder.rtspvapgctrl.1",),
"attrs": {
"MP4Prefix": "",
},
"funcattrs": {
"MP4Prefix": RtspVaPgCtrl.SetMP4Prefix,
},
"methods": {
"SetMP4Prefix": RtspVaPgCtrl.SetMP4Prefix,
},
},
# Scripting.Dictionary
{
"id": (),
"name": ("scripting.dictionary",),
"attrs": {
"Count": 0,
"dictionary": {},
},
"funcattrs": {},
"methods": {
"Add": ScriptingDictionary.Add,
"Exists": ScriptingDictionary.Exists,
"Items": ScriptingDictionary.Items,
"Keys": ScriptingDictionary.Keys,
"Remove": ScriptingDictionary.Remove,
"RemoveAll": ScriptingDictionary.RemoveAll,
},
},
# Scripting.Encoder
{
"id": (),
"name": ("scripting.encoder",),
"attrs": {},
"funcattrs": {},
"methods": {
"EncodeScriptFile": ScriptingEncoder.EncodeScriptFile,
},
},
# Scripting.FileSystemObject
{
"id": (),
"name": ("scripting.filesystemobject",),
"attrs": {},
"funcattrs": {},
"methods": {
"BuildPath": ScriptingFileSystemObject.BuildPath,
"CopyFile": ScriptingFileSystemObject.CopyFile,
"CreateFolder": ScriptingFileSystemObject.CreateFolder,
"CreateTextFile": ScriptingFileSystemObject.CreateTextFile,
"DeleteFile": ScriptingFileSystemObject.DeleteFile,
"FileExists": ScriptingFileSystemObject.FileExists,
"FolderExists": ScriptingFileSystemObject.FolderExists,
"GetExtensionName": ScriptingFileSystemObject.GetExtensionName,
"GetFile": ScriptingFileSystemObject.GetFile,
"GetSpecialFolder": ScriptingFileSystemObject.GetSpecialFolder,
"GetTempName": ScriptingFileSystemObject.GetTempName,
"MoveFile": ScriptingFileSystemObject.MoveFile,
"OpenTextFile": ScriptingFileSystemObject.OpenTextFile,
},
},
# Shell.Application
{
"id": (),
"name": ("shell.application",),
"attrs": {},
"funcattrs": {},
"methods": {
"ShellExecute": ShellApplication.ShellExecute,
"shellexecute": ShellApplication.ShellExecute,
},
},
# Shockwave
{
"id": ("233C1507-6A77-46A4-9443-F871F945D258",),
"name": (
"swctl.swctl",
"swctl.swctl.8",
),
"attrs": {},
"funcattrs": {},
"methods": {
"ShockwaveVersion": Shockwave.ShockwaveVersion,
},
},
# ShockwaveFlash.ShockwaveFlash.9
{
"id": (),
"name": ("shockwaveflash.shockwaveflash.9",),
"attrs": {},
"funcattrs": {},
"methods": {
"GetVariable": ShockwaveFlash9.GetVariable,
},
},
# ShockwaveFlash.ShockwaveFlash.10
{
"id": (),
"name": ("shockwaveflash.shockwaveflash.10",),
"attrs": {},
"funcattrs": {},
"methods": {
"GetVariable": ShockwaveFlash10.GetVariable,
},
},
# ShockwaveFlash.ShockwaveFlash.11
{
"id": (),
"name": ("shockwaveflash.shockwaveflash.11",),
"attrs": {},
"funcattrs": {},
"methods": {
"GetVariable": ShockwaveFlash11.GetVariable,
},
},
# ShockwaveFlash.ShockwaveFlash.12
{
"id": (),
"name": ("shockwaveflash.shockwaveflash.12",),
"attrs": {},
"funcattrs": {},
"methods": {
"GetVariable": ShockwaveFlash12.GetVariable,
},
},
# SiClientAccess
{
"id": (),
"name": ("siclientaccess.siclientaccess.1",),
"attrs": {},
"funcattrs": {},
"methods": {},
},
# SilverLight
{
"id": (),
"name": ("agcontrol.agcontrol",),
"attrs": {},
"funcattrs": {},
"methods": {
"isVersionSupported": SilverLight.isVersionSupported,
},
},
# SinaDLoader
{
"id": ("78ABDC59-D8E7-44D3-9A76-9A0918C52B4A",),
"name": ("downloader.dloader.1",),
"attrs": {},
"funcattrs": {},
"methods": {
"DownloadAndInstall": SinaDLoader.DownloadAndInstall,
},
},
# SnapshotViewer
{
"id": (
"F0E42D60-368C-11D0-AD81-00A0C90DC8D9",
"F2175210-368C-11D0-AD81-00A0C90DC8D9",
),
"name": ("snpvw.snapshot viewer control.1"),
"attrs": {
"SnapshotPath": "",
"CompressedPath": "",
},
"funcattrs": {},
"methods": {
"PrintSnapshot": SnapshotViewer.PrintSnapshot,
},
},
# SonicWallNetExtenderAddRouteEntry
{
"id": ("6EEFD7B1-B26C-440D-B55A-1EC677189F30",),
"name": (),
"attrs": {},
"funcattrs": {},
"methods": {
"AddRouteEntry": SonicWallNetExtenderAddRouteEntry.AddRouteEntry,
},
},
# Spreadsheet
{
"id": (
"0002E543-0000-0000-C000-000000000046",
"0002E55B-0000-0000-C000-000000000046",
),
"name": ("owc10.spreadsheet", "owc11.spreadsheet"),
"attrs": {},
"funcattrs": {},
"methods": {
"Evaluate": Spreadsheet.Evaluate,
"_Evaluate": Spreadsheet._Evaluate,
},
},
# SSReaderPdg2
{
"id": ("7F5E27CE-4A5C-11D3-9232-0000B48A05B2",),
"name": ("pdg2",),
"attrs": {},
"funcattrs": {},
"methods": {
"Register": SSReaderPdg2.Register,
"LoadPage": SSReaderPdg2.LoadPage,
},
},
# StormConfig
{
"id": ("BD103B2B-30FB-4F1E-8C17-D8F6AADBCC05",),
"name": ("config",),
"attrs": {},
"funcattrs": {},
"methods": {
"SetAttributeValue": StormConfig.SetAttributeValue,
},
},
# StormMps
{
"id": ("6BE52E1D-E586-474F-A6E2-1A85A9B4D9FB",),
"name": ("mps.stormplayer.1",),
"attrs": {
"URL": "",
"backImage": "",
"titleImage": "",
},
"funcattrs": {
"URL": StormMps.SetURL,
"backImage": StormMps.SetbackImage,
"titleImage": StormMps.SettitleImage,
},
"methods": {
"advancedOpen": StormMps.advancedOpen,
"isDVDPath": StormMps.isDVDPath,
"rawParse": StormMps.rawParse,
"OnBeforeVideoDownload": StormMps.OnBeforeVideoDownload,
"SetURL": StormMps.SetURL,
"SetbackImage": StormMps.SetbackImage,
"SettitleImage": StormMps.SettitleImage,
},
},
# SymantecAppStream
{
"id": ("3356DB7C-58A7-11D4-AA5C-006097314BF8",),
"name": (),
"attrs": {},
"funcattrs": {},
"methods": {
"installAppMgr": SymantecAppStream.installAppMgr,
},
},
# SymantecBackupExec
{
"id": ("22ACD16F-99EB-11D2-9BB3-00400561D975",),
"name": ("pvatlcalendar.pvcalendar.1",),
"attrs": {
"_DOWText0": "",
"_DOWText6": "",
"_MonthText0": "",
"_MonthText11": "",
},
"funcattrs": {
"_DOWText0": SymantecBackupExec.Set_DOWText0,
"_DOWText6": SymantecBackupExec.Set_DOWText6,
"_MonthText0": SymantecBackupExec.Set_MonthText0,
"_MonthText11": SymantecBackupExec.Set_MonthText11,
},
"methods": {
"Save": SymantecBackupExec.Save,
"Set_DOWText0": SymantecBackupExec.Set_DOWText0,
"Set_DOWText6": SymantecBackupExec.Set_DOWText6,
"Set_MonthText0": SymantecBackupExec.Set_MonthText0,
"Set_MonthText11": SymantecBackupExec.Set_MonthText11,
},
},
# System.Collections.ArrayList
{
"id": (),
"name": ("system.collections.arraylist",),
"attrs": {
"arraylist": [],
},
"funcattrs": {},
"methods": {
"Add": System.Collections.ArrayList.Add,
"ToArray": System.Collections.ArrayList.ToArray,
},
},
# System.IO.MemoryStream
{
"id": (),
"name": ("system.io.memorystream",),
"attrs": {
"stream": io.BytesIO(),
"Position": 0,
},
"funcattrs": {},
"methods": {
"Write": System.IO.MemoryStream.Write,
},
},
# System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
{
"id": (),
"name": ("system.runtime.serialization.formatters.binary.binaryformatter",),
"attrs": {},
"funcattrs": {},
"methods": {
"Deserialize_2": System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize_2,
},
},
# System.Security.Cryptography.FromBase64Transform
{
"id": (),
"name": ("system.security.cryptography.frombase64transform",),
"attrs": {},
"funcattrs": {},
"methods": {
"TransformFinalBlock": System.Security.Cryptography.FromBase64Transform.TransformFinalBlock,
},
},
# System.Text.ASCIIEncoding
{
"id": (),
"name": ("system.text.asciiencoding",),
"attrs": {},
"funcattrs": {},
"methods": {
"GetByteCount_2": System.Text.ASCIIEncoding.GetByteCount_2,
"GetBytes_4": System.Text.ASCIIEncoding.GetBytes_4,
},
},
# StreamAudioChainCast
{
"id": ("2253F320-AB68-4A07-917D-4F12D8884A06",),
"name": ("ccpm.proxymanager.1"),
"attrs": {},
"funcattrs": {},
"methods": {
"InternalTuneIn": StreamAudioChainCast.InternalTuneIn,
},
},
# Toshiba
{
"id": ("AD315309-EA00-45AE-9E8E-B6A61CE6B974",),
"name": ("meipcamx.recordsend.1",),
"attrs": {},
"funcattrs": {},
"methods": {
"SetPort": Toshiba.SetPort,
"SetIpAddress": Toshiba.SetIpAddress,
},
},
# UniversalUpload
{
"id": ("04FD48E6-0712-4937-B09E-F3D285B11D82",),
"name": (),
"attrs": {},
"funcattrs": {},
"methods": {
"RemoveFileOrDir": UniversalUpload.RemoveFileOrDir,
},
},
# UUSeeUpdate
{
"id": ("2CACD7BB-1C59-4BBB-8E81-6E83F82C813B",),
"name": ("uuupgrade.uuupgradectrl.1",),
"attrs": {},
"funcattrs": {},
"methods": {
"Update": UUSeeUpdate.Update,
},
},
# VisualStudio.DTE.8.0
{
"id": ("BA018599-1DB3-44F9-83B4-461454C84BF8",),
"name": (),
"attrs": {},
"funcattrs": {},
"methods": {
"CreateObject": VisualStudioDTE80.CreateObject,
},
},
# VLC
{
"id": ("E23FE9C6-778E-49D4-B537-38FCDE4887D8",),
"name": (),
"attrs": {},
"funcattrs": {},
"methods": {
"getVariable": VLC.getVariable,
"setVariable": VLC.setVariable,
"addTarget": VLC.addTarget,
},
},
# VsaIDE.DTE
{
"id": ("E8CCCDDF-CA28-496B-B050-6C07C962476B",),
"name": (),
"attrs": {},
"funcattrs": {},
"methods": {
"CreateObject": VsaIDEDTE.CreateObject,
},
},
# VsmIDE.DTE
{
"id": ("06723E09-F4C2-43C8-8358-09FCD1DB0766",),
"name": (),
"attrs": {},
"funcattrs": {},
"methods": {
"CreateObject": VsmIDEDTE.CreateObject,
},
},
# WebViewFolderIcon
{
"id": (),
"name": ("webviewfoldericon.webviewfoldericon.1",),
"attrs": {},
"funcattrs": {},
"methods": {
"setSlice": WebViewFolderIcon.setSlice,
},
},
# WindowsMediaPlayer
{
"id": ("22D6F312-B0F6-11D0-94AB-0080C74C7E95",),
"name": (),
"attrs": {},
"funcattrs": {},
"methods": {
"Play": WindowsMediaPlayer.Play,
},
},
# WinNTSystemInfo
{
"id": ("",),
"name": ("winntsysteminfo"),
"attrs": {},
"funcattrs": {
"ComputerName": WinNTSystemInfo.GetComputerName,
"DomainName": WinNTSystemInfo.GetDomainName,
"PDC": WinNTSystemInfo.GetPDC,
"UserName": WinNTSystemInfo.GetUserName,
},
"methods": {
"GetComputerName": WinNTSystemInfo.GetComputerName,
"GetDomainName": WinNTSystemInfo.GetDomainName,
"GetPDC": WinNTSystemInfo.GetPDC,
"GetUserName": WinNTSystemInfo.GetUserName,
},
},
# WinZip
{
"id": ("A09AE68F-B14D-43ED-B713-BA413F034904",),
"name": ("wzfileview.fileviewctrl.61"),
"attrs": {},
"funcattrs": {},
"methods": {
"CreateNewFolderFromName": WinZip.CreateNewFolderFromName,
},
},
# WMEncProfileManager
{
"id": ("A8D3AD02-7508-4004-B2E9-AD33F087F43C",),
"name": ("wmencprofilemanager",),
"attrs": {},
"funcattrs": {},
"methods": {
"GetDetailsString": WMEncProfileManager.GetDetailsString,
},
},
# WMP
{
"id": ("6BF52A52-394A-11D3-B153-00C04F79FAA6",),
"name": (),
"attrs": {"versionInfo": 10},
"funcattrs": {},
"methods": {
"openPlayer": WMP.openPlayer,
},
},
# WScriptNetwork
{
"id": (),
"name": ("wscript.network"),
"attrs": {},
"funcattrs": {
"ComputerName": WScriptNetwork.GetComputerName,
"UserDomain": WScriptNetwork.GetUserDomain,
"UserName": WScriptNetwork.GetUserName,
},
"methods": {
"EnumPrinterConnections": WScriptNetwork.EnumPrinterConnections,
"EnumNetworkDrives": WScriptNetwork.EnumNetworkDrives,
"GetComputerName": WScriptNetwork.GetComputerName,
"GetUserDomain": WScriptNetwork.GetUserDomain,
"GetUserName": WScriptNetwork.GetUserName,
},
},
# WScriptShell
{
"id": (),
"name": "wscript.shell",
"attrs": {
"CurrentDirectory": "C:\\Program Files",
},
"funcattrs": {},
"methods": {
"Run": WScriptShell.Run,
"_doRun": WScriptShell._doRun,
"Environment": WScriptShell.Environment,
"ExpandEnvironmentStrings": WScriptShell.ExpandEnvironmentStrings,
"CreateObject": WScriptShell.CreateObject,
"Sleep": WScriptShell.Sleep,
"Quit": WScriptShell.Quit,
"Echo": WScriptShell.Echo,
"valueOf": WScriptShell.valueOf,
"toString": WScriptShell.toString,
"SpecialFolders": WScriptShell.SpecialFolders,
"CreateShortcut": WScriptShell.CreateShortcut,
"RegRead": WScriptShell.RegRead,
"RegWrite": WScriptShell.RegWrite,
"Popup": WScriptShell.Popup,
"Exec": WScriptShell.Exec,
},
},
# WScriptShortcut
{
"id": (),
"name": ("wscript.shortcut"),
"attrs": {
"FullName": "",
"TargetPath": "",
"Description": "",
"Hotkey": "",
"IconLocation": "",
"RelativePath": "",
"WindowStyle": 1,
"WorkingDirectory": "",
},
"funcattrs": {},
"methods": {
"save": WScriptShortcut.save,
},
},
# XUpload
{
"id": ("E87F6C8E-16C0-11D3-BEF7-009027438003",),
"name": (),
"attrs": {},
"funcattrs": {},
"methods": {
"AddFolder": XUpload.AddFolder,
"AddFile": XUpload.AddFile,
},
},
# YahooJukebox
{
"id": (
"22FD7C0A-850C-4A53-9821-0B0915C96139",
"5F810AFC-BB5F-4416-BE63-E01DD117BD6C",
),
"name": (),
"attrs": {},
"funcattrs": {},
"methods": {
"AddBitmap": YahooJukebox.AddBitmap,
"AddButton": YahooJukebox.AddButton,
"AddImage": YahooJukebox.AddImage,
},
},
# YahooMessengerCyft
{
"id": ("24F3EAD6-8B87-4C1A-97DA-71C126BDA08F",),
"name": (),
"attrs": {},
"funcattrs": {},
"methods": {
"GetFile": YahooMessengerCyft.GetFile,
},
},
# YahooMessengerYVerInfo
{
"id": ("D5184A39-CBDF-4A4F-AC1A-7A45A852C883",),
"name": (),
"attrs": {},
"funcattrs": {},
"methods": {
"fvcom": YahooMessengerYVerInfo.fvcom,
"info": YahooMessengerYVerInfo.info,
},
},
# YahooMessengerYwcvwr
{
"id": (
"9D39223E-AE8E-11D4-8FD3-00D0B7730277",
"DCE2F8B1-A520-11D4-8FD0-00D0B7730277",
"7EC7B6C5-25BD-4586-A641-D2ACBB6629DD",
),
"name": (),
"attrs": {"server": ""},
"funcattrs": {
"server": YahooMessengerYwcvwr.Setserver,
},
"methods": {
"Setserver": YahooMessengerYwcvwr.Setserver,
"GetComponentVersion": YahooMessengerYwcvwr.GetComponentVersion,
"initialize": YahooMessengerYwcvwr.initialize,
"send": YahooMessengerYwcvwr.send,
"receive": YahooMessengerYwcvwr.receive,
},
},
# ZenturiProgramCheckerAttack
{
"id": ("59DBDDA6-9A80-42A4-B824-9BC50CC172F5",),
"name": (),
"attrs": {},
"funcattrs": {},
"methods": {
"DownloadFile": ZenturiProgramCheckerAttack.DownloadFile,
"DebugMsgLog": ZenturiProgramCheckerAttack.DebugMsgLog,
"NavigateUrl": ZenturiProgramCheckerAttack.NavigateUrl,
},
},
]
| 47,758
|
Python
|
.py
| 1,641
| 20.490555
| 106
| 0.53898
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,927
|
VisualStudioDTE80.py
|
buffer_thug/thug/ActiveX/modules/VisualStudioDTE80.py
|
import logging
log = logging.getLogger("Thug")
def CreateObject(self, _object, param=""): # pylint:disable=unused-argument
from thug import ActiveX
log.ThugLogging.add_behavior_warn(
f"[VisualStudio.DTE.8.0 ActiveX] CreateObject ({_object})"
)
log.ThugLogging.log_exploit_event(
self._window.url,
"VisualStudio.DTE.8.0 ActiveX",
"CreateObject",
data={"object": _object},
forward=False,
)
return ActiveX.ActiveX._ActiveXObject(self._window, _object)
| 527
|
Python
|
.py
| 15
| 29
| 76
| 0.672584
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,928
|
NessusScanCtrl.py
|
buffer_thug/thug/ActiveX/modules/NessusScanCtrl.py
|
# Nessus Vunlnerability Scanner ScanCtrl ActiveX Control
# CVE-2007-4061, CVE-2007-4062, CVE-2007-4031
import logging
log = logging.getLogger("Thug")
def deleteReport(self, arg):
log.ThugLogging.add_behavior_warn(
f"[Nessus Vunlnerability Scanner ScanCtrl ActiveX] deleteReport({arg})",
"CVE-2007-4031",
)
log.ThugLogging.log_exploit_event(
self._window.url,
"Nessus Vunlnerability Scanner ScanCtrl ActiveX",
"deleteReport",
cve="CVE-2007-4031",
data={"arg": arg},
forward=False,
)
log.ThugLogging.log_classifier("exploit", log.ThugLogging.url, "CVE-2007-4031")
def deleteNessusRC(self, arg):
log.ThugLogging.add_behavior_warn(
f"[Nessus Vunlnerability Scanner ScanCtrl ActiveX] deleteNessusRC({arg})",
"CVE-2007-4062",
)
log.ThugLogging.log_exploit_event(
self._window.url,
"Nessus Vunlnerability Scanner ScanCtrl ActiveX",
"deleteNEssusRC",
cve="CVE-2007-4062",
data={"arg": arg},
forward=False,
)
log.ThugLogging.log_classifier("exploit", log.ThugLogging.url, "CVE-2007-4062")
def saveNessusRC(self, arg):
log.ThugLogging.add_behavior_warn(
f"[Nessus Vunlnerability Scanner ScanCtrl ActiveX] saveNessusRC({arg})",
"CVE-2007-4061",
)
log.ThugLogging.log_exploit_event(
self._window.url,
"Nessus Vunlnerability Scanner ScanCtrl ActiveX",
"saveNessusRC",
cve="CVE-2007-4061",
data={"arg": arg},
forward=False,
)
log.ThugLogging.log_classifier("exploit", log.ThugLogging.url, "CVE-2007-4061")
def addsetConfig(self, arg, arg1, arg2):
log.ThugLogging.add_behavior_warn(
f"[Nessus Vunlnerability Scanner ScanCtrl ActiveX] addsetConfig({arg}, {arg1}, {arg2})",
"CVE-2007-4061",
)
log.ThugLogging.log_exploit_event(
self._window.url,
"Nessus Vunlnerability Scanner ScanCtrl ActiveX",
"addsetConfig",
cve="CVE-2007-4061",
data={"arg": arg, "arg1": arg1, "arg2": arg2},
forward=False,
)
log.ThugLogging.log_classifier("exploit", log.ThugLogging.url, "CVE-2007-4061")
| 2,210
|
Python
|
.py
| 60
| 30
| 96
| 0.661049
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,929
|
YahooMessengerCyft.py
|
buffer_thug/thug/ActiveX/modules/YahooMessengerCyft.py
|
# Yahoo! Messenger 8.x CYTF ActiveX Control
import logging
log = logging.getLogger("Thug")
def GetFile(self, url, local, arg2, arg3, cmd): # pylint:disable=unused-argument
log.ThugLogging.add_behavior_warn(f"[Yahoo! Messenger 8.x CYTF] Downloading {url}")
log.ThugLogging.log_exploit_event(
self._window.url,
"Yahoo! Messenger 8.x CYTF",
"Downloading",
forward=False,
data={"url": url},
)
| 446
|
Python
|
.py
| 12
| 31.5
| 87
| 0.672093
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,930
|
MicrosoftXMLDOM.py
|
buffer_thug/thug/ActiveX/modules/MicrosoftXMLDOM.py
|
# Microsoft XMLDOM
import logging
import base64
import binascii
log = logging.getLogger("Thug")
class Node:
def __init__(self, xml, elementName):
self._nodeTypedValue = None
self._dataType = None
self._xml = xml
self._node = xml.createElement(elementName)
self.text = ""
def getNodeTypedValue(self):
try:
if self._dataType in ("bin.base64",):
return base64.b64decode(self.text)
if self._dataType in ("bin.hex",):
return binascii.unhexlify(self.text)
except Exception as e: # pylint:disable=broad-except
log.info("[ERROR][getNodeTypedValue] %s", str(e))
return self.text
def setNodeTypedValue(self, value):
if self.dataType in ("bin.base64",):
self.text = base64.b64encode(value.encode())
elif self.dataType in ("bin.hex",):
self.text = binascii.hexlify(value.encode())
else:
self.text = value
nodeTypedValue = property(getNodeTypedValue, setNodeTypedValue)
def getDataType(self):
return self._dataType
def setDataType(self, value):
self._dataType = value
dataType = property(getDataType, setDataType)
def loadXML(self, bstrXML):
from thug.DOM.W3C import w3c
from thug.OS.Windows import security_sys
self.xml = w3c.parseString(bstrXML)
if "res://" not in bstrXML:
return
for p in bstrXML.split('"'):
if p.startswith("res://"):
log.URLClassifier.classify(p)
log.ThugLogging.add_behavior_warn(
f"[Microsoft XMLDOM ActiveX] Attempting to load {p}"
)
log.ThugLogging.log_classifier(
"exploit", log.ThugLogging.url, "CVE-2017-0022"
)
if any(sys.lower() in p.lower() for sys in security_sys):
self.parseError._errorCode = 0
def createElement(self, bstrTagName):
log.ThugLogging.add_behavior_warn(
f"[Microsoft XMLDOM ActiveX] Creating element {bstrTagName}"
)
return Node(self.xml, bstrTagName)
| 2,119
|
Python
|
.py
| 56
| 29.160714
| 69
| 0.625428
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,931
|
AolAmpX.py
|
buffer_thug/thug/ActiveX/modules/AolAmpX.py
|
# AOL Radio AOLMediaPlaybackControl.exe
# CVE-2007-6250
import logging
log = logging.getLogger("Thug")
def AppendFileToPlayList(self, arg):
if len(arg) > 512:
log.ThugLogging.log_exploit_event(
self._window.url,
"AOL Radio AOLMediaPlaybackControl ActiveX",
"Overflow in AppendFileToPlayList",
cve="CVE-2007-6250",
)
log.ThugLogging.log_classifier("exploit", log.ThugLogging.url, "CVE-2007-6250")
log.ThugLogging.Shellcode.check_shellcode(arg)
def ConvertFile(self, *arg):
if len(arg[0]) > 512:
log.ThugLogging.log_exploit_event(
self._window.url,
"AOL Radio AOLMediaPlaybackControl ActiveX",
"Overflow in ConvertFile",
cve="CVE-2007-6250",
)
log.ThugLogging.log_classifier("exploit", log.ThugLogging.url, "CVE-2007-6250")
log.ThugLogging.Shellcode.check_shellcode(arg[0])
| 948
|
Python
|
.py
| 24
| 31.166667
| 87
| 0.65393
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,932
|
CGAgent.py
|
buffer_thug/thug/ActiveX/modules/CGAgent.py
|
# Chinagames iGame CGAgent ActiveX Control Buffer Overflow
# CVE-2009-1800
import logging
log = logging.getLogger("Thug")
def CreateChinagames(self, arg0):
if len(arg0) > 428:
log.ThugLogging.log_exploit_event(
self._window.url,
"CGAgent ActiveX",
"CreateChinagames Method Buffer Overflow",
cve="CVE-2009-1800",
)
log.ThugLogging.log_classifier("exploit", log.ThugLogging.url, "CVE-2009-1800")
log.ThugLogging.Shellcode.check_shellcode(arg0)
| 531
|
Python
|
.py
| 14
| 30.571429
| 87
| 0.673828
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,933
|
RegistryPro.py
|
buffer_thug/thug/ActiveX/modules/RegistryPro.py
|
# Registry Pro (epRegPro.ocx)
# CVE-NOMATCH
import logging
log = logging.getLogger("Thug")
def DeleteKey(self, arg0, arg1):
if arg0 in (
80000001,
80000002,
):
log.ThugLogging.add_behavior_warn(
f"[RegistryPro ActiveX] Deleting [HKEY_LOCAL_MACHINE/{arg1}]"
)
log.ThugLogging.log_exploit_event(
self._window.url,
"RegistryPro ActiveX",
"Deleting Regkey",
forward=False,
data={"regkey": "HKEY_LOCAL_MACHINE/" + str(arg1)},
)
def About(self): # pylint:disable=unused-argument
log.ThugLogging.add_behavior_warn("[RegistryPro ActiveX] About called")
| 684
|
Python
|
.py
| 21
| 25
| 75
| 0.621005
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,934
|
ShellApplication.py
|
buffer_thug/thug/ActiveX/modules/ShellApplication.py
|
import re
import logging
log = logging.getLogger("Thug")
def ShellExecute(self, sFile, vArguments="", vDirectory="", vOperation="open", vShow=1):
cmdLine = f"{sFile} {vArguments}"
urls = re.findall(
r"http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+",
cmdLine.replace("'", '"'),
)
log.ThugLogging.add_behavior_warn(
f"[Shell.Application ActiveX] ShellExecute("
f'"{sFile}", "{vArguments}", "{vDirectory}", "{vOperation}", "{vShow}")'
)
log.ThugLogging.log_exploit_event(
self._window.url,
"Shell.Application ActiveX",
"ShellExecute command",
data={
"sFile": sFile,
"vArguments": vArguments,
"vDirectory": vDirectory,
"vOperation": vOperation,
"vShow": vShow,
},
forward=False,
)
for url in urls:
log.ThugLogging.add_behavior_warn(
f"[Shell.Application ActiveX] URL detected: {url}"
)
try:
self._window._navigator.fetch(url, redirect_type="ShellExecute")
except Exception: # pylint:disable=broad-except
pass
| 1,184
|
Python
|
.py
| 34
| 26.588235
| 90
| 0.562937
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,935
|
OurgameGLWorld.py
|
buffer_thug/thug/ActiveX/modules/OurgameGLWorld.py
|
# Ourgame GLWorld HanGamePluginCn18 Class ActiveX Control
# CVE-2008-0647
import logging
log = logging.getLogger("Thug")
def hgs_startGame(self, arg):
if len(arg) > 1000:
log.ThugLogging.log_exploit_event(
self._window.url,
"Ourgame GLWorld ActiveX",
"Overflow in hgs_startGame",
cve="CVE-2008-0647",
)
log.ThugLogging.log_classifier("exploit", log.ThugLogging.url, "CVE-2008-0647")
log.ThugLogging.Shellcode.check_shellcode(arg)
def hgs_startNotify(self, arg):
if len(arg) > 1000:
log.ThugLogging.log_exploit_event(
self._window.url,
"Ourgame GLWorld ActiveX",
"Overflow in hgs_startNotify",
cve="CVE-2008-0647",
)
log.ThugLogging.log_classifier("exploit", log.ThugLogging.url, "CVE-2008-0647")
log.ThugLogging.Shellcode.check_shellcode(arg)
| 919
|
Python
|
.py
| 24
| 29.958333
| 87
| 0.643743
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,936
|
SymantecBackupExec.py
|
buffer_thug/thug/ActiveX/modules/SymantecBackupExec.py
|
# Symantec BackupExec
# CVE-2007-6016,CVE-2007-6017
import logging
log = logging.getLogger("Thug")
def Set_DOWText0(self, val):
self.__dict__["_DOWText0"] = val
if len(val) > 255:
log.ThugLogging.log_exploit_event(
self._window.url,
"Symantec BackupExec ActiveX",
"Overflow in property _DOWText0",
cve="CVE-2007-6016",
)
log.ThugLogging.log_classifier("exploit", log.ThugLogging.url, "CVE-2007-6016")
log.ThugLogging.Shellcode.check_shellcode(val)
def Set_DOWText6(self, val):
self.__dict__["_DOWText6"] = val
if len(val) > 255:
log.ThugLogging.log_exploit_event(
self._window.url,
"Symantec BackupExec ActiveX",
"Overflow in property _DOWText6",
cve="CVE-2007-6016",
)
log.ThugLogging.log_classifier("exploit", log.ThugLogging.url, "CVE-2007-6016")
log.ThugLogging.Shellcode.check_shellcode(val)
def Set_MonthText0(self, val):
self.__dict__["_MonthText0"] = val
if len(val) > 255:
log.ThugLogging.log_exploit_event(
self._window.url,
"Symantec BackupExec ActiveX",
"Overflow in property _MonthText0",
cve="CVE-2007-6016",
)
log.ThugLogging.log_classifier("exploit", log.ThugLogging.url, "CVE-2007-6016")
log.ThugLogging.Shellcode.check_shellcode(val)
def Set_MonthText11(self, val):
self.__dict__["_MonthText11"] = val
if len(val) > 255:
log.ThugLogging.log_exploit_event(
self._window.url,
"Symantec BackupExec ActiveX",
"Overflow in property _MonthText11",
cve="CVE-2007-6016",
)
log.ThugLogging.log_classifier("exploit", log.ThugLogging.url, "CVE-2007-6016")
log.ThugLogging.Shellcode.check_shellcode(val)
def Save(self, a, b): # pylint:disable=unused-argument
return
| 1,949
|
Python
|
.py
| 50
| 30.46
| 87
| 0.626397
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,937
|
ShockwaveFlash9.py
|
buffer_thug/thug/ActiveX/modules/ShockwaveFlash9.py
|
import logging
log = logging.getLogger("Thug")
def GetVariable(self, arg): # pylint:disable=unused-argument
if arg in ("$version",):
version = ["0", "0", "0", "0"]
idx = 0
for p in log.ThugVulnModules.shockwave_flash.split("."):
version[idx] = p
idx += 1
return f"WIN {','.join(version)}"
return "" # pragma: no cover
| 390
|
Python
|
.py
| 11
| 28.090909
| 64
| 0.565684
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,938
|
ShockwaveFlash10.py
|
buffer_thug/thug/ActiveX/modules/ShockwaveFlash10.py
|
import logging
log = logging.getLogger("Thug")
def GetVariable(self, arg): # pylint:disable=unused-argument
if arg in ("$version",):
version = ["0", "0", "0", "0"]
idx = 0
for p in log.ThugVulnModules.shockwave_flash.split("."):
version[idx] = p
idx += 1
return f"WIN {','.join(version)}"
return "" # pragma: no cover
| 390
|
Python
|
.py
| 11
| 28.090909
| 64
| 0.565684
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,939
|
MicrosoftXMLHTTP.py
|
buffer_thug/thug/ActiveX/modules/MicrosoftXMLHTTP.py
|
# Microsoft XMLHTTP
import logging
# from urllib.parse import urlparse
# from urllib.parse import urlunparse
from lxml.html import builder as E
from lxml.html import tostring
from thug import DOM
log = logging.getLogger("Thug")
# XMLHttpRequest.readyState
#
# Value State Description
# 0 UNSENT Client has been created. open() not called yet.
# 1 OPENED open() has been called.
# 2 HEADERS_RECEIVED send() has been called, and headers and status are available.
# 3 LOADING Downloading; responseText holds partial data.
# 4 DONE The operation is complete.
def abort(self):
log.ThugLogging.add_behavior_warn("[Microsoft XMLHTTP ActiveX] abort")
self.dispatchEvent("abort")
return 0
def open(self, bstrMethod, bstrUrl, varAsync=True, varUser=None, varPassword=None): # pylint:disable=redefined-builtin
# Internet Explorer ignores any \r\n or %0d%0a or whitespace appended to the domain name
# parsedUrl = urlparse(bstrUrl)
# netloc = parsedUrl.netloc.strip("\r\n\t")
# bstrUrl = urlunparse((parsedUrl.scheme,
# netloc,
# parsedUrl.path,
# parsedUrl.params,
# parsedUrl.query,
# parsedUrl.fragment))
self.readyState = 1
msg = f"[Microsoft XMLHTTP ActiveX] open('{bstrMethod}', '{bstrUrl}', {varAsync is True}"
if varUser:
msg = f"{msg}, '{varUser}'"
if varPassword:
msg = f"{msg}, '{varPassword}'"
msg = f"{msg})"
log.ThugLogging.add_behavior_warn(msg)
log.ThugLogging.log_exploit_event(
self._window.url,
"Microsoft XMLHTTP ActiveX",
"Open",
forward=False,
data={"method": str(bstrMethod), "url": str(bstrUrl), "async": str(varAsync)},
)
self.bstrMethod = str(bstrMethod)
self.bstrUrl = str(bstrUrl)
self.varAsync = varAsync
self.varUser = varUser
self.varPassword = varPassword
return 0
def send(self, varBody=None):
msg = "send"
if varBody:
msg = f"{msg}('{str(varBody)}')"
log.ThugLogging.add_behavior_warn(f"[Microsoft XMLHTTP ActiveX] {msg}")
log.ThugLogging.add_behavior_warn(
f"[Microsoft XMLHTTP ActiveX] Fetching from URL {self.bstrUrl} (method: {self.bstrMethod})"
)
log.ThugLogging.log_exploit_event(
self._window.url,
"Microsoft XMLHTTP ActiveX",
"Send",
forward=False,
data={"method": self.bstrMethod, "url": str(self.bstrUrl)},
)
response = None
self.dispatchEvent("loadstart")
try:
response = self._window._navigator.fetch(
self.bstrUrl,
method=self.bstrMethod,
headers=self.requestHeaders,
body=varBody,
redirect_type="Microsoft XMLHTTP",
)
except Exception: # pylint:disable=broad-except
log.ThugLogging.add_behavior_warn("[Microsoft XMLHTTP ActiveX] Fetch failed")
self.dispatchEvent("timeout")
self.dispatchEvent("error")
if response is None:
return 0
self.readyState = 2
self.status = response.status_code
self.responseHeaders = response.headers
self.responseBody = response.content
self.responseText = response.text
self.responseURL = response.url
self.readyState = 4
if getattr(log, "XMLHTTP", None) is None:
log.XMLHTTP = {}
log.XMLHTTP["status"] = self.status
log.XMLHTTP["responseHeaders"] = self.responseHeaders
log.XMLHTTP["responseBody"] = self.responseBody
log.XMLHTTP["responseText"] = self.responseText
log.XMLHTTP["responseURL"] = self.responseURL
log.XMLHTTP["readyState"] = self.readyState
last_bstrUrl = log.XMLHTTP.get("last_bstrUrl", None)
last_bstrMethod = log.XMLHTTP.get("last_bstrMethod", None)
if last_bstrUrl in (self.bstrUrl,) and last_bstrMethod in (
self.bstrMethod,
): # pragma: no cover
return 0
log.XMLHTTP["last_bstrUrl"] = str(self.bstrUrl)
log.XMLHTTP["last_bstrMethod"] = str(self.bstrMethod)
if self.mimeType:
contenttype = self.mimeType
else:
contenttype = self.responseHeaders.get(
"content-type", log.Magic.get_mime(response.content)
)
if not contenttype: # pragma: no cover
return 0
if "text/css" not in contenttype:
self.dispatchEvent("load")
self.dispatchEvent("readystatechange")
if "javascript" in contenttype:
html = tostring(E.HTML(E.HEAD(), E.BODY(E.SCRIPT(response.text))))
doc = DOM.W3C.w3c.parseString(html)
window = DOM.Window.Window(
self.bstrUrl, doc, personality=log.ThugOpts.useragent
)
dft = DOM.DFT.DFT(window)
dft.run()
return 0
if "text/html" in contenttype:
tags = ("<html", "<body", "<head", "<script")
if not any(tag in response.text.lower() for tag in tags):
html = tostring(
E.HTML(E.HEAD(), E.BODY(E.SCRIPT(response.text)))
) # pragma: no cover
else:
html = response.text
doc = DOM.W3C.w3c.parseString(html)
window = DOM.Window.Window(
self.bstrUrl, doc, personality=log.ThugOpts.useragent
)
dft = DOM.DFT.DFT(window)
dft.run()
return 0
handler = log.MIMEHandler.get_handler(contenttype)
if handler:
handler(self.bstrUrl, self.responseBody)
return 0
def setTimeouts(self, ResolveTimeout, ConnectTimeout, SendTimeout, ReceiveTimeout): # pylint:disable=unused-argument
log.ThugLogging.add_behavior_warn(
f"[Microsoft XMLHTTP ActiveX] setTimeouts("
f"{ResolveTimeout}, "
f"{ConnectTimeout}, "
f"{SendTimeout}, "
f"{ReceiveTimeout}"
)
return 0
def waitForResponse(self, timeout): # pylint:disable=unused-argument
log.ThugLogging.add_behavior_warn(
f"[Microsoft XMLHTTP ActiveX] waitForResponse({timeout})"
)
def setRequestHeader(self, bstrHeader, bstrValue):
log.ThugLogging.add_behavior_warn(
f"[Microsoft XMLHTTP ActiveX] setRequestHeaders('{bstrHeader}', '{bstrValue}')"
)
self.requestHeaders[bstrHeader] = bstrValue
return 0
def getResponseHeader(self, header):
return self.responseHeaders.get(header, None)
def getAllResponseHeaders(self):
output = ""
for k, v in self.responseHeaders.items():
output += f"{k}: {v}\r\n"
return output
def overrideMimeType(self, mimetype):
self.mimeType = mimetype
def addEventListener(self, _type, listener, useCapture=False): # pylint:disable=unused-argument
if log.ThugOpts.features_logging:
log.ThugLogging.Features.increase_addeventlistener_count()
setattr(self, f"on{_type.lower()}", listener)
def removeEventListener(self, _type, listener, useCapture=False): # pylint:disable=unused-argument
if log.ThugOpts.features_logging:
log.ThugLogging.Features.increase_removeeventlistener_count()
_listener = getattr(self, f"on{_type.lower()}", None)
if _listener is None:
return
if _listener in (listener,):
delattr(self, f"on{_type.lower()}")
def dispatchEvent(self, evt, pfResult=True): # pylint:disable=unused-argument
if log.ThugOpts.features_logging:
log.ThugLogging.Features.increase_dispatchevent_count()
listener = getattr(self, f"on{evt.lower()}", None)
if listener is None:
return
with self._window.context:
listener.__call__()
def setOnReadyStateChange(self, val):
self.__dict__["onreadystatechange"] = val
if self.readyState == 4:
self.dispatchEvent("readystatechange")
| 7,787
|
Python
|
.py
| 196
| 33.204082
| 119
| 0.656699
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,940
|
DPClient.py
|
buffer_thug/thug/ActiveX/modules/DPClient.py
|
# Xunlei DPClient.Vod.1 ActiveX Control DownURL2 Method Remote Buffer Overflow Vulnerability
# CVE-2007-5064
import logging
log = logging.getLogger("Thug")
def DownURL2(self, arg0, *args): # pylint:disable=unused-argument
if len(arg0) > 1024:
log.ThugLogging.log_exploit_event(
self._window.url,
"Xunlei DPClient.Vod.1 ActiveX",
"DownURL2 Method Buffer Overflow",
cve="CVE-2007-5064",
)
log.ThugLogging.log_classifier("exploit", log.ThugLogging.url, "CVE-2007-5064")
log.ThugLogging.Shellcode.check_shellcode(arg0)
| 605
|
Python
|
.py
| 14
| 35.857143
| 92
| 0.6843
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,941
|
QuantumStreaming.py
|
buffer_thug/thug/ActiveX/modules/QuantumStreaming.py
|
# Move Networks Quantum Streaming Player Control
# CVE-NOMATCH
import logging
log = logging.getLogger("Thug")
def UploadLogs(self, url, arg): # pylint:disable=unused-argument
if len(url) > 20000:
log.ThugLogging.log_exploit_event(
self._window.url,
"Move Networks Quantum Streaming Player Control ActiveX",
"Overflow in UploadLogs method",
)
log.ThugLogging.Shellcode.check_shellcode(url)
| 458
|
Python
|
.py
| 12
| 31.5
| 69
| 0.692308
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,942
|
WebViewFolderIcon.py
|
buffer_thug/thug/ActiveX/modules/WebViewFolderIcon.py
|
# Microsoft Internet Explorer 6 WebViewFolderIcon
# CVE-2006-3730
import logging
log = logging.getLogger("Thug")
def setSlice(self, arg0, arg1, arg2, arg3):
log.ThugLogging.add_behavior_warn(
f"[WebViewFolderIcon ActiveX] setSlice({arg0}, {arg1}, {arg2}, {arg3})"
)
if arg0 == 0x7FFFFFFE:
log.ThugLogging.log_exploit_event(
self._window.url,
"WebViewFolderIcon ActiveX",
"setSlice attack",
cve="CVE-2006-3730",
)
log.ThugLogging.log_classifier("exploit", log.ThugLogging.url, "CVE-2006-3730")
| 590
|
Python
|
.py
| 16
| 29.8125
| 87
| 0.652021
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,943
|
ScriptingDictionary.py
|
buffer_thug/thug/ActiveX/modules/ScriptingDictionary.py
|
import logging
log = logging.getLogger("Thug")
def Add(self, key, item):
msg = f'[Scripting.Dictionary ActiveX] Add("{key}", "{item}")'
log.ThugLogging.add_behavior_warn(msg)
if key not in self.dictionary:
self.Count += 1
self.dictionary[key] = item
def Exists(self, key):
return key in self.dictionary
def Items(self):
msg = "[Scripting.Dictionary ActiveX] Items()"
log.ThugLogging.add_behavior_warn(msg)
return list(self.dictionary.values())
def Keys(self):
msg = "[Scripting.Dictionary ActiveX] Keys()"
log.ThugLogging.add_behavior_warn(msg)
return list(self.dictionary.keys())
def Remove(self, key):
msg = f'[Scripting.Dictionary ActiveX] Remove("{key}")'
log.ThugLogging.add_behavior_warn(msg)
if key in self.dictionary:
del self.dictionary[key]
self.Count -= 1
def RemoveAll(self):
msg = "[Scripting.Dictionary ActiveX] RemoveAll()"
log.ThugLogging.add_behavior_warn(msg)
self.dictionary.clear()
self.Count = 0
| 1,032
|
Python
|
.py
| 29
| 30.62069
| 66
| 0.697154
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,944
|
ZenturiProgramCheckerAttack.py
|
buffer_thug/thug/ActiveX/modules/ZenturiProgramCheckerAttack.py
|
import logging
log = logging.getLogger("Thug")
def DownloadFile(self, *arg):
log.ThugLogging.add_behavior_warn(
"[ZenturiProgramChecker ActiveX] Attack in DownloadFile function"
)
log.ThugLogging.add_behavior_warn(
f"[ZenturiProgramChecker ActiveX] Downloading from {arg[0]}"
)
log.ThugLogging.add_behavior_warn(
f"[ZenturiProgramChecker ActiveX] Saving downloaded file as: {arg[1]}"
)
log.ThugLogging.log_exploit_event(
self._window.url,
"ZenturiProgramChecker ActiveX",
"DownloadFile function",
forward=False,
data={"url": arg[0], "filename": arg[1]},
)
try:
self._window._navigator.fetch(
arg[0], redirect_type="ZenturiProgramChecker Exploit"
)
except Exception: # pylint:disable=broad-except
log.ThugLogging.add_behavior_warn(
"[ZenturiProgramChecker ActiveX] Fetch failed"
)
def DebugMsgLog(self, *arg):
log.ThugLogging.add_behavior_warn(
"[ZenturiProgramChecker ActiveX] Attack in DebugMsgLog function"
)
log.ThugLogging.log_exploit_event(
self._window.url,
"ZenturiProgramChecker ActiveX",
"Attack in DebugMsgLog function",
)
log.ThugLogging.Shellcode.check_shellcode(arg[0])
def NavigateUrl(self, *arg):
log.ThugLogging.add_behavior_warn(
"[ZenturiProgramChecker ActiveX] Attack in NavigateUrl function"
)
log.ThugLogging.log_exploit_event(
self._window.url,
"ZenturiProgramChecker ActiveX",
"Attack in NavigateUrl function",
)
log.ThugLogging.Shellcode.check_shellcode(arg[0])
| 1,660
|
Python
|
.py
| 47
| 28.510638
| 78
| 0.681421
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,945
|
AolICQ.py
|
buffer_thug/thug/ActiveX/modules/AolICQ.py
|
# AOL ICQ ActiveX Arbitrary File Download and Execut
# CVE-2006-5650
import logging
log = logging.getLogger("Thug")
def DownloadAgent(self, url):
log.ThugLogging.log_exploit_event(
self._window.url,
"AOL ICQ ActiveX",
"Arbitrary File Download and Execute",
cve="CVE-2006-5650",
data={"url": url},
)
log.ThugLogging.log_classifier("exploit", log.ThugLogging.url, "CVE-2006-5650")
log.ThugLogging.add_behavior_warn(f"[AOL ICQ ActiveX] Fetching from URL: {url}")
try:
self._window._navigator.fetch(url, redirect_type="AOL ICQ Exploit")
except Exception: # pylint:disable=broad-except
log.ThugLogging.add_behavior_warn("[AOL ICQ ActiveX] Fetch failed")
| 736
|
Python
|
.py
| 18
| 35.111111
| 84
| 0.692416
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,946
|
NamoInstaller.py
|
buffer_thug/thug/ActiveX/modules/NamoInstaller.py
|
# NamoInstaller ActiveX Control 1.x - 3.x
# CVE-NOMATCH
import logging
log = logging.getLogger("Thug")
def Install(self, arg):
if len(arg) > 1024:
log.ThugLogging.log_exploit_event(
self._window.url, "NamoInstaller ActiveX", "Overflow in Install method"
)
log.ThugLogging.Shellcode.check_shellcode(arg)
if str([arg]).find("http") > -1:
log.ThugLogging.add_behavior_warn(
f"[NamoInstaller ActiveX] Insecure download from URL {arg}"
)
log.ThugLogging.log_exploit_event(
self._window.url,
"NamoInstaller ActiveX",
"Insecure download from URL",
forward=False,
data={"url": arg},
)
try:
self._window._navigator.fetch(arg, redirect_type="NamoInstaller Exploit")
except Exception: # pylint:disable=broad-except
log.ThugLogging.add_behavior_warn("[NamoInstaller ActiveX] Fetch failed")
| 972
|
Python
|
.py
| 25
| 30.16
| 85
| 0.62845
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,947
|
EnjoySAP.py
|
buffer_thug/thug/ActiveX/modules/EnjoySAP.py
|
import logging
log = logging.getLogger("Thug")
def LaunchGui(self, arg0, arg1, arg2): # pylint:disable=unused-argument
if len(arg0) > 1500:
log.ThugLogging.log_exploit_event(
self._window.url, "EnjoySAP ActiveX", "LaunchGUI overflow in arg0"
)
log.ThugLogging.Shellcode.check_shellcode(arg0)
def PrepareToPostHTML(self, arg):
if len(arg) > 1000:
log.ThugLogging.log_exploit_event(
self._window.url, "EnjoySAP ActiveX", "PrepareToPostHTML overflow in arg"
)
log.ThugLogging.Shellcode.check_shellcode(arg)
def Comp_Download(self, arg0, arg1):
log.warning(arg0)
log.warning(arg1)
url = arg0
log.ThugLogging.add_behavior_warn(f"[EnjoySAP ActiveX] Fetching from URL {url}")
log.ThugLogging.log_exploit_event(
self._window.url,
"EnjoySAP ActiveX",
"Fetching from URL",
data={"url": url},
forward=False,
)
try:
self._window._navigator.fetch(url, redirect_type="EnjoySAP Exploit")
except Exception: # pylint:disable=broad-except
log.ThugLogging.add_behavior_warn("[EnjoySAP ActiveX] Fetch failed")
| 1,170
|
Python
|
.py
| 30
| 32.066667
| 85
| 0.673451
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,948
|
RediffBolDownloaderAttack.py
|
buffer_thug/thug/ActiveX/modules/RediffBolDownloaderAttack.py
|
import logging
log = logging.getLogger("Thug")
def Seturl(self, val):
self.__dict__["url"] = val
log.ThugLogging.log_exploit_event(
self._window.url, "RediffBolDownloader ActiveX", "Overflow in url property"
)
log.ThugLogging.Shellcode.check_shellcode(val)
| 285
|
Python
|
.py
| 8
| 31.125
| 83
| 0.714286
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,949
|
YahooMessengerYwcvwr.py
|
buffer_thug/thug/ActiveX/modules/YahooMessengerYwcvwr.py
|
# Yahoo! Messenger 8.x Ywcvwr ActiveX Control
# CVE-2007-4391
import logging
log = logging.getLogger("Thug")
def Setserver(self, name):
self.__dict__["server"] = name
if len(name) > 255:
log.ThugLogging.log_exploit_event(
self._window.url,
"Yahoo! Messenger 8.x Ywcvwr ActiveX",
"Server Console Overflow",
cve="CVE-2007-4391",
)
log.ThugLogging.log_classifier("exploit", log.ThugLogging.url, "CVE-2007-4391")
log.ThugLogging.Shellcode.check_shellcode(name)
def GetComponentVersion(self, arg):
log.ThugLogging.log_exploit_event(
self._window.url,
"Yahoo! Messenger 8.x Ywcvwr ActiveX",
"GetComponentVersion Overflow",
cve="CVE-2007-4391",
)
log.ThugLogging.log_classifier("exploit", log.ThugLogging.url, "CVE-2007-4391")
log.ThugLogging.Shellcode.check_shellcode(arg)
def initialize(self): # pylint:disable=unused-argument
return
def send(self): # pylint:disable=unused-argument
return
def receive(self): # pylint:disable=unused-argument
return
| 1,102
|
Python
|
.py
| 30
| 30.566667
| 83
| 0.68685
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,950
|
ShockwaveFlash11.py
|
buffer_thug/thug/ActiveX/modules/ShockwaveFlash11.py
|
import logging
log = logging.getLogger("Thug")
def GetVariable(self, arg): # pylint:disable=unused-argument
if arg in ("$version",):
version = ["0", "0", "0", "0"]
idx = 0
for p in log.ThugVulnModules.shockwave_flash.split("."):
version[idx] = p
idx += 1
return f"WIN {','.join(version)}"
return "" # pragma: no cover
| 390
|
Python
|
.py
| 11
| 28.090909
| 64
| 0.565684
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,951
|
DirectShow.py
|
buffer_thug/thug/ActiveX/modules/DirectShow.py
|
# Microsoft DirectShow MPEG2TuneRequest Component Stack Overflow(MS09-032)
# CVE-2008-0015,CVE-2008-0020
import logging
log = logging.getLogger("Thug")
def Setdata(self, val):
self.__dict__["data"] = val
log.ThugLogging.log_exploit_event(
self._window.url,
"Microsoft DirectShow MPEG2TuneRequest ActiveX",
"Stack Overflow in data property",
cve="CVE-2008-0015",
)
log.ThugLogging.log_classifier("exploit", log.ThugLogging.url, "CVE-2008-0015")
log.ThugLogging.Shellcode.check_shellcode(val)
| 548
|
Python
|
.py
| 14
| 34.071429
| 83
| 0.720227
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,952
|
SilverLight.py
|
buffer_thug/thug/ActiveX/modules/SilverLight.py
|
import logging
log = logging.getLogger("Thug")
def isVersionSupported(self, version): # pylint:disable=unused-argument
log.ThugLogging.add_behavior_warn(f"[SilverLight] isVersionSupported('{version}')")
return log.ThugVulnModules.silverlight.startswith(version)
| 274
|
Python
|
.py
| 5
| 51.6
| 87
| 0.800752
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,953
|
StreamAudioChainCast.py
|
buffer_thug/thug/ActiveX/modules/StreamAudioChainCast.py
|
# StreamAudio ChainCast VMR Client Proxy ActiveX Control 3.x
# CVE-NOMATCH
import logging
log = logging.getLogger("Thug")
def InternalTuneIn(self, arg0, arg1, arg2, arg3, arg4): # pylint:disable=unused-argument
if len(arg0) > 248:
log.ThugLogging.log_exploit_event(
self._window.url,
"StreamAudio ChainCast VMR Client Proxy ActiveX",
"Buffer overflow in arg0",
)
log.ThugLogging.Shellcode.check_shellcode(arg0)
| 480
|
Python
|
.py
| 12
| 33.333333
| 89
| 0.689655
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,954
|
HPInfo.py
|
buffer_thug/thug/ActiveX/modules/HPInfo.py
|
# HP Info Center ActiveX Control
# CVE-2007-6331, CVE-2007-6332, CVE-2007-6333
import logging
log = logging.getLogger("Thug")
def LaunchApp(self, prog, args, unk): # pylint:disable=unused-argument
log.ThugLogging.add_behavior_warn(
f"[HP Info Center ActiveX] LaunchApp called to run: {prog} {args}",
"CVE-2007-6331",
)
log.ThugLogging.log_exploit_event(
self._window.url,
"HP Info Center ActiveX",
"LaunchApp called to run",
cve="CVE-2007-6331",
forward=False,
data={"command": prog, "args": args},
)
log.ThugLogging.log_classifier("exploit", log.ThugLogging.url, "CVE-2007-6331")
def SetRegValue(self, key, section, keyname, value):
log.ThugLogging.add_behavior_warn(
f"[HP Info Center ActiveX] SetRegValue: {str(key)}/{str(section)}/{str(keyname)} "
f"set to {str(value)}",
"CVE-2007-6332",
)
log.ThugLogging.log_exploit_event(
self._window.url,
"HP Info Center ActiveX",
"SetRegValue",
cve="CVE-2007-6332",
forward=False,
data={
"key": str(key),
"section": str(section),
"keyname": str(keyname),
"value": str(value),
},
)
log.ThugLogging.log_classifier("exploit", log.ThugLogging.url, "CVE-2007-6332")
def GetRegValue(self, key, section, keyname):
log.ThugLogging.add_behavior_warn(
f"[HP Info Center ActiveX] GetRegValue, reading: "
f"{str(key)}/{str(section)}/{str(keyname)}",
"CVE-2007-6333",
)
log.ThugLogging.log_exploit_event(
self._window.url,
"HP Info Center ActiveX",
"GetRegValue",
cve="CVE-2007-6333",
forward=False,
data={"key": str(key), "section": str(section), "keyname": str(keyname)},
)
log.ThugLogging.log_classifier("exploit", log.ThugLogging.url, "CVE-2007-6333")
def EvaluateRules(self):
log.ThugLogging.log_exploit_event(
self._window.url, "HP Info Center ActiveX", "EvaluateRules"
)
def SaveToFile(self, path):
log.ThugLogging.add_behavior_warn(
f"[HP Info Center ActiveX] SaveToFile(), writes to {path}"
)
log.ThugLogging.log_exploit_event(
self._window.url,
"HP Info Center ActiveX",
"SaveToFile",
data={"filename": path},
forward=False,
)
def ProcessRegistryData(self, parm):
log.ThugLogging.add_behavior_warn(
f"[HP Info Center ActiveX] ProcessRegistryData: {parm} "
)
log.ThugLogging.log_exploit_event(
self._window.url,
"HP Info Center ActiveX",
"ProcessRegistryData",
data={"param": parm},
forward=False,
)
| 2,728
|
Python
|
.py
| 79
| 27.367089
| 90
| 0.623194
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,955
|
GomWeb.py
|
buffer_thug/thug/ActiveX/modules/GomWeb.py
|
# GOM Player GOM Manager ActiveX Control
# CVE-2007-5779
import logging
log = logging.getLogger("Thug")
def OpenURL(self, arg):
if len(arg) > 500:
log.ThugLogging.log_exploit_event(
self._window.url,
"GOM Player Manager ActiveX",
"Overflow in OpenURL",
cve="CVE-2007-5779",
)
log.ThugLogging.log_classifier("exploit", log.ThugLogging.url, "CVE-2007-5779")
log.ThugLogging.Shellcode.check_shellcode(arg)
| 492
|
Python
|
.py
| 14
| 27.785714
| 87
| 0.646934
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,956
|
JavaDeploymentToolkit.py
|
buffer_thug/thug/ActiveX/modules/JavaDeploymentToolkit.py
|
import logging
log = logging.getLogger("Thug")
def launch(self, arg):
log.ThugLogging.add_behavior_warn(
f"[Java Deployment Toolkit ActiveX] Launching: {arg}"
)
tokens = arg.split(" ")
if tokens[0].lower() != "http:":
return
for token in tokens[1:]:
if not token.lower().startswith("http"):
continue
log.ThugLogging.add_behavior_warn(
f"[Java Deployment Toolkit ActiveX] Fetching from URL {token}"
)
log.ThugLogging.log_exploit_event(
self._window.url,
"Java Deployment Toolkit ActiveX",
"Fetching from URL",
data={"url": token},
forward=False,
)
try:
self._window._navigator.fetch(
token, redirect_type="Java Deployment Toolkit Exploit"
)
except Exception: # pylint:disable=broad-except
log.ThugLogging.add_behavior_warn(
"[Java Deployment Toolkit ActiveX] Fetch Failed"
)
def launchApp(self, pJNLP, pEmbedded=None, pVmArgs=None): # pylint:disable=unused-argument
cve_2013_2416 = False
if len(pJNLP) > 32:
cve_2013_2416 = True
log.ThugLogging.Shellcode.check_shellcode(pJNLP)
if pEmbedded:
cve_2013_2416 = True
log.ThugLogging.Shellcode.check_shellcode(pEmbedded)
if cve_2013_2416:
log.ThugLogging.log_exploit_event(
self._window.url,
"Java Deployment Toolkit ActiveX",
"Java ActiveX component memory corruption (CVE-2013-2416)",
cve="CVE-2013-2416",
forward=True,
)
log.ThugLogging.log_classifier("exploit", log.ThugLogging.url, "CVE-2013-2416")
| 1,750
|
Python
|
.py
| 47
| 27.723404
| 91
| 0.606742
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,957
|
FileUploader.py
|
buffer_thug/thug/ActiveX/modules/FileUploader.py
|
# Lycos FileUploader Module 2.x
# CVE-NOMATCH
import logging
log = logging.getLogger("Thug")
def SetHandwriterFilename(self, val):
self.__dict__["HandwriterFilename"] = val
if len(val) > 1024:
log.ThugLogging.log_exploit_event(
self._window.url,
"Lycos FileUploader ActiveX",
"Overflow in HandwriterFilename property",
)
log.ThugLogging.Shellcode.check_shellcode(val)
| 441
|
Python
|
.py
| 13
| 27.307692
| 54
| 0.673759
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,958
|
Kingsoft.py
|
buffer_thug/thug/ActiveX/modules/Kingsoft.py
|
# Kingsoft Antivirus
# CVE-NOMATCH
import logging
log = logging.getLogger("Thug")
def SetUninstallName(self, arg):
if len(arg) > 900:
log.ThugLogging.log_exploit_event(
self._window.url,
"Kingsoft AntiVirus ActiveX",
"SetUninstallName Heap Overflow",
)
log.ThugLogging.Shellcode.check_shellcode(arg)
| 368
|
Python
|
.py
| 12
| 24
| 54
| 0.664773
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,959
|
SinaDLoader.py
|
buffer_thug/thug/ActiveX/modules/SinaDLoader.py
|
# Sina DLoader Class ActiveX Control 'DonwloadAndInstall'
# Method Arbitrary File Download Vulnerability
import logging
log = logging.getLogger("Thug")
def DownloadAndInstall(self, url):
log.ThugLogging.add_behavior_warn(
f"[SinaDLoader Downloader ActiveX] Fetching from URL {url}"
)
log.ThugLogging.log_exploit_event(
self._window.url,
"SinaDLoader Downloader ActiveX",
"Fetching from URL",
data={"url": url},
forward=False,
)
try:
self._window._navigator.fetch(url, redirect_type="SinaDLoader Exploit")
except Exception: # pylint:disable=broad-except
log.ThugLogging.add_behavior_warn(
"[SinaDLoader Downloader ActiveX] Fetch failed"
)
| 752
|
Python
|
.py
| 21
| 29.428571
| 79
| 0.69146
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,960
|
WScriptShell.py
|
buffer_thug/thug/ActiveX/modules/WScriptShell.py
|
import string
import time
import random
import re
import logging
import hashlib
import pefile
from thug.ActiveX.modules.WScriptExec import WScriptExec
from thug.OS.Windows import win32_registry
from thug.OS.Windows import win32_registry_map
log = logging.getLogger("Thug")
class _Environment:
def __init__(self, strType):
self.strType = strType
def Item(self, item): # pragma: no cover
log.ThugLogging.add_behavior_warn(
f"[WScript.Shell ActiveX] Getting Environment Item: {item}"
)
return item
def Run(self, strCommand, intWindowStyle=1, bWaitOnReturn=False): # pylint:disable=unused-argument
log.ThugLogging.add_behavior_warn(
f"[WScript.Shell ActiveX] Executing: {strCommand}"
)
log.ThugLogging.log_exploit_event(
self._window.url,
"WScript.Shell ActiveX",
"Run",
data={"command": strCommand},
forward=False,
)
data = {
"content": strCommand,
}
log.ThugLogging.log_location(log.ThugLogging.url, data)
log.TextClassifier.classify(log.ThugLogging.url, strCommand)
if "http" not in strCommand:
return
self._doRun(strCommand, 1)
def _doRun(self, p, stage):
try:
pefile.PE(data=p, fast_load=True)
return
except Exception: # pylint:disable=broad-except
pass
if not isinstance(p, str):
return # pragma: no cover
if log.ThugOpts.code_logging:
log.ThugLogging.add_code_snippet(p, "VBScript", "Contained_Inside")
log.ThugLogging.add_behavior_warn(
f"[WScript.Shell ActiveX] Run (Stage {stage}) Code:\n{p}"
)
log.ThugLogging.log_exploit_event(
self._window.url,
"WScript.Shell ActiveX",
"Run",
data={
"stage": stage,
"code": p,
},
forward=False,
)
s = None
while True:
if s is not None and len(s) < 2:
break
try:
index = p.index("http")
except ValueError:
break
p = p[index:]
s = p.split()
p = p[1:]
url = s[0]
url = url[:-1] if url.endswith(("'", '"')) else url
url = url.split('"')[0]
url = url.split("'")[0]
log.ThugLogging.add_behavior_warn(
f"[WScript.Shell ActiveX] Run (Stage {stage}) Downloading from URL {url}"
)
try:
response = self._window._navigator.fetch(url, redirect_type="doRun")
except Exception: # pragma: no cover,pylint:disable=broad-except
continue
if response is None or not response.ok:
continue # pragma: no cover
md5 = hashlib.md5() # nosec
md5.update(response.content)
md5sum = md5.hexdigest()
sha256 = hashlib.sha256()
sha256.update(response.content)
sha256sum = sha256.hexdigest()
log.ThugLogging.add_behavior_warn(
f"[WScript.Shell ActiveX] Run (Stage {stage}) Saving file {md5sum}"
)
p = " ".join(s[1:])
data = {
"status": response.status_code,
"content": response.content,
"md5": md5sum,
"sha256": sha256sum,
"fsize": len(response.content),
"ctype": response.headers.get("content-type", "unknown"),
"mtype": log.Magic.get_mime(response.content),
}
log.ThugLogging.log_location(url, data)
log.TextClassifier.classify(url, response.content)
self._doRun(response.content, stage + 1)
def Environment(self, strType=None):
log.ThugLogging.add_behavior_warn(
f'[WScript.Shell ActiveX] Environment("{strType}")'
)
log.ThugLogging.log_exploit_event(
self._window.url,
"WScript.Shell ActiveX",
"Environment",
data={"env": strType},
forward=False,
)
return _Environment(strType)
def ExpandEnvironmentStrings(self, strWshShell):
log.ThugLogging.add_behavior_warn(
f'[WScript.Shell ActiveX] Expanding environment string "{strWshShell}"'
)
log.ThugLogging.log_exploit_event(
self._window.url,
"WScript.Shell ActiveX",
"ExpandEnvironmentStrings",
data={"wshshell": strWshShell},
forward=False,
)
# Substitute shell variables
strWshShell = re.sub(
r"%([a-zA-Z-0-9_\(\)]+)%",
(lambda m: log.ThugOpts.Personality.getShellVariable(m.group(1))),
strWshShell,
)
# Generate random username
strWshShell = strWshShell.replace(
"{{username}}",
"".join(
random.choice(string.ascii_lowercase + string.digits) for _ in range(8)
),
)
# Generate random computer name
strWshShell = strWshShell.replace(
"{{computername}}",
"".join(
random.choice(string.ascii_uppercase + string.digits) for _ in range(8)
),
)
log.ThugLogging.add_behavior_warn(
f'[WScript.Shell ActiveX] Expanded environment string to "{strWshShell}"'
)
return strWshShell
def CreateObject(self, strProgID, strPrefix=""):
from thug import ActiveX
log.ThugLogging.add_behavior_warn(
f"[WScript.Shell ActiveX] CreateObject ({strProgID})"
)
log.ThugLogging.log_exploit_event(
self._window.url,
"WScript.Shell ActiveX",
"CreateObject",
data={"strProgID": strProgID, "strPrefix": strPrefix},
forward=False,
)
return ActiveX.ActiveX._ActiveXObject(self._window, strProgID)
def Sleep(self, intTime): # pylint:disable=unused-argument
log.ThugLogging.add_behavior_warn(f"[WScript.Shell ActiveX] Sleep({intTime})")
time.sleep(intTime * 0.001)
def Quit(self, code): # pylint:disable=unused-argument
log.ThugLogging.add_behavior_warn(f"[WScript.Shell ActiveX] Quit({code})")
def Exec(self, path): # pylint:disable=unused-argument
log.ThugLogging.add_behavior_warn(f"[WScript.Shell ActiveX] Exec({path})")
return WScriptExec()
def Echo(self, text): # pylint:disable=unused-argument
log.ThugLogging.add_behavior_warn(f"[WScript.Shell ActiveX] Echo({text})")
def valueOf(self): # pylint:disable=unused-argument
return "Windows Script Host"
def toString(self): # pylint:disable=unused-argument
return "Windows Script Host"
def SpecialFolders(self, strFolderName):
log.ThugLogging.add_behavior_warn(
f'[WScript.Shell ActiveX] Received call to SpecialFolders property "{strFolderName}"'
)
folderPath = log.ThugOpts.Personality.getSpecialFolder(strFolderName)
if folderPath:
folderPath = ExpandEnvironmentStrings(self, folderPath)
return f"{folderPath}"
def CreateShortcut(self, strPathname):
log.ThugLogging.add_behavior_warn(
f'[WScript.Shell ActiveX] CreateShortcut "{strPathname}"'
)
obj = CreateObject(self, "wscript.shortcut")
obj.FullName = strPathname
return obj
def RegRead(self, registry): # pylint:disable=unused-argument
if registry.lower() in win32_registry:
value = win32_registry[registry.lower()]
log.ThugLogging.add_behavior_warn(
f'[WScript.Shell ActiveX] RegRead("{registry}") = "{value}"'
)
return value
if registry.lower() in win32_registry_map:
value = log.ThugOpts.Personality.getShellVariable(
win32_registry_map[registry.lower()]
)
log.ThugLogging.add_behavior_warn(
f'[WScript.Shell ActiveX] RegRead("{registry}") = "{value}"'
)
return value
log.ThugLogging.add_behavior_warn(
f'[WScript.Shell ActiveX] RegRead("{registry}") = NOT FOUND'
)
return ""
def RegWrite(self, registry, value, strType="REG_SZ"): # pylint:disable=unused-argument
log.ThugLogging.add_behavior_warn(
f'[WScript.Shell ActiveX] RegWrite("{registry}", "{value}", "{strType}")'
)
win32_registry[registry.lower()] = value
def Popup(self, title="", timeout=0, message="", _type=0): # pylint:disable=unused-argument
log.ThugLogging.add_behavior_warn(
f'[WScript.Shell ActiveX] Popup("{title}", "{message}", "{_type}")'
)
return 0
| 8,198
|
Python
|
.py
| 225
| 29.12
| 99
| 0.642261
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,961
|
InternetCleverSuite.py
|
buffer_thug/thug/ActiveX/modules/InternetCleverSuite.py
|
# Clever Internet ActiveX Suite 6.2 (CLINETSUITEX6.OCX) Arbitrary file download/overwrite Exploit
import logging
log = logging.getLogger("Thug")
def GetToFile(self, url, _file):
log.ThugLogging.log_exploit_event(
self._window.url,
"Clever Internet ActiveX Suite 6.2 (CLINETSUITEX6.OCX)",
"Arbitrary File Download/Overwrite Exploit",
data={"url": url, "file": _file},
)
| 413
|
Python
|
.py
| 10
| 35.9
| 97
| 0.704261
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,962
|
BitDefender.py
|
buffer_thug/thug/ActiveX/modules/BitDefender.py
|
# BitDefender Online Scanner ActiveX Control
# CVE-2007-5775
import logging
log = logging.getLogger("Thug")
def initx(self, arg):
if len(arg) > 1024:
log.ThugLogging.log_exploit_event(
self._window.url,
"BitDefender Online Scanner ActiveX",
"InitX overflow",
cve="CVE-2007-5775",
)
log.ThugLogging.log_classifier("exploit", log.ThugLogging.url, "CVE-2007-5775")
log.ThugLogging.Shellcode.check_shellcode(arg)
| 498
|
Python
|
.py
| 14
| 28.214286
| 87
| 0.655532
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,963
|
PPlayer.py
|
buffer_thug/thug/ActiveX/modules/PPlayer.py
|
# Xunlei Thunder PPLAYER.DLL_1.WORK ActiveX Control
import logging
log = logging.getLogger("Thug")
def DownURL2(self, arg0, arg1, arg2, arg3): # pylint:disable=unused-argument
if len(arg0) > 1024:
log.ThugLogging.log_exploit_event(
self._window.url, "Xunlei Thunder PPlayer ActiveX", "DownURL2 Overflow"
)
log.ThugLogging.Shellcode.check_shellcode(arg0)
def SetFlvPlayerUrl(self, val):
self.__dict__["FlvPlayerUrl"] = val
if len(val) > 1060:
log.ThugLogging.log_exploit_event(
self._window.url,
"Xunlei Thunder PPlayer ActiveX",
"FlvPlayerUrl Property Handling Buffer Overflow",
)
log.ThugLogging.Shellcode.check_shellcode(val)
def SetLogo(self, val):
self.__dict__["Logo"] = val
if len(val) > 128:
log.ThugLogging.log_exploit_event(
self._window.url,
"Xunlei Thunder PPlayer ActiveX",
"Remote Overflow Exploit in Logo property",
)
log.ThugLogging.Shellcode.check_shellcode(val)
| 1,066
|
Python
|
.py
| 27
| 31.592593
| 83
| 0.654033
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,964
|
GatewayWeblaunch.py
|
buffer_thug/thug/ActiveX/modules/GatewayWeblaunch.py
|
# Gateway Weblaunch ActiveX Control
# CVE-NOMATCH
import logging
log = logging.getLogger("Thug")
def DoWebLaunch(self, arg0, arg1, arg2, arg3): # pylint:disable=unused-argument
if len(arg1) > 512 or len(arg3) > 512:
log.ThugLogging.log_exploit_event(
self._window.url, "Gateway Weblaunch ActiveX", "Overflow"
)
log.ThugLogging.Shellcode.check_shellcode(arg1)
log.ThugLogging.Shellcode.check_shellcode(arg3)
else:
log.ThugLogging.add_behavior_warn(
"[Gateway Weblaunch ActiveX] Trying to execute "
+ arg1
+ " "
+ arg2
+ " "
+ arg3
)
| 677
|
Python
|
.py
| 20
| 25.65
| 80
| 0.611026
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,965
|
File.py
|
buffer_thug/thug/ActiveX/modules/File.py
|
import logging
from thug.ActiveX.modules import TextStream
log = logging.getLogger("Thug")
ATTRIBUTES = {
"Normal": 0, # Normal file. No attributes are set.
"ReadOnly": 1, # Read-only file. Attribute is read/write.
"Hidden": 2, # Hidden file. Attribute is read/write.
"System": 4, # System file. Attribute is read/write.
"Volume": 8, # Disk drive volume label. Attribute is read-only.
"Directory": 16, # Folder or directory. Attribute is read-only.
"Archive": 32, # File has changed since last backup. Attribute is read/write.
"Alias": 1024, # Link or shortcut. Attribute is read-only.
"Compressed": 2048, # Compressed file. Attribute is read-only.
}
class File:
def __init__(self, filespec):
self.Path = filespec
self._Attributes = ATTRIBUTES["Archive"]
log.ThugLogging.add_behavior_warn(
f"[File ActiveX] Path = {self.Path}, Attributes = {self._Attributes}"
)
def getAttributes(self):
return self._Attributes
def setAttributes(self, key):
if key.lower() in (
"volume",
"directory",
"alias",
"compressed",
):
return
self._Attributes = ATTRIBUTES[key]
Attributes = property(getAttributes, setAttributes)
@property
def ShortPath(self):
_shortPath = []
for p in self.Path.split("\\"):
sp = p.split(".")
if len(sp) == 1:
spfn = p if len(p) <= 8 else f"{p[:6]}~1"
else:
spfn = ".".join(sp[:-1])
ext = sp[-1]
if len(spfn) > 8:
spfn = f"{spfn[:6]}~1"
spfn = f"{spfn}.{ext}"
_shortPath.append(spfn)
return "\\\\".join(_shortPath)
@property
def ShortName(self):
spath = self.Path.split("\\")
name = spath[-1]
sp = name.split(".")
if len(sp) == 1:
if len(name) <= 8:
return name
return f"{name[:6]}~1"
spfn = ".".join(sp[:-1])
ext = sp[-1]
if len(spfn) > 8:
spfn = f"{spfn[:6]}~1"
return f"{spfn}.{ext}"
@property
def Drive(self):
spath = self.Path.split("\\")
if spath[0].endswith(":"):
return spath[0]
return "C:"
def Copy(self, destination, overwrite=True):
log.ThugLogging.add_behavior_warn(
f"[File ActiveX] Copy({destination}, {overwrite})"
)
def Move(self, destination):
log.ThugLogging.add_behavior_warn(f"[File ActiveX] Move({destination})")
def Delete(self, force=False):
log.ThugLogging.add_behavior_warn(f"[File ActiveX] Delete({force})")
def OpenAsTextStream(self, iomode="ForReading", _format=0):
log.ThugLogging.add_behavior_warn(
f"[File ActiveX] OpenAsTextStream({iomode}, {_format})"
)
stream = TextStream.TextStream()
stream._filename = self.Path # pylint:disable=undefined-variable
return stream
| 3,094
|
Python
|
.py
| 83
| 28.120482
| 82
| 0.561704
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,966
|
Gogago.py
|
buffer_thug/thug/ActiveX/modules/Gogago.py
|
# Gogago YouTube Video Converter Buffer Overflow
# HTB23012
import logging
log = logging.getLogger("Thug")
def Download(self, arg):
if len(arg) > 1024:
log.ThugLogging.log_exploit_event(
self._window.url,
"Gogago YouTube Video Converter ActiveX",
"Buffer Overflow",
)
log.ThugLogging.Shellcode.check_shellcode(arg)
| 383
|
Python
|
.py
| 12
| 25.25
| 54
| 0.667575
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,967
|
ScriptingEncoder.py
|
buffer_thug/thug/ActiveX/modules/ScriptingEncoder.py
|
import logging
log = logging.getLogger("Thug")
def EncodeScriptFile(self, strExt, byte_stream, cFlags, bstrDefaultLang): # pylint:disable=unused-argument
msg = f'[Scripting.Encoder ActiveX] EncodeScriptFile("{strExt}", "{byte_stream}", {cFlags}, "{bstrDefaultLang}")'
log.ThugLogging.add_behavior_warn(msg)
return byte_stream
| 342
|
Python
|
.py
| 6
| 53.5
| 117
| 0.753754
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,968
|
DivX.py
|
buffer_thug/thug/ActiveX/modules/DivX.py
|
# DivX Player 6.6.0 ActiveX Control
# CVE-NOMATCH
import logging
log = logging.getLogger("Thug")
def SetPassword(self, arg0):
if len(arg0) > 128:
log.ThugLogging.log_exploit_event(
self._window.url, "DivX Player ActiveX", "Overflow in SetPassword"
)
log.ThugLogging.Shellcode.check_shellcode(arg0)
| 342
|
Python
|
.py
| 10
| 28.8
| 78
| 0.695122
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,969
|
AOLAttack.py
|
buffer_thug/thug/ActiveX/modules/AOLAttack.py
|
import logging
log = logging.getLogger("Thug")
def LinkSBIcons(self):
log.ThugLogging.log_exploit_event(
self._window.url,
"AOL ActiveX",
"Attack in LinkSBIcons function",
cve="CVE-2006-5820",
)
log.ThugLogging.log_classifier("exploit", log.ThugLogging.url, "CVE-2006-5820")
| 323
|
Python
|
.py
| 10
| 26.5
| 83
| 0.676375
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,970
|
VsaIDEDTE.py
|
buffer_thug/thug/ActiveX/modules/VsaIDEDTE.py
|
import logging
log = logging.getLogger("Thug")
def CreateObject(self, _object, param=""): # pylint:disable=unused-argument
from thug import ActiveX
log.ThugLogging.add_behavior_warn(f"[VsaIDE.DTE ActiveX] CreateObject ({_object})")
log.ThugLogging.log_exploit_event(
self._window.url,
"VsaIDE.DTE ActiveX",
"CreateObject",
data={"object": _object},
forward=False,
)
return ActiveX.ActiveX._ActiveXObject(self._window, _object)
| 493
|
Python
|
.py
| 13
| 31.923077
| 87
| 0.684211
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,971
|
AcroPDF.py
|
buffer_thug/thug/ActiveX/modules/AcroPDF.py
|
import logging
log = logging.getLogger("Thug")
def GetVersions(self): # pylint:disable=unused-argument
versions = ""
for feature in (
"Accessibility",
"AcroForm",
"Annots",
"Checkers",
"DigSig",
"DVA",
"eBook",
"EScript",
"HLS",
"IA32",
"MakeAccessible",
"Multimedia",
"PDDom",
"PPKLite",
"ReadOutLoud",
"reflow",
"SaveAsRTF",
"Search",
"Search5",
"SendMail",
"Spelling",
"Updater",
"weblink",
):
versions += f"{feature}={log.ThugVulnModules.acropdf_pdf},"
return versions
def GetVariable(self, variable): # pylint:disable=unused-argument
if variable in ("$version",):
return log.ThugVulnModules.acropdf_pdf
return "" # pragma: no cover
| 871
|
Python
|
.py
| 35
| 17.285714
| 67
| 0.545235
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,972
|
Spreadsheet.py
|
buffer_thug/thug/ActiveX/modules/Spreadsheet.py
|
# OWC10/11.Spreadsheet ActiveX
# CVE-2009-1136
import logging
log = logging.getLogger("Thug")
def _Evaluate(self, *args): # pylint:disable=unused-argument
log.ThugLogging.log_exploit_event(
self._window.url,
"OWC 10/11.Spreadsheet ActiveX",
"Attack in _Evaluate function",
cve="CVE-2009-1136",
)
log.ThugLogging.log_classifier("exploit", log.ThugLogging.url, "CVE-2009-1136")
def Evaluate(self, *args): # pylint:disable=unused-argument
log.ThugLogging.log_exploit_event(
self._window.url,
"OWC 10/11.Spreadsheet ActiveX",
"Attack in Evaluate function",
cve="CVE-2009-1136",
)
log.ThugLogging.log_classifier("exploit", log.ThugLogging.url, "CVE-2009-1136")
| 754
|
Python
|
.py
| 20
| 31.9
| 83
| 0.68595
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,973
|
VsmIDEDTE.py
|
buffer_thug/thug/ActiveX/modules/VsmIDEDTE.py
|
import logging
log = logging.getLogger("Thug")
def CreateObject(self, _object, param=""): # pylint:disable=unused-argument
from thug import ActiveX
log.ThugLogging.add_behavior_warn(f"[VsmIDE.DTE ActiveX] CreateObject ({_object})")
log.ThugLogging.log_exploit_event(
self._window.url,
"VsmIDE.DTE ActiveX",
"CreateObject",
data={"object": _object},
forward=False,
)
return ActiveX.ActiveX._ActiveXObject(self._window, _object)
| 493
|
Python
|
.py
| 13
| 31.923077
| 87
| 0.684211
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,974
|
BaiduBar.py
|
buffer_thug/thug/ActiveX/modules/BaiduBar.py
|
# BaiduBar.dll ActiveX DloadDS() Remote Code Execution Vulnerability
# BUGTRAQ ID: 25121
import logging
log = logging.getLogger("Thug")
def DloadDS(self, arg0, arg1, arg2): # pylint:disable=unused-argument
if str(arg0).lower().find(".cab") != -1:
log.ThugLogging.add_behavior_warn(
f"[BaiduBar.dll ActiveX] DloadDS function trying to download {arg0}"
)
log.ThugLogging.log_exploit_event(
self._window.url,
"BaiduBar.dll ActiveX",
"DloadDS function trying to download",
data={"url": arg0},
forward=False,
)
| 620
|
Python
|
.py
| 16
| 30.75
| 80
| 0.631667
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,975
|
WMEncProfileManager.py
|
buffer_thug/thug/ActiveX/modules/WMEncProfileManager.py
|
# Microsoft Windows Media Encoder WMEX.DLL ActiveX BufferOverflow vulnerability
# CVE-2008-3008
import logging
log = logging.getLogger("Thug")
def GetDetailsString(self, arg0, arg1): # pylint:disable=unused-argument
if len(arg0) > 1023:
log.ThugLogging.add_behavior_warn(
"[Microsoft Windows Media Encoder WMEX.DLL ActiveX] GetDetailsString Method Buffer Overflow",
"CVE-2008-3008",
)
log.ThugLogging.log_exploit_event(
self._window.url,
"Microsoft Windows Media Encoder WMEX.DLL ActiveX",
"GetDetailsString Method Buffer Overflow",
cve="CVE-2008-3008",
)
log.ThugLogging.log_classifier("exploit", log.ThugLogging.url, "CVE-2008-3008")
log.ThugLogging.Shellcode.check_shellcode(arg0)
| 815
|
Python
|
.py
| 18
| 37.055556
| 105
| 0.685209
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,976
|
StormMps.py
|
buffer_thug/thug/ActiveX/modules/StormMps.py
|
# MPS.StormPlayer.1 'advanceOpen'
# CVE
import logging
log = logging.getLogger("Thug")
def advancedOpen(self, arg0, arg1): # pylint:disable=unused-argument
if len(arg0) > 259:
log.ThugLogging.log_exploit_event(
self._window.url, "MPS.StormPlayer.1 ActiveX", "advanceOpen Method Overflow"
)
log.ThugLogging.Shellcode.check_shellcode(arg0)
def isDVDPath(self, arg0):
if len(arg0) > 246:
log.ThugLogging.log_exploit_event(
self._window.url, "MPS.StormPlayer.1 ActiveX", "isDVDPath Method Overflow"
)
log.ThugLogging.Shellcode.check_shellcode(arg0)
def rawParse(self, arg0):
if len(arg0) > 259:
log.ThugLogging.log_exploit_event(
self._window.url, "MPS.StormPlayer.1 ActiveX", "rawParse Method Overflow"
)
log.ThugLogging.Shellcode.check_shellcode(arg0)
def OnBeforeVideoDownload(self, arg0):
if len(arg0) > 4124:
log.ThugLogging.log_exploit_event(
self._window.url,
"MPS.StormPlayer.1 ActiveX",
"OnBeforeVideoDownload Method Overflow",
)
log.ThugLogging.Shellcode.check_shellcode(arg0)
def SetURL(self, val):
self.__dict__["URL"] = val
if len(val) > 259:
log.ThugLogging.log_exploit_event(
self._window.url, "MPS.StormPlayer.1 ActiveX", "URL Console Overflow"
)
log.ThugLogging.Shellcode.check_shellcode(val)
def SetbackImage(self, val):
self.__dict__["backImage"] = val
if len(val) > 292:
log.ThugLogging.log_exploit_event(
self._window.url, "MPS.StormPlayer.1 ActiveX", "backImage Console Overflow"
)
log.ThugLogging.Shellcode.check_shellcode(val)
def SettitleImage(self, val):
self.__dict__["titleImage"] = val
if len(val) > 296:
log.ThugLogging.log_exploit_event(
self._window.url, "MPS.StormPlayer.1 ActiveX", "titleImage Console Overflow"
)
log.ThugLogging.Shellcode.check_shellcode(val)
| 2,028
|
Python
|
.py
| 51
| 32.196078
| 88
| 0.659857
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,977
|
Move.py
|
buffer_thug/thug/ActiveX/modules/Move.py
|
# Move Networks Upgrade Manager 1.x
# CVE-NOMATCH
import logging
log = logging.getLogger("Thug")
def Upgrade(self, arg0, arg1, arg2, arg3): # pylint:disable=unused-argument
if len(arg0) > 6000:
log.ThugLogging.log_exploit_event(
self._window.url,
"Move Networks Upgrade Manager ActiveX",
"Overflow in Upgrade",
)
log.ThugLogging.Shellcode.check_shellcode(arg0)
| 430
|
Python
|
.py
| 12
| 29.166667
| 76
| 0.669082
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,978
|
MSRICHTXT.py
|
buffer_thug/thug/ActiveX/modules/MSRICHTXT.py
|
# Microsoft Rich Textbox Control 6.0 (SP6)
# CVE-NOMATCH
import logging
log = logging.getLogger("Thug")
def SaveFile(self, path, arg): # pylint:disable=unused-argument
log.ThugLogging.add_behavior_warn(
f"[Microsoft Rich Textbox Control ActiveX] Writing to file {str(path)}"
)
log.ThugLogging.add_behavior_warn(
f"[Microsoft Rich Textbox Control ActiveX] Content: \n{str(self.Text)}"
)
log.ThugLogging.log_exploit_event(
self._window.url,
"Microsoft Rich Textbox Control ActiveX",
"Writing file",
data={"file": str(path), "content": str(self.Text)},
forward=False,
)
| 652
|
Python
|
.py
| 18
| 30.555556
| 79
| 0.67619
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,979
|
WinNTSystemInfo.py
|
buffer_thug/thug/ActiveX/modules/WinNTSystemInfo.py
|
import string
import random
import logging
log = logging.getLogger("Thug")
def GetComputerName(self): # pylint:disable=unused-argument
log.ThugLogging.add_behavior_warn("[WinNTSystemInfo ActiveX] Getting ComputerName")
nlen = random.randint(6, 10)
computerName = "".join(
random.choice(string.ascii_letters + string.digits) for _ in range(nlen)
)
return computerName
def GetDomainName(self): # pylint:disable=unused-argument
log.ThugLogging.add_behavior_warn("[WinNTSystemInfo ActiveX] Getting DomainName")
nlen = random.randint(6, 10)
domainName = "".join(
random.choice(string.ascii_letters + string.digits) for _ in range(nlen)
)
return domainName
def GetPDC(self): # pylint:disable=unused-argument
log.ThugLogging.add_behavior_warn(
"[WinNTSystemInfo ActiveX] Getting PDC (Primary Domain Controller)"
)
nlen = random.randint(6, 10)
pdc = "".join(
random.choice(string.ascii_letters + string.digits) for _ in range(nlen)
)
return pdc
def GetUserName(self): # pylint:disable=unused-argument
log.ThugLogging.add_behavior_warn("[WinNTSystemInfo ActiveX] Getting UserName")
nlen = random.randint(6, 10)
userName = "".join(
random.choice(string.ascii_letters + string.digits) for _ in range(nlen)
)
return userName
| 1,358
|
Python
|
.py
| 34
| 34.794118
| 87
| 0.718439
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,980
|
Domino.py
|
buffer_thug/thug/ActiveX/modules/Domino.py
|
# IBM Lotus Domino Web Access Control ActiveX Control
# CVE-2007-4474
import logging
log = logging.getLogger("Thug")
def SetGeneral_ServerName(self, val):
self.__dict__["General_ServerName"] = val
if len(val) > 1024:
log.ThugLogging.log_exploit_event(
self._window.url,
"IBM Lotus Domino Web Access Control ActiveX",
"Overflow in General_ServerName property",
cve="CVE-2007-4474",
)
log.ThugLogging.log_classifier("exploit", log.ThugLogging.url, "CVE-2007-4474")
log.ThugLogging.Shellcode.check_shellcode(val)
def SetGeneral_JunctionName(self, val):
self.__dict__["General_JunctionName"] = val
if len(val) > 1024:
log.ThugLogging.log_exploit_event(
self._window.url,
"IBM Lotus Domino Web Access Control ActiveX",
"Overflow in General_JunctionName property",
cve="CVE-2007-4474",
)
log.ThugLogging.log_classifier("exploit", log.ThugLogging.url, "CVE-2007-4474")
log.ThugLogging.Shellcode.check_shellcode(val)
def SetMail_MailDbPath(self, val):
self.__dict__["Mail_MailDbPath"] = val
if len(val) > 1024:
log.ThugLogging.log_exploit_event(
self._window.url,
"IBM Lotus Domino Web Access Control ActiveX",
"Overflow in Mail_MailDbPath property",
cve="CVE-2007-4474",
)
log.ThugLogging.log_classifier("exploit", log.ThugLogging.url, "CVE-2007-4474")
log.ThugLogging.Shellcode.check_shellcode(val)
def InstallBrowserHelperDll(self): # pylint:disable=unused-argument
pass
| 1,651
|
Python
|
.py
| 39
| 34.051282
| 87
| 0.657268
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,981
|
YahooJukebox.py
|
buffer_thug/thug/ActiveX/modules/YahooJukebox.py
|
# Yahoo! Music Jukebox 2.x
# CVE-NOMATCH
import logging
log = logging.getLogger("Thug")
def AddBitmap(self, arg0, arg1, arg2, arg3, arg4, arg5): # pylint:disable=unused-argument
if len(arg1) > 256:
log.ThugLogging.log_exploit_event(
self._window.url, "Yahoo! Music Jukebox ActiveX", "Overflow in AddBitmap"
)
log.ThugLogging.Shellcode.check_shellcode(arg1)
def AddButton(self, arg0, arg1): # pylint:disable=unused-argument
if len(arg0) > 256:
log.ThugLogging.log_exploit_event(
self._window.url, "Yahoo! Music Jukebox ActiveX", "Overflow in AddButton"
)
log.ThugLogging.Shellcode.check_shellcode(arg0)
def AddImage(self, arg0, arg1): # pylint:disable=unused-argument
if len(arg0) > 256:
log.ThugLogging.log_exploit_event(
self._window.url, "Yahoo! Music Jukebox ActiveX", "Overflow in AddImage"
)
log.ThugLogging.Shellcode.check_shellcode(arg0)
| 976
|
Python
|
.py
| 22
| 37.545455
| 90
| 0.682875
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,982
|
SymantecAppStream.py
|
buffer_thug/thug/ActiveX/modules/SymantecAppStream.py
|
# Symantec AppStream LaunchObj ActiveX Arbitrary File Download and Execute
# CVE-2008-4388
import logging
log = logging.getLogger("Thug")
def installAppMgr(self, url):
log.ThugLogging.log_exploit_event(
self._window.url,
"Symantec AppStream LaunchObj ActiveX",
"Arbitrary File Download and Execute",
cve="CVE-2008-4388",
data={"url": url},
)
log.ThugLogging.log_classifier("exploit", log.ThugLogging.url, "CVE-2008-4388")
log.ThugLogging.add_behavior_warn(
f"[Symantec AppStream LaunchObj ActiveX] Fetching from URL {url}"
)
try:
self._window._navigator.fetch(url, redirect_type="CVE-2008-4388")
except Exception: # pylint:disable=broad-except
log.ThugLogging.add_behavior_warn(
"[Symantec AppStream LaunchObj ActiveX] Fetch failed"
)
| 854
|
Python
|
.py
| 22
| 32.454545
| 83
| 0.692494
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,983
|
RisingScanner.py
|
buffer_thug/thug/ActiveX/modules/RisingScanner.py
|
# Rising Online Virus Scanner Web Scan ActiveX Control
# CVE-NOMATCH
import logging
log = logging.getLogger("Thug")
def UpdateEngine(self):
log.ThugLogging.log_exploit_event(
self._window.url,
"Rising Online Virus Scanner Web Scan ActiveX",
"UpdateEngine Method vulnerability",
)
| 316
|
Python
|
.py
| 10
| 27
| 55
| 0.731788
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,984
|
Toshiba.py
|
buffer_thug/thug/ActiveX/modules/Toshiba.py
|
# Toshiba Surveillance (Surveillix) RecordSend Class (MeIpCamX.DLL 1.0.0.4)
# CVE-NOMATCH
import logging
log = logging.getLogger("Thug")
def SetPort(self, arg):
if len(arg) > 10:
log.ThugLogging.log_exploit_event(
self._window.url,
"Toshiba Surveillance RecordSend Class ActiveX",
"Overflow in SetPort",
)
log.ThugLogging.Shellcode.check_shellcode(arg)
def SetIpAddress(self, arg):
if len(arg) > 18:
log.ThugLogging.log_exploit_event(
self._window.url,
"Toshiba Surveillance RecordSend Class ActiveX",
"Overflow in SetIpAddress",
)
log.ThugLogging.Shellcode.check_shellcode(arg)
| 713
|
Python
|
.py
| 20
| 27.95
| 75
| 0.653566
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,985
|
PTZCamPanel.py
|
buffer_thug/thug/ActiveX/modules/PTZCamPanel.py
|
# RTS Sentry Digital Surveillance PTZCamPanel Class (CamPanel.dll 2.1.0.2)
# CVE-NOMATCH
import logging
log = logging.getLogger("Thug")
def ConnectServer(self, server, user): # pylint:disable=unused-argument
if len(user) > 1024:
log.ThugLogging.log_exploit_event(
self._window.url,
"PTZCamPanel ActiveX",
"Overflow in ConnectServer user arg",
)
log.ThugLogging.Shellcode.check_shellcode(user)
| 462
|
Python
|
.py
| 12
| 31.833333
| 74
| 0.686099
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,986
|
WinZip.py
|
buffer_thug/thug/ActiveX/modules/WinZip.py
|
# WinZip FileView ActiveX Control
# CVE-2006-3890,CVE-2006-5198,CVE-2006-6884
import logging
log = logging.getLogger("Thug")
def CreateNewFolderFromName(self, arg):
if len(arg) > 230:
log.ThugLogging.log_exploit_event(
self._window.url,
"WinZip ActiveX",
"CreateNewFolderFromName Overflow",
cve="CVE-2006-6884",
)
log.ThugLogging.log_classifier("exploit", log.ThugLogging.url, "CVE-2006-6884")
log.ThugLogging.Shellcode.check_shellcode(arg)
| 530
|
Python
|
.py
| 14
| 30.5
| 87
| 0.671233
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,987
|
__init__.py
|
buffer_thug/thug/ActiveX/modules/__init__.py
|
__all__ = [
"AcroPDF",
"AdodbStream",
"AnswerWorks",
"AolAmpX",
"AolICQ",
"AOLAttack",
"BaiduBar",
"BitDefender",
"CABrightStor",
"CGAgent",
"Comodo",
"ConnectAndEnterRoom",
"CreativeSoftAttack",
"DirectShow",
"DivX",
"DLinkMPEG",
"Domino",
"DPClient",
"DVRHOSTWeb",
"EnjoySAP",
"FacebookPhotoUploader",
"FileUploader",
"GatewayWeblaunch",
"GLIEDown2",
"Gogago",
"GomWeb",
"HPInfo",
"ICQToolbar",
"IMWebControl",
"InternetCleverSuite",
"JavaDeploymentToolkit",
"JetAudioDownloadFromMusicStore",
"Kingsoft",
"MacrovisionFlexNet",
"MicrosoftWorks7Attack",
"MicrosoftXMLDOM",
"MicrosoftXMLHTTP",
"Move",
"MSRICHTXT",
"MSVFP",
"MSXML2DOMDocument",
"MyspaceUploader",
"NamoInstaller",
"NCTAudioFile2",
"NeoTracePro",
"NessusScanCtrl",
"OfficeOCX",
"OurgameGLWorld",
"PPlayer",
"PTZCamPanel",
"QuantumStreaming",
"QvodCtrl",
"RDSDataSpace",
"RealPlayer",
"RediffBolDownloaderAttack",
"RegistryPro",
"RisingScanner",
"RtspVaPgCtrl",
"ScriptingFileSystemObject",
"ShellApplication",
"Shockwave",
"ShockwaveFlash9",
"ShockwaveFlash10",
"ShockwaveFlash11",
"ShockwaveFlash12",
"SilverLight",
"SinaDLoader",
"SnapshotViewer",
"SonicWallNetExtenderAddRouteEntry",
"Spreadsheet",
"SSReaderPdg2",
"StormConfig",
"StormMps",
"StreamAudioChainCast",
"SymantecAppStream",
"SymantecBackupExec",
"Toshiba",
"UniversalUpload",
"UUSeeUpdate",
"VisualStudioDTE80",
"VLC",
"VsaIDEDTE",
"VsmIDEDTE",
"WebViewFolderIcon",
"WindowsMediaPlayer",
"WinNTSystemInfo",
"WinZip",
"WMEncProfileManager",
"WScriptShell",
"WScriptShortcut",
"WScriptNetwork",
"WMP",
"XMLDOMParseError",
"XUpload",
"YahooJukebox",
"YahooMessengerCyft",
"YahooMessengerYVerInfo",
"YahooMessengerYwcvwr",
"ZenturiProgramCheckerAttack",
]
| 2,079
|
Python
|
.py
| 101
| 15.663366
| 40
| 0.645096
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,988
|
GLIEDown2.py
|
buffer_thug/thug/ActiveX/modules/GLIEDown2.py
|
# Ourgame GLWorld GLIEDown2.dll ActiveX Control Vulnerabilities
import logging
log = logging.getLogger("Thug")
def IEStartNative(self, arg0, arg1, arg2): # pylint:disable=unused-argument
if len(arg0) > 220:
log.ThugLogging.log_exploit_event(
self._window.url,
"Ourgame GLWorld GLIEDown2.dll ActiveX",
"IEStartNative Method Buffer Overflow",
)
log.ThugLogging.Shellcode.check_shellcode(arg0)
| 460
|
Python
|
.py
| 11
| 34.636364
| 76
| 0.698876
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,989
|
WScriptNetwork.py
|
buffer_thug/thug/ActiveX/modules/WScriptNetwork.py
|
import logging
import random
import string
from thug.ActiveX.modules import WScriptShell
from thug.ActiveX.modules import WScriptCollection
log = logging.getLogger("Thug")
def EnumPrinterConnections(self): # pylint:disable=unused-argument
log.ThugLogging.add_behavior_warn(
"[WScript.Network ActiveX] Got request to PrinterConnections"
)
printerlist = [
["nul:", "Send To OneNote 2010"],
["XPSPort:", "Microsoft XPS Document Writer"],
["SHRFAX:", "Fax"],
]
for _ in range(3):
ip = GetRandomIp()
printerlist.append([f"IP_{ip}", GetRandomShare(ip)])
random.shuffle(printerlist)
return WScriptCollection.WshCollection(sum(printerlist[:2], []))
def EnumNetworkDrives(self): # pylint:disable=unused-argument
log.ThugLogging.add_behavior_warn(
"[WScript.Network ActiveX] Got request to EnumNetworkDrives"
)
ndrives = WScriptCollection.WshCollection()
for _ in range(2):
drive = f"{chr(random.choice(range(ord('E'), ord('Z'))))}:"
ndrives.extend([drive, GetRandomShare(GetRandomIp())])
return ndrives
def GetRandomShare(location):
share = "".join(
random.choice(string.ascii_lowercase + string.digits) for _ in range(8)
)
return f"\\\\{location}\\{share}"
def GetRandomIp():
ip = "192.168."
ip += ".".join(map(str, (random.randint(0, 255) for _ in range(2))))
return ip
def GetUserDomain(self):
return WScriptShell.ExpandEnvironmentStrings(self, "%USERDOMAIN%")
def GetUserName(self):
return WScriptShell.ExpandEnvironmentStrings(self, "%USERNAME%")
def GetComputerName(self):
return WScriptShell.ExpandEnvironmentStrings(self, "%COMPUTERNAME%")
| 1,726
|
Python
|
.py
| 44
| 34.022727
| 79
| 0.701987
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,990
|
CABrightStor.py
|
buffer_thug/thug/ActiveX/modules/CABrightStor.py
|
# CA BrightStor
# CVE-NOMATCH
import logging
log = logging.getLogger("Thug")
def AddColumn(self, arg0, arg1): # pylint:disable=unused-argument
if len(arg0) > 100:
log.ThugLogging.log_exploit_event(
self._window.url, "CA BrightStor ActiveX", "Overflow in AddColumn"
)
log.ThugLogging.Shellcode.check_shellcode(arg0)
| 360
|
Python
|
.py
| 10
| 30.6
| 78
| 0.699422
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,991
|
Comodo.py
|
buffer_thug/thug/ActiveX/modules/Comodo.py
|
# Comodo AntiVirus 2.0
# CVE-NOMATCH
import logging
log = logging.getLogger("Thug")
def ExecuteStr(self, cmd, args):
log.ThugLogging.add_behavior_warn(
"[Comodo AntiVirus ActiveX] Trying to execute: " + cmd + " " + args
)
log.ThugLogging.log_exploit_event(
self._window.url,
"Comodo AntiVirus ActiveX",
"Trying to execute",
forward=False,
data={"command": cmd, "args": args},
)
| 446
|
Python
|
.py
| 15
| 24.2
| 75
| 0.639344
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,992
|
DLinkMPEG.py
|
buffer_thug/thug/ActiveX/modules/DLinkMPEG.py
|
# D-Link MPEG4 SHM Audio Control
# CVE-NOMATCH
import logging
log = logging.getLogger("Thug")
def SetUrl(self, val):
self.__dict__["Url"] = val
if len(val) > 1024:
log.ThugLogging.log_exploit_event(
self._window.url,
"D-Link MPEG4 SHM Audio Control ActiveX",
"Overflow in Url property",
)
log.ThugLogging.Shellcode.check_shellcode(val)
| 408
|
Python
|
.py
| 13
| 24.846154
| 54
| 0.634271
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,993
|
YahooMessengerYVerInfo.py
|
buffer_thug/thug/ActiveX/modules/YahooMessengerYVerInfo.py
|
# Yahoo! Messenger 8.x YVerInfo.dll ActiveX Control
# CVE-2007-4515
import logging
log = logging.getLogger("Thug")
def fvcom(self, arg0):
if len(arg0) > 20:
log.ThugLogging.log_exploit_event(
self._window.url,
"Yahoo! Messenger 8.x YVerInfo.dll ActiveX Control",
"Overflow in fvCom arg0",
cve="CVE-2007-4515",
)
log.ThugLogging.log_classifier("exploit", log.ThugLogging.url, "CVE-2007-4515")
log.ThugLogging.Shellcode.check_shellcode(arg0)
def info(self, arg0):
if len(arg0) > 20:
log.ThugLogging.log_exploit_event(
self._window.url,
"Yahoo! Messenger 8.x YVerInfo.dll ActiveX Control",
"Overflow in info arg0",
cve="CVE-2007-4515",
)
log.ThugLogging.log_classifier("exploit", log.ThugLogging.url, "CVE-2007-4515")
log.ThugLogging.Shellcode.check_shellcode(arg0)
| 939
|
Python
|
.py
| 24
| 30.791667
| 87
| 0.637266
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,994
|
XUpload.py
|
buffer_thug/thug/ActiveX/modules/XUpload.py
|
# Persists Software XUpload control, version 2.1.0.1.
# CVE-2007-6530
import logging
log = logging.getLogger("Thug")
def AddFolder(self, arg):
if len(arg) > 1024:
log.ThugLogging.log_exploit_event(
self._window.url,
"XUpload ActiveX",
"Overflow in AddFolder method",
cve="CVE-2007-6530",
)
log.ThugLogging.log_classifier("exploit", log.ThugLogging.url, "CVE-2007-6530")
log.ThugLogging.Shellcode.check_shellcode(arg)
def AddFile(self, arg):
if len(arg) > 255:
log.ThugLogging.log_exploit_event(
self._window.url,
"XUpload ActiveX",
"Overflow in AddFile method",
cve="CVE-2007-6530",
)
log.ThugLogging.log_classifier("exploit", log.ThugLogging.url, "CVE-2007-6530")
log.ThugLogging.Shellcode.check_shellcode(arg)
| 888
|
Python
|
.py
| 24
| 28.666667
| 87
| 0.629673
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,995
|
MSVFP.py
|
buffer_thug/thug/ActiveX/modules/MSVFP.py
|
# Microsoft VFP_OLE_Server
import logging
log = logging.getLogger("Thug")
def foxcommand(self, cmd):
log.ThugLogging.add_behavior_warn(
f"[Microsoft VFP_OLE_Server ActiveX] Trying to run: {cmd}"
)
log.ThugLogging.log_exploit_event(
self._window.url,
"Microsoft VFP_OLE_Server ActiveX",
"Trying to run",
data={"command": cmd},
forward=False,
)
| 411
|
Python
|
.py
| 14
| 23.5
| 66
| 0.651399
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,996
|
MSXML2DOMDocument.py
|
buffer_thug/thug/ActiveX/modules/MSXML2DOMDocument.py
|
import logging
log = logging.getLogger("Thug")
def definition(self, arg):
log.ThugLogging.log_exploit_event(
self._window.url,
"MSXML2.DOMDocument",
"Microsoft XML Core Services MSXML Uninitialized Memory Corruption",
cve="CVE-2012-1889",
) # pylint:disable=undefined-variable
log.ThugLogging.log_classifier("exploit", log.ThugLogging.url, "CVE-2012-1889")
log.ThugLogging.Shellcode.check_shellcode(arg)
| 457
|
Python
|
.py
| 11
| 35.818182
| 83
| 0.721719
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,997
|
WScriptCollection.py
|
buffer_thug/thug/ActiveX/modules/WScriptCollection.py
|
import logging
log = logging.getLogger("Thug")
class WshCollection(list):
def __getattr__(self, name):
if name.lower() == "length":
return len(self)
raise AttributeError
def Item(self, pos):
return self[pos]
| 257
|
Python
|
.py
| 9
| 22.111111
| 36
| 0.625514
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,998
|
CreativeSoftAttack.py
|
buffer_thug/thug/ActiveX/modules/CreativeSoftAttack.py
|
import logging
log = logging.getLogger("Thug")
def Setcachefolder(self, val): # pylint:disable=unused-argument
log.ThugLogging.log_exploit_event(
self._window.url, "CreativeSoft ActiveX", "Overflow in cachefolder property"
)
| 245
|
Python
|
.py
| 6
| 36.666667
| 84
| 0.75
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|
12,999
|
WScriptShortcut.py
|
buffer_thug/thug/ActiveX/modules/WScriptShortcut.py
|
import logging
log = logging.getLogger("Thug")
def save(self):
log.ThugLogging.add_behavior_warn(
f"[WScript.Shortcut ActiveX] Saving link object '{self.FullName}' with target '{self.TargetPath}'"
)
| 218
|
Python
|
.py
| 6
| 32.166667
| 106
| 0.722488
|
buffer/thug
| 978
| 204
| 0
|
GPL-2.0
|
9/5/2024, 5:11:50 PM (Europe/Amsterdam)
|