本文整理汇总了Python中w3af.core.data.options.opt_factory.opt_factory函数的典型用法代码示例。如果您正苦于以下问题:Python opt_factory函数的具体用法?Python opt_factory怎么用?Python opt_factory使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了opt_factory函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_options
def get_options(self):
"""
:return: A list of option objects for this plugin.
"""
ol = OptionList()
d = 'Wordlist to use in directory bruteforcing process.'
o = opt_factory('dir_wordlist', self._dir_list, d, INPUT_FILE)
ol.add(o)
d = 'Wordlist to use in file bruteforcing process.'
o = opt_factory('file_wordlist', self._file_list, d, INPUT_FILE)
ol.add(o)
d = 'If set to True, this plugin will bruteforce directories.'
o = opt_factory('bf_directories', self._bf_directories, d, BOOL)
ol.add(o)
d = 'If set to True, this plugin will bruteforce files.'
o = opt_factory('bf_files', self._bf_files, d, BOOL)
ol.add(o)
d = 'If set to True, this plugin will bruteforce all directories, not'\
' only the root directory.'
h = 'WARNING: Enabling this will make the plugin send tens of thousands'\
' of requests.'
o = opt_factory('be_recursive', self._be_recursive, d, BOOL, help=h)
ol.add(o)
return ol
示例2: get_options
def get_options(self):
"""
:return: A list of option objects for this plugin.
"""
ol = OptionList()
d = 'IP address that the webserver will use to receive requests'
h = 'w3af runs a webserver to serve the files to the target web'\
' application when doing remote file inclusions. This setting'\
' configures where the webserver is going to listen for requests.'
o = opt_factory('listen_address', self._listen_address, d, STRING, help=h)
ol.add(o)
d = 'TCP port that the webserver will use to receive requests'
o = opt_factory('listen_port', self._listen_port, d, PORT)
ol.add(o)
d = 'Use w3af site to test for remote file inclusion'
h = 'The plugin can use the w3af site to test for remote file'\
' inclusions, which is convenient when you are performing a test'\
' behind a NAT firewall.'
o = opt_factory('use_w3af_site', self._use_w3af_site, d, BOOL, help=h)
ol.add(o)
return ol
示例3: get_options
def get_options(self):
"""
:return: A list of option objects for this plugin.
"""
ol = OptionList()
d = 'When comparing, also compare the content of files.'
o = opt_factory('content', self._content, d, BOOL)
ol.add(o)
d = 'The local directory used in the comparison.'
o = opt_factory('local_dir', self._local_dir, d, STRING)
ol.add(o)
d = 'The remote directory used in the comparison.'
o = opt_factory(
'remote_url_path', self._remote_url_path, d, URL_OPTION_TYPE)
ol.add(o)
d = 'When comparing content of two files, ignore files with these'\
'extensions.'
o = opt_factory('banned_ext', self._ban_url, d, LIST)
ol.add(o)
return ol
示例4: get_options
def get_options(self):
"""
:return: A list of option objects for this plugin.
"""
ol = OptionList()
d = 'Stream edition expressions'
h = ('Stream edition expressions are strings that tell the sed plugin'
' which transformations to apply to the HTTP requests and'
' responses. The sed plugin uses regular expressions, some'
' examples:\n'
'\n'
' - qh/User/NotLuser/\n'
' This will make sed search in the the re[q]uest [h]eader'
' for the string User and replace it with NotLuser.\n'
'\n'
' - sb/[fF]orm/form\n'
' This will make sed search in the re[s]ponse [b]ody for'\
' the strings form or Form and replace it with form.\n'
'\n'
'Multiple expressions can be specified separated by commas.')
o = opt_factory('expressions', self._expressions, d, 'list', help=h)
ol.add(o)
d = 'Fix the content length header after mangling'
o = opt_factory('fix_content_len', self._user_option_fix_content_len,
d, 'boolean')
ol.add(o)
return ol
示例5: test_invalid_data
def test_invalid_data(self):
input_file = os.path.join(ROOT_PATH, "core", "data", "foobar", "does-not-exist.txt")
output_file = input_file
data = {
BOOL: ["rucula"],
INT: ["0x32"],
POSITIVE_INT: ["-1"],
FLOAT: ["1x2"],
URL: ["http://", "/", ""],
URL_LIST: ["http://moth/1 , http://moth:333333"],
IPPORT: ["127.0.0.1"],
IP: ["127.0.0.", "127.0.0", "3847398740"],
REGEX: [".*("],
INPUT_FILE: [input_file],
OUTPUT_FILE: [output_file],
PORT: ["65536"],
}
for _type in data:
for fake_value in data[_type]:
err = "%s for an option of type %s should raise an exception."
try:
opt_factory("name", fake_value, "desc", _type)
except BaseFrameworkException:
self.assertTrue(True)
else:
self.assertTrue(False, err % (fake_value, _type))
示例6: get_options
def get_options(self):
"""
:return: A list of option objects for this plugin.
"""
ol = OptionList()
targets = ','.join(str(tar) for tar in cf.cf.get('targets'))
d = 'A comma separated list of URLs'
o = opt_factory('target', targets, d, 'url_list')
ol.add(o)
d = 'Target operating system (' + '/'.join(
self._operating_systems) + ')'
h = 'This setting is here to enhance w3af performance.'
# This list "hack" has to be done because the default value is the one
# in the first position on the list
tmp_list = self._operating_systems[:]
tmp_list.remove(cf.cf.get('target_os'))
tmp_list.insert(0, cf.cf.get('target_os'))
o = opt_factory('target_os', tmp_list, d, 'combo', help=h)
ol.add(o)
d = 'Target programming framework (' + '/'.join(
self._programming_frameworks) + ')'
h = 'This setting is here to enhance w3af performance.'
# This list "hack" has to be done because the default value is the one
# in the first position on the list
tmp_list = self._programming_frameworks[:]
tmp_list.remove(cf.cf.get('target_framework'))
tmp_list.insert(0, cf.cf.get('target_framework'))
o = opt_factory('target_framework', tmp_list, d, 'combo', help=h)
ol.add(o)
return ol
示例7: get_options
def get_options(self):
"""
:return: A list of option objects for this plugin.
"""
ol = OptionList()
d = 'IP address that the webserver will use to receive requests'
h = 'w3af runs a webserver to serve the files to the target web app'\
' when doing remote file inclusions. This setting configures on'\
' what IP address the webserver is going to listen.'
o = opt_factory('listen_address', self._listen_address, d, 'ip', help=h)
ol.add(o)
d = 'Port that the webserver will use to receive requests'
h = 'w3af runs a webserver to serve the files to the target web app'\
' when doing remote file inclusions. This setting configures on'\
' what IP address the webserver is going to listen.'
o = opt_factory('listen_port', self._listen_port, d, 'port', help=h)
ol.add(o)
d = 'Instead of including a file in a local webserver; include the '\
' result of exploiting a XSS bug within the same target site.'
o = opt_factory('use_xss_bug', self._use_XSS_vuln, d, 'boolean')
ol.add(o)
return ol
示例8: test_invalid_data
def test_invalid_data(self):
input_file = os.path.join(ROOT_PATH, 'core', 'data', 'foobar',
'does-not-exist.txt')
output_file = input_file
data = {BOOL: ['rucula'],
INT: ['0x32'],
POSITIVE_INT: ['-1'],
FLOAT: ['1x2'],
URL: ['http://', '/', ''],
URL_LIST: ['http://moth/1 , http://moth:333333'],
IPPORT: ['127.0.0.1'],
IP: ['127.0.0.', '127.0.0', '3847398740'],
REGEX: ['.*('],
INPUT_FILE: [input_file, '/', 'base64://'],
OUTPUT_FILE: [output_file, '/'],
PORT: ['65536']
}
for _type in data:
for fake_value in data[_type]:
err = '%s for an option of type %s should raise an exception.'
try:
opt_factory('name', fake_value, 'desc', _type)
except BaseFrameworkException:
self.assertTrue(True)
else:
self.assertTrue(False, err % (fake_value, _type))
示例9: get_options
def get_options(self):
ol = super(LocalFileReadTemplate, self).get_options()
d = 'Payload used to detect the vulnerability (i.e. ../../etc/passwd)'
o = opt_factory('payload', self.payload, d, 'string')
ol.add(o)
d = 'File pattern used to detect the vulnerability (i.e. root:x:0:0:)'
o = opt_factory('file_pattern', self.file_pattern, d, 'string')
ol.add(o)
return ol
示例10: get_options
def get_options(self):
ol = super(OSCommandingTemplate, self).get_options()
d = 'Command separator used for injecting commands. Usually one of'\
'&, |, &&, || or ; .'
o = opt_factory('separator', self.separator, d, 'string')
ol.add(o)
d = 'Remote operating system (linux or windows).'
o = opt_factory('operating_system', self.operating_system, d, 'string')
ol.add(o)
return ol
示例11: get_options
def get_options(self):
opt_lst = super(FileUploadTemplate, self).get_options()
d = 'Comma separated list of variable names of type "file"'
o = opt_factory('file_vars', self.file_vars, d, 'list')
opt_lst.add(o)
d = 'URL for the directory where the file is stored on the remote'\
' server after the POST that uploads it.'
o = opt_factory('file_dest', self.file_dest, d, 'url')
opt_lst.add(o)
return opt_lst
示例12: get_options
def get_options(self):
"""
:return: A list of option objects for this plugin.
"""
ol = OptionList()
d1 = 'Destination http port number to analize'
o1 = opt_factory('httpPort', self._http_port, d1, INT, help=d1)
ol.add(o1)
d2 = 'Destination httpS port number to analize'
o2 = opt_factory('httpsPort', self._https_port, d2, INT, help=d2)
ol.add(o2)
return ol
示例13: get_options
def get_options(self):
"""
:return: A list of option objects for this plugin.
"""
ol = OptionList()
d = 'Enables verbose output for the console'
o = opt_factory('verbose', self.verbose, d, BOOL)
ol.add(o)
d = 'Enable output coloring'
o = opt_factory('use_colors', self.use_colors, d, BOOL)
ol.add(o)
return ol
示例14: get_options
def get_options(self):
"""
:return: A list of option objects for this plugin.
"""
ol = OptionList()
d = 'IP address that the spider_man proxy will use to receive requests'
o = opt_factory('listen_address', self._listen_address, d, 'string')
ol.add(o)
d = 'Port that the spider_man HTTP proxy server will use to receive requests'
o = opt_factory('listen_port', self._listen_port, d, 'integer')
ol.add(o)
return ol
示例15: get_options
def get_options(self):
"""
:return: A list of option objects for this plugin.
"""
ol = OptionList()
d = 'Wordlist to use in the manifest file name bruteforcing process.'
o = opt_factory('wordlist', self._wordlist, d, 'string')
ol.add(o)
d = 'File extensions to use when brute forcing Gears Manifest files'
o = opt_factory('manifestExtensions', self._extensions, d, 'list')
ol.add(o)
return ol