Пример #1
0
    def detect_domain(domain):
        dv = Sanliuling.driver_homeweb(domain)
        print "检测中..."
        dv, result = Sanliuling.detect_malicious(domain, dv)
        BaseDriver.quit_driver(dv)

        return result
Пример #2
0
    def detect_domain(domain):

        dv = BaiduDefender.driver_homeweb()
        print "检测中..."
        dv, result = BaiduDefender.detect_malicious(domain, dv)
        BaseDriver.quit_driver(dv)

        return result
Пример #3
0
    def detect_domain(domain):

        dv = TencentManager.driver_homeweb(TencentManager.start_domain)
        print "检测中..."
        dv, result = TencentManager.detect_malicious(domain, dv)
        BaseDriver.quit_driver(dv)

        return result
Пример #4
0
    def detect_domain(domain):

        dv = BaiduDefender.driver_homeweb()
        print ("%s detecting..."%domain)
        dv, result = BaiduDefender.detect_malicious(domain, dv)
        #print('return ok')#
        BaseDriver.quit_driver(dv)
        #print('quit ok')#
        return result
Пример #5
0
    def detect_domains(q, domains):

        dv = Jinshan.driver_homeweb(Jinshan.start_domain)
        for i, domain in enumerate(domains):
            dv, result = Jinshan.detect_malicious(domain, dv)
            q.put({'domain': domain, Jinshan.__name__ + "_result": result})
            print "--------------%s=>%d:start---------------" % (
                Jinshan.__name__, i + 1)
            print '{0}:{1}'.format(i + 1, domain)
            print result
            print "--------------%s=>%d:end-----------------" % (
                Jinshan.__name__, i + 1)
        q.put('quit')
        BaseDriver.quit_driver(dv)
Пример #6
0
    def driver_homeweb(domain, dv=None, i=0):

        url = TencentManager.homeweb + domain
        timeout = TencentManager.timeout
        wait_time = TencentManager.wait_time
        if dv is not None:
            BaseDriver.quit_driver(dv)
        dv = BaseDriver.init_driver(timeout)
        try:
            dv.get(url)
            time.sleep(wait_time)
        except Exception:
            return TencentManager.driver_homeweb(domain, dv=dv, i=i + 1)
        else:
            return dv
Пример #7
0
    def driver_homeweb(dv=None, i=0):

        url = BaiduDefender.homeweb
        timeout = BaiduDefender.timeout
        wait_time = BaiduDefender.wait_time
        if dv is not None:
            BaseDriver.quit_driver(dv)
        dv = BaseDriver.init_driver(timeout)  #初始化无头浏览器driver
        try:
            dv.get(url)
            time.sleep(wait_time)
        except Exception:
            return BaiduDefender.driver_homeweb(dv=dv, i=i + 1)
        else:
            return dv
Пример #8
0
    def driver_homeweb(domain, dv=None, i=0):

        url = Jinshan.homeweb + domain
        timeout = Jinshan.timeout
        if dv is not None:
            BaseDriver.quit_driver(dv)
        dv = BaseDriver.init_driver(timeout)
        try:
            dv.get(url)
            time.sleep(1)
        except Exception:
            return Jinshan.driver_homeweb(domain, dv=dv, i=i + 1)
        else:
            wait_time = Jinshan.wait_time
            time.sleep(wait_time)
            return dv
Пример #9
0
    def driver_homeweb(domain,dv=None,i=0):

        url = Sanliuling.homeweb+domain
        timeout = Sanliuling.timeout
        wait_time = Sanliuling.wait_time
        if dv is not None:
            try:
                dv.delete_all_cookies()
            except Exception:
                pass
            BaseDriver.quit_driver(dv)
        dv = BaseDriver.init_driver(timeout)
        try:
            dv.get(url)
            time.sleep(wait_time)
        except Exception:
            return Sanliuling.driver_homeweb(domain,dv=dv,i=i+1)
        else:
            return dv