Esempio n. 1
0
    def __init__(self, url, notFoundPattern=None, cmsEnhance=False):
        self._url = url.strip()
        self._notFoundPattern = notFoundPattern
        self._cmsEnhance = cmsEnhance
        if not URL.check(self._url):
            raise PenError("Service Identify, URL format error")

        self._target = URL.format(self._url)

        self._fp = YamlConf(os.path.join(sys.path[0],"script","data","app_fingerprint.yaml"))

        # debug>>>>>>>>>>>>>>>>>>>
        name = 'Drupal'
        ddddd = self._fp['Applications'][name]
        #self._fp['Applications'] = {name:ddddd}
        # debug>>>>>>>>>>>>>>>>>>>>>

        # metaInfo 页面元信息
        # url, statusCode, headers, html, title, robots
        self._metaInfo = {}
        self._initMetaInfo()
        # result 中存储的信息
        self._result = MatchsInfo(self._fp)

        self._matchFuncs = {}
        self._initHandleFuncs()

        self._log = Log("service_identify")
Esempio n. 2
0
    def __init__(self, baseURL, notFoundPattern=None):
        baseURL = URL.getURI(baseURL)
        self.baseURL = baseURL.rstrip("/")
        self.notFoundPattern = notFoundPattern

        self.fp = YamlConf(self._fingerprintFile)

        self.log = Log("cmsidentify")
Esempio n. 3
0
    def __init__(self, types, keywords=[], exts=[], size="small", url=None):
        self.types = types

        self.keywords = keywords
        self.exts = exts if exts else ["php"]
        self.size = size

        self.dirInfo = self._loadDirInfo()
        self.log = Log("uribrute")
Esempio n. 4
0
    def __init__(self, baseURL, notFoundPattern=None):
        if not baseURL.startswith("http"):
            raise PenError(
                "CMSIdentify, baseURL format error, not startswith 'http(s)'.")
        self.baseURL = baseURL.rstrip("/")
        self.notFoundPattern = notFoundPattern

        self.fp = json.load(open(self.fingerprintFile, "r"))

        self.log = Log("cmsidentify")
Esempio n. 5
0
    def __init__(self, baseURL, notFoundPattern=None):
        '''
        @params:
            baseURL: 待识别的站点的URL
            notFoundPattern: 指定notFoundPattern,有时候website只返回301或200,这时候需要该字段来识别‘404’
        '''
        baseURL = URL.getURI(baseURL)
        self.baseURL = baseURL.rstrip("/")
        self.notFoundPattern = notFoundPattern

        self.fp = YamlConf(self._fingerprintFile)

        self.log = Log("cmsidentify")
Esempio n. 6
0
    def __init__(self, types, keywords=[], exts=[], size="small", url=None):
        '''
        @params:
            keywords: 指定关键字列表,关键字用于生成备份文件字典
            exts: 指定文件后缀列表,生成的字典文件会自动加入这些后缀
        '''
        self.types = types

        self.keywords = keywords
        self.exts = exts if exts else ["php"]
        self.size = size

        self.dirInfo = self._loadDirInfo()
        self.log = Log("uribrute")
Esempio n. 7
0
    def __init__(self, baseURL=None, stype=None, keywords=None, exts=None, notFoundPattern=None, safeURL=None, timeout=None, delay=None, encode="utf-8"):
        if baseURL:
            if not baseURL.startswith("http"):
                raise PenError("URIBruter, baseURL format error, not startswith 'http'.")
            self.baseURL = baseURL.rstrip("/")
        else:
            self.baseURL = baseURL
        self.stype = stype
        self.keywords = keywords.split() if keywords else []
        self.userdefinedExt = exts.split() if exts else []
        self.defaultExt = ["asp","aspx","php","jsp"]
        self.notFoundPattern = notFoundPattern
        self.safeURL = safeURL
        self.timeout = int(timeout) if timeout else 10
        self.delay = float(delay) if delay else 0
        self.encode = encode if encode else "utf-8"

        self.info = self._loadInfoDB()
        self.log = Log("uribrute")
Esempio n. 8
0
    def __init__(self, url, notFoundPattern=None, cmsEnhance=False):
        self._url = url.strip()
        self._notFoundPattern = notFoundPattern
        self._cmsEnhance = cmsEnhance
        if not URL.check(self._url):
            raise PenError("Service Identify, URL format error")

        self._target = URL.format(self._url)

        self._fp = YamlConf(
            os.path.join(conf['ptdpath'], "app_fingerprint.yaml"))

        # metaInfo 页面元信息
        # url, statusCode, headers, html, title, robots
        self._metaInfo = {}
        self._initMetaInfo()
        # result 中存储的信息
        self._result = MatchsInfo(self._fp)

        self._matchFuncs = {}
        self._initHandleFuncs()

        self._log = Log("service_identify")