Ejemplo n.º 1
0
def main():
	"""
	Main function of apkscan when running from command line.
	"""
	try:
		paths.ROOT_PATH = module_path()
		set_paths()
		
		# Store original command line options for possible later restoration
		cmd_options.update(cmd_parser().__dict__)
		init_options(cmd_options)
		
		banner()
		
		data_stdout("[*] starting at %s\n\n" % time.strftime("%X"), forceOutput=True)
		
		init()
		start()
		
	except ApkscanUserQuitException:
		err_msg = "user quit"
		logger.error(err_msg)
		
	except ApkscanBaseException, ex:
		err_msg = get_unicode(ex.message)
		logger.critical(err_msg)
		sys.exit(1)
Ejemplo n.º 2
0
def main():
    try:
        check_python_version()
        check_environment()

        # set paths of project
        set_paths(module_path())

        # output banner information
        banner() 

        # received command >> cmdLineOptions
        cmdLineOptions.update(cmdLineParser().__dict__)

        # loader script,target,working way(threads? gevent?),output_file from cmdLineOptions
        # and send it to conf
        init_options(cmdLineOptions)

        # load poc module and target --> tasks
        load()

        # run!
        run()
    except Exception as e:
        print(e)

    finally:
        print("\n\n[*] shutting down at {0}\n".format(time.strftime("%X")))
Ejemplo n.º 3
0
def main():
    #设置相关路径绝对变量,相当于一些变量从配置文件读取进行初始化
    set_paths()
    #从终端命令获取输入参数,并更新给一个变量
    conf.update(cmdline_parse().__dict__)

    #    get_cmd()

    #初始化日志设置
    SetLogger()
    #程序运行后显示的banner图案
    banner()
    #从script文件夹中读取的module对象
    load_module()
    #获取攻击目标
    load_payload()
    #开始运行程序
    run()
Ejemplo n.º 4
0
def main():
    banner()
    try:
        paths.ROOT_PATH = module_path()
        try:
            os.path.isdir(paths.ROOT_PATH)
        except UnicodeEncodeError:
            errMsg = "your system does not properly handle non-ASCII paths. "
            errMsg += "Please move the project root directory to another location"
            logger.error(errMsg)
            raise SystemExit
        cmdLineOptions.update(cmdline_parse().__dict__)
        init_options(cmdLineOptions)
        set_paths(paths.ROOT_PATH)
        if IS_WIN:
            winowsColorInit()
        start()
    except Exception, e:
        logger.error(e.message)
        logger.error(traceback.format_exc())