Beispiel #1
0
    def run_local(self, url):
        log.ThugLogging.set_url(url)

        html   = open(url, 'r').read()
        doc    = w3c.parseString(html)
        window = Window.Window('about:blank', doc, personality = self.useragent)
        window.open()
        self.run(window)
Beispiel #2
0
    def run_local(self, url):
        log.ThugLogging.set_url(url)
        log.ThugOpts.local = True

        html   = open(url, 'r').read()
        doc    = w3c.parseString(html)
        window = Window.Window('about:blank', doc, personality = log.ThugOpts.useragent)
        window.open()
        self.run(window)
Beispiel #3
0
    def run_local(self, url):
        log.ThugLogging.set_url(url)
        log.ThugOpts.local = True

        log.HTTPSession = HTTPSession.HTTPSession()

        html   = open(url, 'r').read()
        doc    = w3c.parseString(html)
        window = Window.Window('about:blank', doc, personality = log.ThugOpts.useragent)
        window.open()
        self.run(window)
Beispiel #4
0
    def run_remote(self, url):
        if urlparse.urlparse(url).scheme is '':
            url = 'http://%s' % (url, )

        log.ThugLogging.set_url(url)

        doc    = w3c.parseString('')
        window = Window.Window(log.ThugOpts.referer, doc, personality = log.ThugOpts.useragent)
        window = window.open(url)
        if window:
            self.run(window)
Beispiel #5
0
    def window_from_file(self, data, url, offline_content=dict(), max_len=200):
        log.ThugLogging.set_url(url)
        log.ThugOpts.local = True
        log.ThugOpts.max_len = max_len

        log.HTTPSession = HTTPSession.HTTPSession()

        doc    = w3c.parseString(data)
        window = Window.Window('about:blank', doc, personality = log.ThugOpts.useragent, offline_content=offline_content)
        window.open()
        return window
Beispiel #6
0
    def run_remote(self, url):
        scheme = urlparse.urlparse(url).scheme

        if not scheme or not scheme.startswith('http'):
            url = 'http://%s' % (url, )

        log.ThugLogging.set_url(url)

        doc    = w3c.parseString('')
        window = Window.Window(log.ThugOpts.referer, doc, personality = log.ThugOpts.useragent)
        window = window.open(url)
        if window:
            self.run(window)
Beispiel #7
0
    def window_from_file(self, data, url, offline_content=dict(), max_len=200):
        log.ThugLogging.set_url(url)
        log.ThugOpts.local = True
        log.ThugOpts.max_len = max_len

        log.HTTPSession = HTTPSession.HTTPSession()

        doc = w3c.parseString(data)
        window = Window.Window('about:blank',
                               doc,
                               personality=log.ThugOpts.useragent,
                               offline_content=offline_content)
        window.open()
        return window
Beispiel #8
0
    def run_remote(self, url):
        scheme = urlparse.urlparse(url).scheme

        if not scheme or not scheme.startswith('http'):
            url = 'http://%s' % (url, )

        log.ThugLogging.set_url(url)

        log.HTTPSession = HTTPSession.HTTPSession()

        doc    = w3c.parseString('')
        window = Window.Window(log.ThugOpts.referer, doc, personality = log.ThugOpts.useragent)
        window = window.open(url)
        if window:
            self.run(window)
Beispiel #9
0
    def run_local(self, url, max_len=200):
        log.ThugLogging.set_url(url)
        log.ThugOpts.local = True
        if not hasattr(log.ThugOpts, 'max_len'):
            log.ThugOpts.max_len = max_len

        log.HTTPSession = HTTPSession.HTTPSession()

        html = open(url, 'r').read()
        doc = w3c.parseString(html)
        window = Window.Window('about:blank',
                               doc,
                               personality=log.ThugOpts.useragent)
        window.open()
        self.run(window)
Beispiel #10
0
    def run_local(self, url):
        log.ThugLogging.set_url(url)
        log.ThugOpts.local = True

        log.HTTPSession = HTTPSession()

        content   = open(url, 'r').read()
        extension = os.path.splitext(url)

        if len(extension) > 1 and extension[1].lower() in ('.js'):
            html = tostring(E.HTML(E.BODY(E.SCRIPT(content))))
        else:
            html = content

        doc    = w3c.parseString(html)
        window = Window('about:blank', doc, personality = log.ThugOpts.useragent)
        window.open()
        self.run(window)
Beispiel #11
0
def loadXML(self, bstrXML):
    self.xml = w3c.parseString(bstrXML)
    #self.attributes = NamedNodeMap(self.xml._node)

    if "res://" not in bstrXML:
        return

    for p in bstrXML.split('"'):
        if p.startswith("res://"):
            log.ThugLogging.add_behavior_warn("[Microsoft XMLDOM ActiveX] Attempting to load %s" % (p, ))
            if any(sys.lower() in p.lower() for sys in security_sys):
                self.parseError._errorCode = 0

    for p in bstrXML.split("'"):
        if p.startswith("res://"):
            log.ThugLogging.add_behavior_warn("[Microsoft XMLDOM ActiveX] Attempting to load %s" % (p, ))
            if any(sys.lower() in p.lower() for sys in security_sys):
                self.parseError._errorCode = 0
Beispiel #12
0
    def run_local(self, url):
        log.ThugLogging.set_url(url)
        log.ThugOpts.local = True

        log.HTTPSession = HTTPSession.HTTPSession()

        content   = open(url, 'r').read()
        extension = os.path.splitext(url)

        if len(extension) > 1 and extension[1].lower() in ('.js'):
            html = tostring(E.HTML(E.BODY(E.SCRIPT(content))))
        else:
            html = content

        doc    = w3c.parseString(html)
        window = Window.Window('about:blank', doc, personality = log.ThugOpts.useragent)
        window.open()
        self.run(window)
Beispiel #13
0
def loadXML(self, bstrXML):
    self.xml = w3c.parseString(bstrXML)
    #self.attributes = NamedNodeMap(self.xml._node)

    if "res://" not in bstrXML:
        return

    for p in bstrXML.split('"'):
        if p.startswith("res://"):
            log.ThugLogging.add_behavior_warn("[Microsoft XMLDOM ActiveX] Attempting to load %s" % (p, ))
            if any(sys.lower() in p.lower() for sys in security_sys):
                self.parseError._errorCode = 0

    for p in bstrXML.split("'"):
        if p.startswith("res://"):
            log.ThugLogging.add_behavior_warn("[Microsoft XMLDOM ActiveX] Attempting to load %s" % (p, ))
            if any(sys.lower() in p.lower() for sys in security_sys):
                self.parseError._errorCode = 0
Beispiel #14
0
        <div id="foo">bar</div>
        <script type="text/javascript">
            document.write("f**k");
            //$('#foo').html('mighty!');
            $('#foo').html('mighty!');
            var hasFlash = false;
            try {
              var fo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
              if(fo) hasFlash = true;
            }catch(e){
            alert(e);
              if(navigator.mimeTypes ["application/x-shockwave-flash"] != undefined) hasFlash = true;
            }
            hasFlash;navigator.mimeTypes ["application/x-shockwave-flash"]
        </script>
        hi
    </body>
</html>
'''
log.ThugOpts.useragent = 'winxpchrome20'
doc = w3c.parseString(html)
window = Window.Window('about:blank', doc, personality=log.ThugOpts.useragent)
window = window.open('http://adf.ly/IANxN')
#window = window.open('http://streamcloud.eu/wo46kwbhow2c/Breaking.Bad.S02E11.Mandala.German.WS.DVDRiP.XviD-RSG.avi.html')

dft = DFT.DFT(window)
dft.run()
print dft
print type(window.doc)
print window.doc
Beispiel #15
0
        <div id="foo">bar</div>
        <script type="text/javascript">
            document.write("f**k");
            //$('#foo').html('mighty!');
            $('#foo').html('mighty!');
            var hasFlash = false;
            try {
              var fo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
              if(fo) hasFlash = true;
            }catch(e){
            alert(e);
              if(navigator.mimeTypes ["application/x-shockwave-flash"] != undefined) hasFlash = true;
            }
            hasFlash;navigator.mimeTypes ["application/x-shockwave-flash"]
        </script>
        hi
    </body>
</html>
'''
log.ThugOpts.useragent = 'winxpchrome20'
doc = w3c.parseString(html)
window = Window.Window('about:blank', doc, personality=log.ThugOpts.useragent)
window = window.open('http://adf.ly/IANxN')
#window = window.open('http://streamcloud.eu/wo46kwbhow2c/Breaking.Bad.S02E11.Mandala.German.WS.DVDRiP.XviD-RSG.avi.html')

dft = DFT.DFT(window)
dft.run()
print dft
print type(window.doc)
print window.doc