skipped 34 lines 35 35 if args.J: 36 36 print(json.dumps(all_data, indent=4)) 37 37 else: 38 - print_txt_results(all_data) 39 - 38 + print_txt_results(all_data, args . concise ) 40 39 41 - def print_txt_results(res): 40 + def print_txt_results(res, concise ): 42 41 for command in res: 43 - print(f'{command}:') 44 - for item in res[command]: 45 - if res[command] [ item ]: 46 - print(f'\t{item}:') 47 - if type(res[command][item]) == list: 48 - data = '\n\t\t'.join(json.dumps(i) for i in res[command][item]) 49 - else: 50 - data = res[command][item] 51 - print(f'\t\t{data}') 42 + if (not concise and res[command]["raw_data"]) or res[command]["recommendation"] or res[command]["suspicious"]: 43 + print(f'{command}:') 44 + for item in res[command]: 45 + if concise and item != "recommendation" and item != "suspicious": 46 + continue 47 + if res[command][item]: 48 + print(f'\t{item}:') 49 + if type ( res[command][item]) = = list : 50 + data = '\n\t\t'.join(json.dumps(i) for i in res[command][item]) 51 + else: 52 + data = res[command][item] 53 + print(f'\t\t{data}') 52 54 53 55 54 56 if __name__ == '__main__': skipped 3 lines 58 60 parser.add_argument('-u', '--userName', help='User name with admin Permissions', required=True) 59 61 parser.add_argument('-ps', '--password', help='The password of the given user name', default='') 60 62 parser.add_argument('-J', help='Print the results as json format', action='store_true') 63 + parser.add_argument('-concise', help='Print out only suspicious items and recommendations', action='store_true') 61 64 args = parser.parse_args() 62 65 63 66 main(args) skipped 1 lines