本文整理汇总了Python中DOM.dom_logging方法的典型用法代码示例。如果您正苦于以下问题:Python DOM.dom_logging方法的具体用法?Python DOM.dom_logging怎么用?Python DOM.dom_logging使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DOM
的用法示例。
在下文中一共展示了DOM.dom_logging方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: open
# 需要导入模块: import DOM [as 别名]
# 或者: from DOM import dom_logging [as 别名]
def open(self, bstrMethod, bstrUrl, varAsync = True, varUser = None, varPassword = None):
DOM.dom_logging(log, "XMLHTTPRequest.open", bstrUrl)
msg = "[Microsoft XMLHTTP ActiveX] open('%s', '%s', %s" % (bstrMethod, bstrUrl, varAsync is True, )
if varUser:
msg = "%s, '%s'" % (msg, varUser, )
if varPassword:
msg = "%s, '%s'" % (msg, varPassword, )
msg = "%s)" % (msg, )
log.ThugLogging.add_behavior_warn(msg)
log.ThugLogging.log_exploit_event(self._window.url,
"Microsoft XMLHTTP ActiveX",
"Open",
forward = False,
data = {
"method" : bstrMethod,
"url" : str(bstrUrl),
"async" : str(varAsync)
}
)
self.bstrMethod = bstrMethod
self.bstrUrl = str(bstrUrl)
self.varAsync = varAsync
self.varUser = varUser
self.varPassword = varPassword
return 0
示例2: send
# 需要导入模块: import DOM [as 别名]
# 或者: from DOM import dom_logging [as 别名]
def send(self, varBody = None):
DOM.dom_logging(log, "XMLHTTPRequest.send", varBody)
msg = "send"
if varBody:
msg = "%s('%s')" % (msg, str(varBody), )
log.ThugLogging.add_behavior_warn("[Microsoft XMLHTTP ActiveX] %s" % (msg, ))
log.ThugLogging.add_behavior_warn("[Microsoft XMLHTTP ActiveX] Fetching from URL %s (method: %s)" % (self.bstrUrl, self.bstrMethod, ))
log.ThugLogging.log_exploit_event(self._window.url,
"Microsoft XMLHTTP ActiveX",
"Send",
forward = False,
data = {
"method" : self.bstrMethod,
"url" : str(self.bstrUrl)
}
)
try:
response = self._window._navigator.fetch(self.bstrUrl,
method = self.bstrMethod,
headers = self.requestHeaders,
body = varBody,
redirect_type = "Microsoft XMLHTTP Exploit")
except:
log.ThugLogging.add_behavior_warn('[Microsoft XMLHTTP ActiveX] Fetch failed')
self.responseHeaders = response.headers
self.responseBody = response.content
contenttype = self.responseHeaders.get('content-type', None)
if contenttype is None:
return
if 'text/html' in contenttype:
doc = w3c.parseString(self.responseBody)
window = DOM.Window.Window(self.bstrUrl, doc, personality = log.ThugOpts.useragent)
#window.open(self.bstrUrl)
dft = DOM.DFT.DFT(window)
dft.run()
return
handler = log.MIMEHandler.get_handler(contenttype)
if handler:
handler(url, html)