本文整理汇总了Python中androguard.core.analysis.analysis.uVMAnalysis方法的典型用法代码示例。如果您正苦于以下问题:Python analysis.uVMAnalysis方法的具体用法?Python analysis.uVMAnalysis怎么用?Python analysis.uVMAnalysis使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类androguard.core.analysis.analysis
的用法示例。
在下文中一共展示了analysis.uVMAnalysis方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run_bowser
# 需要导入模块: from androguard.core.analysis import analysis [as 别名]
# 或者: from androguard.core.analysis.analysis import uVMAnalysis [as 别名]
def run_bowser(self):
"""
Run the bowser toolkit
"""
# Search for parseUri()
#
x = analysis.uVMAnalysis(self.apks.get_vm())
if x:
print(t.green("[{0}] ".format(datetime.now()) +
t.yellow("Searching for parseUri()")))
analysis.show_Paths(self.apks, x.get_tainted_packages().search_methods(".", "parseUri", "."))
print(t.green("[{0}] ".format(datetime.now()) +
t.yellow("Searching for loadUrl()")))
analysis.show_Paths(self.apks, x.get_tainted_packages().search_methods(".", "loadUrl", "."))
print(t.green("[{0}] ".format(datetime.now()) +
t.yellow("Searching for addJavascriptInterface()")))
analysis.show_Paths(self.apks, x.get_tainted_packages().search_methods(".", "addJavascriptInterface", "."))
示例2: __init__
# 需要导入模块: from androguard.core.analysis import analysis [as 别名]
# 或者: from androguard.core.analysis.analysis import uVMAnalysis [as 别名]
def __init__(self, name):
vm = auto_vm(name)
if vm is None:
raise ValueError('Format not recognised: %s' % name)
self.vma = analysis.uVMAnalysis(vm)
self.classes = dict((dvclass.get_name(), dvclass)
for dvclass in vm.get_classes())
#util.merge_inner(self.classes)
示例3: analyze
# 需要导入模块: from androguard.core.analysis import analysis [as 别名]
# 或者: from androguard.core.analysis.analysis import uVMAnalysis [as 别名]
def analyze(self):
self.__a = analysis.uVMAnalysis( self.__bc )
self.__bc.set_vmanalysis( self.__a )
self.__g = ganalysis.GVMAnalysis( self.__a, None )
self.__bc.set_gvmanalysis( self.__g )
self.__bc.create_xref()
self.__bc.create_dref()
示例4: with_apk
# 需要导入模块: from androguard.core.analysis import analysis [as 别名]
# 或者: from androguard.core.analysis.analysis import uVMAnalysis [as 别名]
def with_apk(self, apk_file):
if apk_file.is_valid_APK():
d = dvm.DalvikVMFormat( apk_file.get_dex() )
dx = analysis.uVMAnalysis( d )
return self.with_apk_direct(apk_file, d, dx)
return {}
示例5: with_dex
# 需要导入模块: from androguard.core.analysis import analysis [as 别名]
# 或者: from androguard.core.analysis.analysis import uVMAnalysis [as 别名]
def with_dex(self, dex_file):
"""
@param dex_file : a buffer
@rtype : return the risk of the dex file (from 0.0 to 100.0)
"""
d = dvm.DalvikVMFormat( dex_file )
dx = analysis.uVMAnalysis( d )
return self.with_dex_direct(d, dx)
示例6: create_adex
# 需要导入模块: from androguard.core.analysis import analysis [as 别名]
# 或者: from androguard.core.analysis.analysis import uVMAnalysis [as 别名]
def create_adex(self, log, dexobj):
"""
This method is called in order to create a VMAnalysis object
:param log: an object which corresponds to a unique app
:param dexobj: a :class:`DalvikVMFormat` object
:rytpe: a :class:`VMAnalysis` object
"""
return analysis.uVMAnalysis(dexobj)
示例7: analyze
# 需要导入模块: from androguard.core.analysis import analysis [as 别名]
# 或者: from androguard.core.analysis.analysis import uVMAnalysis [as 别名]
def analyze(self) :
self.__a = analysis.uVMAnalysis( self.__bc )
self.__bc.set_vmanalysis( self.__a )
示例8: __init__
# 需要导入模块: from androguard.core.analysis import analysis [as 别名]
# 或者: from androguard.core.analysis.analysis import uVMAnalysis [as 别名]
def __init__(self, name):
vm = auto_vm(name)
self.vma = analysis.uVMAnalysis(vm)
self.classes = dict((dvclass.get_name(), dvclass)
for dvclass in vm.get_classes())
#util.merge_inner(self.classes)
示例9: analyze
# 需要导入模块: from androguard.core.analysis import analysis [as 别名]
# 或者: from androguard.core.analysis.analysis import uVMAnalysis [as 别名]
def analyze(self) :
self.__a = analysis.uVMAnalysis( self.__bc )
self.__bc.set_vmanalysis( self.__a )
self.__g = ganalysis.GVMAnalysis( self.__a, None )
self.__bc.set_gvmanalysis( self.__g )
self.__bc.create_xref()
self.__bc.create_dref()
示例10: with_apk
# 需要导入模块: from androguard.core.analysis import analysis [as 别名]
# 或者: from androguard.core.analysis.analysis import uVMAnalysis [as 别名]
def with_apk(self, apk_file) :
if apk_file.is_valid_APK() :
d = dvm.DalvikVMFormat( apk_file.get_dex() )
dx = analysis.uVMAnalysis( d )
return self.with_apk_direct(apk_file, d, dx)
return {}
示例11: with_dex
# 需要导入模块: from androguard.core.analysis import analysis [as 别名]
# 或者: from androguard.core.analysis.analysis import uVMAnalysis [as 别名]
def with_dex(self, dex_file) :
"""
@param dex_file : a buffer
@rtype : return the risk of the dex file (from 0.0 to 100.0)
"""
d = dvm.DalvikVMFormat( dex_file )
dx = analysis.uVMAnalysis( d )
return self.with_dex_direct(d, dx)
示例12: run
# 需要导入模块: from androguard.core.analysis import analysis [as 别名]
# 或者: from androguard.core.analysis.analysis import uVMAnalysis [as 别名]
def run(self):
"""
Search for crypto API usage within target class and methods
"""
x = analysis.uVMAnalysis(self.apks.get_vm())
vm = self.apks.get_vm()
if x:
print(t.green("[{0}] ".format(datetime.now()) + t.yellow("Performing surgery ...")))
# Get enum values
#
for a, b in self.enum.values.items():
for c in b:
paths = x.get_tainted_packages().search_methods("{0}".format(a), "{0}".format(c), ".")
if paths:
for p in paths:
for method in self.apks.get_methods():
if method.get_name() == p.get_src(vm.get_class_manager())[1]:
if method.get_class_name() == p.get_src(vm.get_class_manager())[0]:
print(t.green("[{0}] ".format(datetime.now()) +
t.yellow("Found: ") +
"{0}".format(c)))
print(t.green("[{0}] ".format(datetime.now()) +
t.yellow("Class: ") +
"{0}".format(method.get_class_name())))
print(t.green("[{0}] ".format(datetime.now()) +
t.yellow("Method: ") +
"{0}".format(method.get_name())))
print(method.show())
示例13: run
# 需要导入模块: from androguard.core.analysis import analysis [as 别名]
# 或者: from androguard.core.analysis.analysis import uVMAnalysis [as 别名]
def run(self):
"""
Search for storage API usage within target class and methods
"""
x = analysis.uVMAnalysis(self.apks.get_vm())
vm = self.apks.get_vm()
if x:
print(t.green("[{0}] ".format(datetime.now()) + t.yellow("Performing surgery ...")))
# Get enum values
#
for v in self.enum.values:
# This returns PathP
# objects into a list
#
paths = x.get_tainted_packages().search_methods("android.content.Context", "{0}".format(v), ".")
if paths:
for p in paths:
for method in self.apks.get_methods():
if method.get_name() == p.get_src(vm.get_class_manager())[1]:
if method.get_class_name() == p.get_src(vm.get_class_manager())[0]:
print(t.green("[{0}] ".format(datetime.now()) +
t.yellow("Found: ") +
"{0}".format(v)))
print(t.green("[{0}] ".format(datetime.now()) +
t.yellow("Class: ") +
"{0}".format(method.get_class_name())))
print(t.green("[{0}] ".format(datetime.now()) +
t.yellow("Method: ") +
"{0}".format(method.get_name())))
print(method.show())
示例14: run
# 需要导入模块: from androguard.core.analysis import analysis [as 别名]
# 或者: from androguard.core.analysis.analysis import uVMAnalysis [as 别名]
def run(self):
"""
Search for logging API usage within target class and methods
"""
x = analysis.uVMAnalysis(self.apks.get_vm())
vm = self.apks.get_vm()
if x:
print(t.green("[{0}] ".format(datetime.now()) + t.yellow("Performing surgery ...")))
# Get enum values
#
for a, b in self.enum.values.items():
for c in b:
paths = x.get_tainted_packages().search_methods("{0}".format(a), "{0}".format(c), ".")
if paths:
for p in paths:
for method in self.apks.get_methods():
if method.get_name() == p.get_src(vm.get_class_manager())[1]:
if method.get_class_name() == p.get_src(vm.get_class_manager())[0]:
print(t.green("[{0}] ".format(datetime.now()) +
t.yellow("Found: ") +
"{0}".format(c)))
print(t.green("[{0}] ".format(datetime.now()) +
t.yellow("Class: ") +
"{0}".format(method.get_class_name())))
print(t.green("[{0}] ".format(datetime.now()) +
t.yellow("Method: ") +
"{0}".format(method.get_name())))
print(method.show())
示例15: run_find_mapping
# 需要导入模块: from androguard.core.analysis import analysis [as 别名]
# 或者: from androguard.core.analysis.analysis import uVMAnalysis [as 别名]
def run_find_mapping(self):
"""
Map permissions to API calls with the analyzed
bytecode
"""
# APIMappings enum
# structure
#
enums = APIMappings()
# VM analysis
# object
#
x = analysis.uVMAnalysis(self.apks.get_vm())
for permission in self.apk.get_permissions():
for a, b in enums.mappings.items():
for c, d in b.items():
if "permission" in c:
if permission == d:
print(t.green("[{0}] ".format(datetime.now()) +
t.yellow("Found permission mapping : ") +
permission))
if b.get("class"):
for e, f in b.get("class").items():
print(t.green("[{0}] ".format(datetime.now()) +
t.yellow("Searching for : ") +
e))
if f.get("method"):
self.run_search_method(self.apks, x, e, f.get("method"))
elif f.get("methods"):
for method in f.get("methods"):
self.run_search_method(self.apks, x, e, method)
elif b.get("classes"):
for g, h in b.get("classes").items():
print(t.green("[{0}] ".format(datetime.now()) +
t.yellow("Searching for : ") +
g))
if h.get("method"):
self.run_search_method(self.apks, x, g, h.get("method"))
elif h.get("methods"):
for method in h.get("methods"):
self.run_search_method(self.apks, x, g, method)