本文整理汇总了Python中volatility.commands.Command方法的典型用法代码示例。如果您正苦于以下问题:Python commands.Command方法的具体用法?Python commands.Command怎么用?Python commands.Command使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类volatility.commands
的用法示例。
在下文中一共展示了commands.Command方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: print_info
# 需要导入模块: from volatility import commands [as 别名]
# 或者: from volatility.commands import Command [as 别名]
def print_info():
""" Returns the results """
categories = {addrspace.BaseAddressSpace: 'Address Spaces',
commands.Command : 'Plugins',
obj.Profile: 'Profiles',
scan.ScannerCheck: 'Scanner Checks'}
for c, n in sorted(categories.items()):
lower = (c == commands.Command)
plugins = registry.get_plugin_classes(c, lower = lower)
print "\n"
print "{0}".format(n)
print "-" * len(n)
result = []
max_length = 0
for clsname, cls in sorted(plugins.items()):
try:
doc = cls.__doc__.strip().splitlines()[0]
except AttributeError:
doc = 'No docs'
result.append((clsname, doc))
max_length = max(len(clsname), max_length)
for (name, doc) in result:
print "{0:{2}} - {1:15}".format(name, doc, max_length)
示例2: __init__
# 需要导入模块: from volatility import commands [as 别名]
# 或者: from volatility.commands import Command [as 别名]
def __init__(self, config, *args, **kwargs):
commands.Command.__init__(self, config, *args, **kwargs)
self._config.add_option('BIN', short_option = 'B', default = None, help = 'Filename for the dumped chain', action = 'store', type = 'str')
self._config.add_option('MODE', short_option = 'm', default = 'x64', help = 'Modes: x86 and x64', action = 'store', type = 'str')
self._config.add_option('IJSON', short_option = 'i', default = None, help = 'JSON Trace Input file', action = 'store', type = 'str')
self._config.add_option('GLIMIT', short_option = 'G', default = None, help = 'Gadget Limit Number', action = 'store', type = 'int')
self._config.add_option('CLEAN', short_option = 'C', dest="clean", default = False, action="store_true", help="Clean /tmp files")
self._config.add_option('DB', short_option = 'D', default = None, action="store", help="Filename for the opcode DB", type = 'str')
self._config.add_option('SGADGET', short_option = 'S', default = -1, action="store", help="Starting gadget for emulation", type = 'int')
self._config.add_option('IDB', short_option = 'I', default = None, action="store", help="Input opcodes DB", type = 'str')
self.dump_fd = 0
self.gid = 0
self.md = None
self.WHITELIST_INSTRUCTIONS = ['mov', 'pop', 'add', 'sub', 'xor', 'pushf']
self.BLACKLIST_INSTRUCTIONS = ['ret', 'call', 'leave']
self.GREYLIST_INSTRUCTIONS = []
self.trace = OrderedDict()
self.opcodes_db = OrderedDict()
self.NASM = '/usr/bin/nasm'
self.branch = [X86_GRP_JUMP, X86_GRP_INT, X86_GRP_CALL, X86_GRP_RET, X86_GRP_IRET, X86_GRP_VM]
示例3: list_plugins
# 需要导入模块: from volatility import commands [as 别名]
# 或者: from volatility.commands import Command [as 别名]
def list_plugins(self):
"""
list of plugins valid for the selected profile
:return:
"""
plugin_list = []
cmds = registry.get_plugin_classes(commands.Command, lower=True)
profs = registry.get_plugin_classes(obj.Profile)
profile_type = self.config.PROFILE
if profile_type not in profs:
print "Not a valid profile"
profile = profs[profile_type]()
for cmdname in sorted(cmds):
command = cmds[cmdname]
helpline = command.help() or ''
if command.is_valid_profile(profile):
plugin_list.append([cmdname, helpline])
return plugin_list
示例4: __init__
# 需要导入模块: from volatility import commands [as 别名]
# 或者: from volatility.commands import Command [as 别名]
def __init__(self, config, *args, **kwargs):
commands.Command.__init__(self, config, *args, **kwargs)
config.add_option('XML-INPUT', short_option = 'x',
help = 'Input XML file for patching binaries')
示例5: __init__
# 需要导入模块: from volatility import commands [as 别名]
# 或者: from volatility.commands import Command [as 别名]
def __init__(self, *args, **kwargs):
self.addr_space = None
self.known_addrs = {}
self.known_fops = {}
commands.Command.__init__(self, *args, **kwargs)
示例6: execute
# 需要导入模块: from volatility import commands [as 别名]
# 或者: from volatility.commands import Command [as 别名]
def execute(self, *args, **kwargs):
commands.Command.execute(self, *args, **kwargs)
示例7: __init__
# 需要导入模块: from volatility import commands [as 别名]
# 或者: from volatility.commands import Command [as 别名]
def __init__(self, *args, **kwargs):
self.addr_space = None
commands.Command.__init__(self, *args, **kwargs)
示例8: __init__
# 需要导入模块: from volatility import commands [as 别名]
# 或者: from volatility.commands import Command [as 别名]
def __init__(self, *args, **kwargs):
commands.Command.__init__(self, *args, **kwargs)
self._config.add_option("BLOCKSIZE", short_option = "b", default = 1024 * 1024 * 5,
help = "Size (in bytes) of blocks to copy",
action = 'store', type = 'int')
self._config.add_option("OUTPUT-IMAGE", short_option = "O", default = None,
help = "Writes a raw DD image out to OUTPUT-IMAGE",
action = 'store', type = 'str')
self._config.add_option("COUNT", short_option = "c", default = False,
help = "Show status of copy in byte count",
action = 'store_true')
示例9: list_plugins
# 需要导入模块: from volatility import commands [as 别名]
# 或者: from volatility.commands import Command [as 别名]
def list_plugins():
result = "\n\tSupported Plugin Commands:\n\n"
cmds = registry.get_plugin_classes(commands.Command, lower = True)
profs = registry.get_plugin_classes(obj.Profile)
if config.PROFILE == None:
config.update("PROFILE", "WinXPSP2x86")
if config.PROFILE not in profs:
raise BaseException("Invalid profile " + config.PROFILE + " selected")
profile = profs[config.PROFILE]()
wrongprofile = ""
for cmdname in sorted(cmds):
command = cmds[cmdname]
helpline = command.help() or ''
## Just put the title line (First non empty line) in this
## abbreviated display
for line in helpline.splitlines():
if line:
helpline = line
break
if command.is_valid_profile(profile):
result += "\t\t{0:15}\t{1}\n".format(cmdname, helpline)
else:
wrongprofile += "\t\t{0:15}\t{1}\n".format(cmdname, helpline)
if wrongprofile and config.VERBOSE:
result += "\n\tPlugins requiring a different profile:\n\n"
result += wrongprofile
return result
示例10: get_config
# 需要导入模块: from volatility import commands [as 别名]
# 或者: from volatility.commands import Command [as 别名]
def get_config(profile, target_path):
config = conf.ConfObject()
registry.register_global_options(config, commands.Command)
registry.register_global_options(config, addrspace.BaseAddressSpace)
config.parse_options()
config.PROFILE = profile
config.LOCATION = "file://{0}".format(target_path)
return config
示例11: __init__
# 需要导入模块: from volatility import commands [as 别名]
# 或者: from volatility.commands import Command [as 别名]
def __init__(self, *args, **kwargs):
self.addr_space = None
self.known_addrs = {}
commands.Command.__init__(self, *args, **kwargs)
示例12: __init__
# 需要导入模块: from volatility import commands [as 别名]
# 或者: from volatility.commands import Command [as 别名]
def __init__(self, *args, **kwargs):
commands.Command.__init__(self, *args, **kwargs)
self._config.add_option("BLOCKSIZE", short_option = "b", default = 1024 * 1024 * 5,
help = "Size (in bytes) of blocks to copy",
action = 'store', type = 'int')
self._config.add_option("OUTPUT-IMAGE", short_option = "O", default = None,
help = "Writes a raw DD image out to OUTPUT-IMAGE",
action = 'store', type = 'str')