diff --git a/config.py b/config.py index 5b19ffc..8a97223 100644 --- a/config.py +++ b/config.py @@ -3,12 +3,24 @@ # Github: https://github.com/kelvinBen/AppInfoScanner -# 此处用于搜索组件信息,如fastjson、gson等 +# 此处用于搜索组件信息 +# com.alibaba.fastjson -> fastjson +# com.google.gson -> gson +# com.fasterxml.jackson -> jackson +# net.sf.json -> +# javax.xml.parsers.DocumentBuilder -> dom方式 +# javax.xml.parsers.SAXParser -> sax方式 +# org.jdom.input.SAXBuilder -> jdom +# org.dom4j.io.SAXReader -> dom4j filter_components = [ 'com.alibaba.fastjson', 'com.google.gson', 'com.fasterxml.jackson', - 'net.sf.json' + 'net.sf.json', + 'javax.xml.parsers.DocumentBuilder', + 'javax.xml.parsers.SAXParser', + 'org.jdom.input.SAXBuilder', + 'org.dom4j.io.SAXReader' ] # 此处目前支持过滤 diff --git a/libs/task/android_task.py b/libs/task/android_task.py index 48a8706..ad6015a 100644 --- a/libs/task/android_task.py +++ b/libs/task/android_task.py @@ -105,7 +105,7 @@ class AndroidTask(object): if "." not in dir_file: continue if len(dir_file.split("."))>1: - if dir_file.split(".")[1] in file_suffix: + if dir_file.split(".")[-1] in file_suffix: self.file_queue.put(dir_file_path) for component in config.filter_components: comp = component.replace(".","/") @@ -120,10 +120,12 @@ class AndroidTask(object): dir_file_path = os.path.join(root_path,dir_file) if os.path.isdir(dir_file_path): self.__get_file_type__(dir_file_path) - else: - if dir_file.split(".")[1] == "apk": + else: + suffix_name = dir_file.split(".")[-1] + + if suffix_name == "apk": self.__decode_apk__(dir_file) - elif dir_file.split(".")[1] == "dex": + elif suffix_name == "dex": self.__decode_dex__(dir_file) else: continue diff --git a/libs/task/ios_task.py b/libs/task/ios_task.py index 2c4c477..047aaaf 100644 --- a/libs/task/ios_task.py +++ b/libs/task/ios_task.py @@ -30,7 +30,7 @@ class iOSTask(object): def start(self): # ipa 文件 - if self.path.split(".")[1] == 'ipa': + if self.path.split(".")[-1] == 'ipa': # 对ipa进行解包 self.__decode_ipa__(cores.output_path) @@ -56,7 +56,7 @@ class iOSTask(object): dir_file_path = os.path.join(scanner_dir,dir_file) if os.path.isdir(dir_file_path): if dir_file.endswith(".app"): - self.elf_file_name = dir_file.split(".")[0] + self.elf_file_name = dir_file.replace(".app","") self.__get_scanner_file__(dir_file_path,file_suffix) else: if self.elf_file_name == dir_file: @@ -65,7 +65,7 @@ class iOSTask(object): if self.no_resource: dir_file_suffix = dir_file.split(".") if len(dir_file_suffix) > 1: - if dir_file_suffix[1] in file_suffix: + if dir_file_suffix[-1] in file_suffix: self.file_queue.put(dir_file_path) def __decode_ipa__(self,output_path): diff --git a/libs/task/web_task.py b/libs/task/web_task.py index fc138ac..14884ed 100644 --- a/libs/task/web_task.py +++ b/libs/task/web_task.py @@ -38,7 +38,7 @@ class WebTask(object): self.__get_scanner_file__(self.path,scanner_file_suffix) else: - if not (self.path.split(".")[1] in scanner_file_suffix): # 内容包含进行下步处理 + if not (self.path.split(".")[-1] in scanner_file_suffix): # 内容包含进行下步处理 err_info = ("Retrieval of this file type is not supported. Select a file or directory with a suffix of %s" % ",".join(scanner_file_suffix)) raise Exception(err_info) self.file_queue.put(self.path) @@ -58,7 +58,7 @@ class WebTask(object): self.__get_scanner_file__(dir_file_path,file_suffix) else: if len(dir_file.split("."))>1: - if dir_file.split(".")[1] in file_suffix: + if dir_file.split(".")[-1] in file_suffix: self.file_queue.put(dir_file_path) def __print__(self):