How to use the webtech.utils.UpdateInBurpException function in webtech

To help you get started, we’ve selected a few webtech examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kaiiyer / webtech / webtech / database.py View on Github external
def download(webfile, dbfile, name, force=False, burp=False):
    """
    Check if outdated and download file
    """
    now = int(time.time())
    if not os.path.isfile(dbfile):
        print("{} Database file not present.".format(name))
        if burp:
            raise UpdateInBurpException()
        download_database_file(webfile, dbfile)
        # set timestamp in filename
    else:
        last_update = int(os.path.getmtime(dbfile))
        if last_update < now - 30 * DAYS or force:
            if burp:
                raise UpdateInBurpException()
            if force:
                print("Force update of {} Database file".format(name))
            else:
                print("{} Database file is older than 30 days.".format(name))
            os.remove(dbfile)
            download_database_file(webfile, dbfile)
github kaiiyer / webtech / Burp-WebTech.py View on Github external
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})

        # 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)
github kaiiyer / webtech / webtech / database.py View on Github external
def download(webfile, dbfile, name, force=False, burp=False):
    """
    Check if outdated and download file
    """
    now = int(time.time())
    if not os.path.isfile(dbfile):
        print("{} Database file not present.".format(name))
        if burp:
            raise UpdateInBurpException()
        download_database_file(webfile, dbfile)
        # set timestamp in filename
    else:
        last_update = int(os.path.getmtime(dbfile))
        if last_update < now - 30 * DAYS or force:
            if burp:
                raise UpdateInBurpException()
            if force:
                print("Force update of {} Database file".format(name))
            else:
                print("{} Database file is older than 30 days.".format(name))
            os.remove(dbfile)
            download_database_file(webfile, dbfile)