Example #1
0
def single_target(options):
    try:
        utils.set_config(options)
        options['JWT'] = utils.get_jwt(options)
    except:
        utils.print_bad(
            "Fail to set config, Something went wrong with Flask API !")
        utils.print_info(
            "Visit this page for common issue: https://github.com/j3ssie/Osmedeus/wiki/Common-Issues"
        )
        sys.exit(-1)

    if not (options['JWT'] and options['JWT'] != "None"):
        utils.print_bad("Can't login to get JWT")
        sys.exit(-1)

    utils.print_target(options.get('TARGET'))

    # just disable slack noti in debug mode
    if options['DEBUG'] != "True":
        slack.slack_seperate(options)

    # run specific task otherwise run the normal routine
    if options['MODULE'] != "None":
        module = options['MODULE']
        routine.specific(options, module)

    else:
        if options['DEBUG'] == "True":
            routine.debug(options)
        else:
            routine.normal(options)
Example #2
0
def parsing_report(options):
    global headers
    mode = options.get('REPORT').lower()
    modes = [
        'full', 'raw', 'short', 'raw_html', 'list', 'ls', 'path', 'summary',
        'sum'
    ]

    if mode not in modes:
        report_help()
        return None
    if not utils.connection_check('127.0.0.1', 5000):
        utils.print_info(
            "Look like API not turn on, reading from local log instead.")
    else:
        options['JWT'] = utils.get_jwt(options)
        headers['Authorization'] = options['JWT']

    # mapping mode
    if 'list' in mode or 'ls' in mode:
        workspace_list(options)
    elif 'path' in mode:
        short_report(options)
    elif 'short' in mode:
        short_report(options)
    elif 'full' in mode:
        full_report(options)
    elif 'raw' in mode:
        full_report(options)
    elif 'sum' in mode:
        summary_report(options)
Example #3
0
def parsing_argument(args):

    if not args.client:
        p = Process(target=flask_run)
        p.start()

    #parsing agument
    if args.config:
        config_path = args.config
        options = config.parsing_config(config_path, args)

    #wait for flask API start
    time.sleep(2)
    try:
        utils.set_config(options)
        options['JWT'] = utils.get_jwt(options)
    except:
        utils.print_bad("Fail to set config, Please check Flask API !!!")
        sys.exit(-1)

    if options['TARGET_LIST'] != "None":
        #check if target list file exist and loop throught the target
        if os.path.exists(options['TARGET_LIST']):
            with open(options['TARGET_LIST'], 'r+') as ts:
                targetlist = ts.read().splitlines()

            for target in targetlist:
                options['TARGET'] = target
                single_target(options)
                print(
                    "{2}>++('> >++('{1}>{2} Target done: {0} {1}<{2}')++< <')++<"
                    .format(options['TARGET'], P, G))

    else:
        single_target(options)
Example #4
0
def parsing_argument(args):

    if not args.client:
        p = Process(target=flask_run)
        p.start()

    #parsing agument
    if args.config:
        config_path = args.config
        options = config.parsing_config(config_path, args)
            
    #wait for flask API start
    time.sleep(2)
    try:
        utils.set_config(options)
        options['JWT'] = utils.get_jwt(options)
    except:
        utils.print_bad("Fail to set config, Something went from with Flask API !!!")
        utils.print_bad(
            "Visit this page for common issue: https://github.com/j3ssie/Osmedeus/wiki/Common-Issues")
        sys.exit(-1)

    if options['TARGET_LIST'] != "None":
        #check if target list file exist and loop throught the target
        if os.path.exists(options['TARGET_LIST']):
            with open(options['TARGET_LIST'], 'r+') as ts:
                targetlist = ts.read().splitlines()
            
            for target in targetlist:
                options['TARGET'] = target
                single_target(options)
                print(
                    "{2}>++('> >++('{1}>{2} Target done: {0} {1}<{2}')++< <')++<".format(options['TARGET'], P, G))

    else:
        single_target(options)