Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def main():
"""
Main function when running from command line.
"""
parser = OptionParser(prog="webtech", version="%prog {}".format(VERSION))
parser.add_option(
"-u", "--urls",
help="url(s) to scan", type="string", action="callback", callback=split_on_comma)
parser.add_option(
"--urls-file", "--ul",
help="url(s) list file to scan", type="string")
parser.add_option(
"--user-agent", "--ua",
help="use this user agent")
parser.add_option(
"--random-user-agent", "--rua", action="store_true",
help="use a random user agent", default=False)
parser.add_option(
"--database-file", "--db",
help="custom database file")
parser.add_option(
def default_user_agent():
return "webtech/{}".format(VERSION)
def registerExtenderCallbacks(self, callbacks):
self.callbacks = callbacks
self.helpers = callbacks.getHelpers()
callbacks.setExtensionName("WebTech")
self.out = callbacks.getStdout()
self.callbacks.printOutput("Sucessfully loaded WebTech {}".format(VERSION))
self.webtech = WebTech(options={'json': True})
# define all checkboxes
self.cbPassiveChecks = self.defineCheckBox("Enable Passive Scanner Checks")
self.cbActiveChecks = self.defineCheckBox("Enable Active Scanner Checks", True, False)
self.btnSave = JButton("Set as default", actionPerformed=self.saveConfig)
self.btnRestore = JButton("Restore", actionPerformed=self.restoreConfig)
self.grpConfig = JPanel()
self.grpConfig.add(self.btnSave)
self.grpConfig.add(self.btnRestore)
self.restoreConfig()
# definition of config tab
self.tab = JPanel()
layout = GroupLayout(self.tab)
def main():
"""
Main function when running from command line.
"""
parser = OptionParser(prog="webtech", version="%prog {}".format(VERSION))
parser.add_option("-s" , "--scrape" , type = "string", help = "Enter the URL to scrape")
parser.add_option(
"-u", "--urls",
help="url(s) to scan", type="string", action="callback", callback=split_on_comma)
parser.add_option(
"--urls-file", "--ul",
help="url(s) list file to scan", type="string")
parser.add_option(
"--user-agent", "--ua",
help="use this user agent")
parser.add_option(
"--random-user-agent", "--rua", action="store_true",
help="use a random user agent", default=False)
parser.add_option(
"--database-file", "--db",
help="custom database file")
def registerExtenderCallbacks(self, callbacks):
self.callbacks = callbacks
self.helpers = callbacks.getHelpers()
callbacks.setExtensionName("WebTech")
self.out = callbacks.getStdout()
self.callbacks.printOutput("Sucessfully loaded WebTech {}".format(VERSION))
try:
self.webtech = WebTech(options={'json': True})
except UpdateInBurpException as e:
#self.callbacks.printOutput(e)
for db_file in databases:
db = self.callbacks.makeHttpRequest(
'raw.githubusercontent.com', # we are hardcoding this since there isn't a nice api for that
443,
True,
self.helpers.buildHttpRequest(URL(db_file[0]))
);
db = db.tostring()
save_database_file(db[db.index("\r\n\r\n") + len("\r\n\r\n"):], db_file[1])
self.webtech = WebTech(options={'json': True})
def default_user_agent():
return "webtech/{}".format(VERSION)