示例#1
0
    def scan_action(cls, params):
        """
        URL scan action
        :param dict params: console input args
        :raise SrcError
        :return: None
        """

        try:

            if 'wizard' in params:
                tpl.info(key='load_wizard', config=params['wizard'])
                params = package.wizard(params['wizard'])
            brows = browser(params)
            if True is reporter.is_reported(params.get('host')):
                try:
                    tpl.prompt(key='logged')
                except KeyboardInterrupt:
                    tpl.cancel(key='abort')

            if reporter.default is params.get('reports'):
                tpl.info(key='use_reports')

            brows.ping()
            brows.scan()
            brows.done()

        except (AttributeError, BrowserError, ReporterError,
                TplError) as error:
            raise SrcError(error)
        except (KeyboardInterrupt, SystemExit):
            tpl.cancel(key='abort')
示例#2
0
    def scan_action(cls, params):
        """
        URL scan action
        :param dict params: console input args
        :raise SrcError
        :return: None
        """

        try:

            if 'wizard' in params:
                tpl.info(key='load_wizard', config=params['wizard'])
                params = package.wizard(params['wizard'])
            brows = browser(params)
            if True is reporter.is_reported(params.get('host')):
                try:
                    tpl.prompt(key='logged')
                except KeyboardInterrupt:
                    tpl.cancel(key='abort')

            if reporter.default is params.get('reports'):
                tpl.info(key='use_reports')

            brows.ping()
            brows.scan()
            brows.done()

        except (AttributeError, BrowserError, ReporterError, TplError) as error:
            raise SrcError(error)
        except (KeyboardInterrupt, SystemExit):
            tpl.cancel(key='abort')
示例#3
0
 def record(cls, dirname, filename, resultset, separator=''):
     """
     Record data process
     :param str dirname: report directory
     :param str filename: report filename
     :param list resultset: report result
     :param str separator: result separator
     :raise Exception
     :return: None
     """
     
     try:
         filename = "".join((dirname, filesystem.sep, filename, cls.EXTENSION_SET))
         filename = filesystem.makefile(filename)
         filesystem.writelist(filename, resultset, separator)
         tpl.info(key='report', plugin=cls.PLUGIN_NAME, dest=filesystem.getabsname(filename))
     except FileSystemError as error:
         raise Exception(error)
示例#4
0
 def record(cls, dirname, filename, resultset, separator=''):
     """
     Record data process
     :param str dirname: report directory
     :param str filename: report filename
     :param list resultset: report result
     :param str separator: result separator
     :raise Exception
     :return: None
     """
     
     try:
         filename = "".join((dirname, filesystem.sep, filename, cls.EXTENSION_SET))
         filename = filesystem.makefile(filename)
         filesystem.writelist(filename, resultset, separator)
         tpl.info(key='report', plugin=cls.PLUGIN_NAME, dest=filesystem.getabsname(filename))
     except FileSystemError as error:
         raise Exception(error)