本文整理汇总了Python中sflib.SpiderFoot.myPath方法的典型用法代码示例。如果您正苦于以下问题:Python SpiderFoot.myPath方法的具体用法?Python SpiderFoot.myPath怎么用?Python SpiderFoot.myPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sflib.SpiderFoot
的用法示例。
在下文中一共展示了SpiderFoot.myPath方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from sflib import SpiderFoot [as 别名]
# 或者: from sflib.SpiderFoot import myPath [as 别名]
def __init__(self, opts):
global sf
sf = SpiderFoot(opts)
# connect() will create the database file if it doesn't exist, but
# at least we can use this opportunity to ensure we have permissions to
# read and write to such a file.
dbh = sqlite3.connect(sf.myPath() + "/" + opts['__database'], timeout=10)
if dbh == None:
sf.fatal("Could not connect to internal database, and couldn't create " + \
opts['__database'])
dbh.text_factory = str
self.conn = dbh
self.dbh = dbh.cursor()
# Now we actually check to ensure the database file has the schema set
# up correctly.
try:
self.dbh.execute('SELECT COUNT(*) FROM tbl_scan_config')
except sqlite3.Error:
# .. If not set up, we set it up.
try:
self.create()
except BaseException as e:
sf.error("Tried to set up the SpiderFoot database schema, but failed: " + \
e.args[0])
return
示例2: len
# 需要导入模块: from sflib import SpiderFoot [as 别名]
# 或者: from sflib.SpiderFoot import myPath [as 别名]
'_socks6dns': "Resolve DNS through the SOCKS proxy? Has no affect when TOR is used: Will always be True.",
'_torctlport': "The port TOR is taking control commands on. This is necessary for SpiderFoot to tell TOR to re-circuit when it suspects anonymity is compromised.",
'_modulesenabled': "Modules enabled for the scan." # This is a hack to get a description for an option not actually available.
}
if __name__ == '__main__':
if len(sys.argv) > 1:
(addr, port) = sys.argv[1].split(":")
sfConfig['__webaddr'] = addr
sfConfig['__webport'] = int(port)
sf = SpiderFoot(sfConfig)
sfModules = dict()
# Go through each module in the modules directory with a .py extension
for filename in os.listdir(sf.myPath() + '/modules/'):
if filename.startswith("sfp_") and filename.endswith(".py"):
# Skip the module template and debugging modules
if filename == "sfp_template.py" or filename == 'sfp_stor_print.py':
continue
modName = filename.split('.')[0]
# Load and instantiate the module
sfModules[modName] = dict()
mod = __import__('modules.' + modName, globals(), locals(), [modName])
sfModules[modName]['object'] = getattr(mod, modName)()
sfModules[modName]['name'] = sfModules[modName]['object'].__doc__.split(":", 2)[0]
sfModules[modName]['descr'] = sfModules[modName]['object'].__doc__.split(":", 2)[1]
sfModules[modName]['provides'] = sfModules[modName]['object'].producedEvents()
sfModules[modName]['consumes'] = sfModules[modName]['object'].watchedEvents()
if hasattr(sfModules[modName]['object'], 'opts'):
示例3: len
# 需要导入模块: from sflib import SpiderFoot [as 别名]
# 或者: from sflib.SpiderFoot import myPath [as 别名]
'_socks6dns': "Resolve DNS through the SOCKS proxy? Has no affect when TOR is used: Will always be True.",
'_torctlport': "The port TOR is taking control commands on. This is necessary for SpiderFoot to tell TOR to re-circuit when it suspects anonymity is compromised.",
'_modulesenabled': "Modules enabled for the scan." # This is a hack to get a description for an option not actually available.
}
if __name__ == '__main__':
if len(sys.argv) > 1:
(addr, port) = sys.argv[1].split(":")
sfConfig['__webaddr'] = addr
sfConfig['__webport'] = int(port)
sf = SpiderFoot(sfConfig)
sfModules = dict()
# Go through each module in the modules directory with a .py extension
for filename in os.listdir(sf.myPath() + '/modules/'):
if filename.startswith("sfp_") and filename.endswith(".py"):
# Skip the module template and debugging modules
if filename == "sfp_template.py" or filename == 'sfp_stor_print.py':
continue
modName = filename.split('.')[0]
# Load and instantiate the module
sfModules[modName] = dict()
mod = __import__('modules.' + modName, globals(), locals(), [modName])
sfModules[modName]['object'] = getattr(mod, modName)()
sfModules[modName]['name'] = sfModules[modName]['object'].__doc__.split(":", 5)[0]
sfModules[modName]['cats'] = sfModules[modName]['object'].__doc__.split(":", 5)[1].split(",")
sfModules[modName]['group'] = sfModules[modName]['object'].__doc__.split(":", 5)[2]
sfModules[modName]['labels'] = sfModules[modName]['object'].__doc__.split(":", 5)[3].split(",")
sfModules[modName]['descr'] = sfModules[modName]['object'].__doc__.split(":", 5)[4]
示例4: tbl_event_types
# 需要导入模块: from sflib import SpiderFoot [as 别名]
# 或者: from sflib.SpiderFoot import myPath [as 别名]
#.........这里部分代码省略.........
"INSERT INTO tbl_event_types (event, event_descr, event_raw, event_type) VALUES ('UDP_PORT_OPEN_INFO', 'Open UDP Port Information', 0, 'DATA')",
"INSERT INTO tbl_event_types (event, event_descr, event_raw, event_type) VALUES ('URL_ADBLOCKED_EXTERNAL', 'URL (AdBlocked External)', 0, 'DESCRIPTOR')",
"INSERT INTO tbl_event_types (event, event_descr, event_raw, event_type) VALUES ('URL_ADBLOCKED_INTERNAL', 'URL (AdBlocked Internal)', 0, 'DESCRIPTOR')",
"INSERT INTO tbl_event_types (event, event_descr, event_raw, event_type) VALUES ('URL_FORM', 'URL (Form)', 0, 'DESCRIPTOR')",
"INSERT INTO tbl_event_types (event, event_descr, event_raw, event_type) VALUES ('URL_FLASH', 'URL (Uses Flash)', 0, 'DESCRIPTOR')",
"INSERT INTO tbl_event_types (event, event_descr, event_raw, event_type) VALUES ('URL_JAVASCRIPT', 'URL (Uses Javascript)', 0, 'DESCRIPTOR')",
"INSERT INTO tbl_event_types (event, event_descr, event_raw, event_type) VALUES ('URL_WEB_FRAMEWORK', 'URL (Uses a Web Framework)', 0, 'DESCRIPTOR')",
"INSERT INTO tbl_event_types (event, event_descr, event_raw, event_type) VALUES ('URL_JAVA_APPLET', 'URL (Uses Java Applet)', 0, 'DESCRIPTOR')",
"INSERT INTO tbl_event_types (event, event_descr, event_raw, event_type) VALUES ('URL_STATIC', 'URL (Purely Static)', 0, 'DESCRIPTOR')",
"INSERT INTO tbl_event_types (event, event_descr, event_raw, event_type) VALUES ('URL_PASSWORD', 'URL (Accepts Passwords)', 0, 'DESCRIPTOR')",
"INSERT INTO tbl_event_types (event, event_descr, event_raw, event_type) VALUES ('URL_UPLOAD', 'URL (Accepts Uploads)', 0, 'DESCRIPTOR')",
"INSERT INTO tbl_event_types (event, event_descr, event_raw, event_type) VALUES ('URL_FORM_HISTORIC', 'Historic URL (Form)', 0, 'DESCRIPTOR')",
"INSERT INTO tbl_event_types (event, event_descr, event_raw, event_type) VALUES ('URL_FLASH_HISTORIC', 'Historic URL (Uses Flash)', 0, 'DESCRIPTOR')",
"INSERT INTO tbl_event_types (event, event_descr, event_raw, event_type) VALUES ('URL_JAVASCRIPT_HISTORIC', 'Historic URL (Uses Javascript)', 0, 'DESCRIPTOR')",
"INSERT INTO tbl_event_types (event, event_descr, event_raw, event_type) VALUES ('URL_WEB_FRAMEWORK_HISTORIC', 'Historic URL (Uses a Web Framework)', 0, 'DESCRIPTOR')",
"INSERT INTO tbl_event_types (event, event_descr, event_raw, event_type) VALUES ('URL_JAVA_APPLET_HISTORIC', 'Historic URL (Uses Java Applet)', 0, 'DESCRIPTOR')",
"INSERT INTO tbl_event_types (event, event_descr, event_raw, event_type) VALUES ('URL_STATIC_HISTORIC', 'Historic URL (Purely Static)', 0, 'DESCRIPTOR')",
"INSERT INTO tbl_event_types (event, event_descr, event_raw, event_type) VALUES ('URL_PASSWORD_HISTORIC', 'Historic URL (Accepts Passwords)', 0, 'DESCRIPTOR')",
"INSERT INTO tbl_event_types (event, event_descr, event_raw, event_type) VALUES ('URL_UPLOAD_HISTORIC', 'Historic URL (Accepts Uploads)', 0, 'DESCRIPTOR')",
"INSERT INTO tbl_event_types (event, event_descr, event_raw, event_type) VALUES ('USERNAME', 'Username', 0, 'ENTITY')",
"INSERT INTO tbl_event_types (event, event_descr, event_raw, event_type) VALUES ('VULNERABILITY', 'Vulnerability in Public Domain', 0, 'DESCRIPTOR')",
"INSERT INTO tbl_event_types (event, event_descr, event_raw, event_type) VALUES ('WEBSERVER_BANNER', 'Web Server', 0, 'DATA')",
"INSERT INTO tbl_event_types (event, event_descr, event_raw, event_type) VALUES ('WEBSERVER_HTTPHEADERS', 'HTTP Headers', 1, 'DATA')",
"INSERT INTO tbl_event_types (event, event_descr, event_raw, event_type) VALUES ('WEBSERVER_STRANGEHEADER', 'Non-Standard HTTP Header', 0, 'DATA')",
"INSERT INTO tbl_event_types (event, event_descr, event_raw, event_type) VALUES ('WEBSERVER_TECHNOLOGY', 'Web Technology', 0, 'DESCRIPTOR')"
]
def __init__(self, opts):
self.sf = SpiderFoot(opts)
# connect() will create the database file if it doesn't exist, but
# at least we can use this opportunity to ensure we have permissions to
# read and write to such a file.
dbh = sqlite3.connect(self.sf.myPath() + "/" + opts['__database'], timeout=10)
if dbh is None:
self.sf.fatal("Could not connect to internal database, and couldn't create " + opts['__database'])
dbh.text_factory = str
self.conn = dbh
self.dbh = dbh.cursor()
# Now we actually check to ensure the database file has the schema set
# up correctly.
try:
self.dbh.execute('SELECT COUNT(*) FROM tbl_scan_config')
self.conn.create_function("REGEXP", 2, __dbregex__)
except sqlite3.Error:
# .. If not set up, we set it up.
try:
self.create()
except BaseException as e:
self.sf.error("Tried to set up the SpiderFoot database schema, but failed: " + e.args[0])
return
#
# Back-end database operations
#
# Create the back-end schema
def create(self):
try:
for qry in self.createQueries:
self.dbh.execute(qry)
self.conn.commit()
except sqlite3.Error as e:
raise BaseException("SQL error encountered when setting up database: " + e.args[0])
示例5: tbl_event_types
# 需要导入模块: from sflib import SpiderFoot [as 别名]
# 或者: from sflib.SpiderFoot import myPath [as 别名]
#.........这里部分代码省略.........
"INSERT INTO tbl_event_types (event, event_descr, event_raw) VALUES ('SEARCH_ENGINE_WEB_CONTENT', 'Search Engine''s Web Content', 1)",
"INSERT INTO tbl_event_types (event, event_descr, event_raw) VALUES ('SOCIAL_MEDIA', 'Social Media Presence', 0)",
"INSERT INTO tbl_event_types (event, event_descr, event_raw) VALUES ('SIMILARDOMAIN', 'Similar Domain', 0)",
"INSERT INTO tbl_event_types (event, event_descr, event_raw) VALUES ('SSL_CERTIFICATE_ISSUED', 'SSL Certificate - Issued to', 0)",
"INSERT INTO tbl_event_types (event, event_descr, event_raw) VALUES ('SSL_CERTIFICATE_ISSUER', 'SSL Certificate - Issued by', 0)",
"INSERT INTO tbl_event_types (event, event_descr, event_raw) VALUES ('SSL_CERTIFICATE_MISMATCH', 'SSL Certificate Host Mismatch', 0)",
"INSERT INTO tbl_event_types (event, event_descr, event_raw) VALUES ('SSL_CERTIFICATE_EXPIRED', 'SSL Certificate Expired', 0)",
"INSERT INTO tbl_event_types (event, event_descr, event_raw) VALUES ('SSL_CERTIFICATE_EXPIRING', 'SSL Certificate Expiring', 0)",
"INSERT INTO tbl_event_types (event, event_descr, event_raw) VALUES ('SSL_CERTIFICATE_RAW', 'SSL Certificate - Raw Data', 1)",
"INSERT INTO tbl_event_types (event, event_descr, event_raw) VALUES ('TARGET_WEB_CONTENT', 'Web Content', 1)",
"INSERT INTO tbl_event_types (event, event_descr, event_raw) VALUES ('TARGET_WEB_COOKIE', 'Cookies', 0)",
"INSERT INTO tbl_event_types (event, event_descr, event_raw) VALUES ('TCP_PORT_OPEN', 'Open TCP Port', 0)",
"INSERT INTO tbl_event_types (event, event_descr, event_raw) VALUES ('TCP_PORT_OPEN_BANNER', 'Open TCP Port Banner', 0)",
"INSERT INTO tbl_event_types (event, event_descr, event_raw) VALUES ('URL_FORM', 'URL (Form)', 0)",
"INSERT INTO tbl_event_types (event, event_descr, event_raw) VALUES ('URL_FLASH', 'URL (Uses Flash)', 0)",
"INSERT INTO tbl_event_types (event, event_descr, event_raw) VALUES ('URL_JAVASCRIPT', 'URL (Uses Javascript)', 0)",
"INSERT INTO tbl_event_types (event, event_descr, event_raw) VALUES ('URL_WEB_FRAMEWORK', 'URL (Uses a Web Framework)', 0)",
"INSERT INTO tbl_event_types (event, event_descr, event_raw) VALUES ('URL_JAVA_APPLET', 'URL (Uses Java applet)', 0)",
"INSERT INTO tbl_event_types (event, event_descr, event_raw) VALUES ('URL_STATIC', 'URL (Purely Static)', 0)",
"INSERT INTO tbl_event_types (event, event_descr, event_raw) VALUES ('URL_PASSWORD', 'URL (Accepts Passwords)', 0)",
"INSERT INTO tbl_event_types (event, event_descr, event_raw) VALUES ('URL_UPLOAD', 'URL (Accepts Uploads)', 0)",
"INSERT INTO tbl_event_types (event, event_descr, event_raw) VALUES ('WEBSERVER_BANNER', 'Web Server', 0)",
"INSERT INTO tbl_event_types (event, event_descr, event_raw) VALUES ('WEBSERVER_HTTPHEADERS', 'HTTP Headers', 1)",
"INSERT INTO tbl_event_types (event, event_descr, event_raw) VALUES ('WEBSERVER_STRANGEHEADER', 'Non-Standard HTTP Header', 0)",
"INSERT INTO tbl_event_types (event, event_descr, event_raw) VALUES ('WEBSERVER_TECHNOLOGY', 'Web Technology', 0)"
]
def __init__(self, opts):
self.sf = SpiderFoot(opts)
# connect() will create the database file if it doesn't exist, but
# at least we can use this opportunity to ensure we have permissions to
# read and write to such a file.
dbh = sqlite3.connect(self.sf.myPath() + "/" + opts['__database'], timeout=10)
if dbh == None:
self.sf.fatal("Could not connect to internal database, and couldn't create " + \
opts['__database'])
dbh.text_factory = str
self.conn = dbh
self.dbh = dbh.cursor()
# Now we actually check to ensure the database file has the schema set
# up correctly.
try:
self.dbh.execute('SELECT COUNT(*) FROM tbl_scan_config')
self.conn.create_function("REGEXP", 2, __dbregex__)
except sqlite3.Error:
# .. If not set up, we set it up.
try:
self.create()
except BaseException as e:
self.sf.error("Tried to set up the SpiderFoot database schema, but failed: " + \
e.args[0])
return
#
# Back-end database operations
#
# Create the back-end schema
def create(self):
try:
for qry in self.createQueries:
self.dbh.execute(qry)
self.conn.commit()
示例6: index
# 需要导入模块: from sflib import SpiderFoot [as 别名]
# 或者: from sflib.SpiderFoot import myPath [as 别名]
def index(self):
sf = SpiderFoot(self.config)
# Look for referenced templates in the current directory only
templ = Template(filename='dyn/setup.tmpl', lookup=self.lookup)
return templ.render(stage=1, config=self.config, path=os.path.dirname(sf.myPath()))