def do_work(connection, channel, delivery_tag, body): request = json.loads(body.decode('utf-8').replace("'", "\"")) req_type = request['req_type'] case_id = request['case_id'] evd_id = request['evd_id'] options = request['options'] print('[' + datetime.today().strftime("%Y-%m-%d %H:%M:%S") + '] New Request !') print('\t\t\tCase ID : ' + case_id) print('\t\t\tEvd ID : ' + evd_id) print('\t\t\tRequest Type : ' + req_type) if req_type == 'analyze': tool = carpe_tool.CarpeTool() args = [] args.append("--cid") args.append(case_id) args.append("--eid") args.append(evd_id) if not tool.ParseArguments(args): return False tool.ExtractDataFromSources(mode='Analyze') print('[' + datetime.today().strftime("%Y-%m-%d %H:%M:%S") + '] Complete Evidence File Analysis !') cb = functools.partial(ack_message, channel, delivery_tag) connection.add_callback_threadsafe(cb)
def Main(): """The main function.""" tool = carpe_tool.CarpeTool() if not tool.ParseArguments(sys.argv[1:]): return False if tool.show_troubleshooting: print('Using Python version {0!s}'.format(sys.version)) print() print('Path: {0:s}'.format(os.path.abspath(__file__))) print() print(tool.GetVersionInformation()) print() dependencies.CheckDependencies(verbose_output=True) print('Also see: http://forensic.korea.ac.kr') return True if tool.show_info: tool.ShowInfo() return True have_list_option = False if tool.list_modules: tool.ListModules() have_list_option = True if tool.list_timezones: tool.ListTimeZones() have_list_option = True if have_list_option: return True # TODO: dependencies_check 되게 해야함!! if tool.dependencies_check and not dependencies.CheckDependencies( verbose_output=False): return False try: tool.ExtractDataFromSources(mode='Analyze') except (KeyboardInterrupt, errors.UserAbort): logging.warning('Aborted by user.') return False except (errors.BadConfigOption, errors.SourceScannerError, errors.BadConfigObject) as exception: # Display message on stdout as well as the log file. print(exception) logging.error(exception) return False return True
def do_work(connection, channel, delivery_tag, body): request = json.loads(body.decode('utf-8').replace("'", "\"")) req_type = request['req_type'] case_id = request['case_id'] evd_id = request['evd_id'] options = request['options'] print('[' + datetime.today().strftime("%Y-%m-%d %H:%M:%S") + '] New Request !') print('\t\t\tCase ID : ' + case_id) print('\t\t\tEvd ID : ' + evd_id) print('\t\t\tRequest Type : ' + req_type) if req_type == 'analyze': tool = carpe_tool.CarpeTool() # args = "--modules defa_caller --cid "+case_id+" --eid "+evd_id args = [] args.append("--modules") args.append("defa_caller") args.append("--cid") args.append("c1c16a681937b345f1990d10a9d0fdfcc8") args.append("--eid") args.append("e111111111111111111111111111111111") if not tool.ParseArguments(args): return False tool.ExtractDataFromSources() # carpe_am = carpe_am_module.CARPE_AM() # carpe_am.SetModule(case_id, evd_id) # pdb.set_trace() # carpe_am.ParseImage(options) # carpe_am.ParseFilesystem() # carpe_am.SysLogAndUserData_Analysis() print('[' + datetime.today().strftime("%Y-%m-%d %H:%M:%S") + '] Complete Evidence File Analysis !') cb = functools.partial(ack_message, channel, delivery_tag) connection.add_callback_threadsafe(cb)
def Main(): """The main function.""" f = Figlet(font='standard') print(f.renderText('Carpe')) print(f.renderText('Forensics')) print('---------------------------------------------------------------------') print('\nComprehensive Analysis and Research Platform for digital Evidence') print('Korea University - Digital Forensic Reseach Center') print('URL -> https://github.com/dfrc-korea/carpe\n') #print("Copyright 2021. Korea University - DFRC. All rights reserved ") print('---------------------------------------------------------------------') print() sys.stdout.flush() tool = carpe_tool.CarpeTool() if not tool.ParseArguments(sys.argv[1:]): return False if tool.show_troubleshooting: print('Using Python version {0!s}'.format(sys.version)) print() print('Path: {0:s}'.format(os.path.abspath(__file__))) print() print(tool.GetVersionInformation()) print() dependencies.CheckDependencies(verbose_output=True) print('Also see: http://forensic.korea.ac.kr') return True if tool.show_info: tool.ShowInfo() return True have_list_option = False if tool.list_modules: tool.ListModules() have_list_option = True if tool.list_timezones: tool.ListTimeZones() have_list_option = True if have_list_option: return True # TODO: dependencies_check 되게 해야함!! if tool.dependencies_check and not dependencies.CheckDependencies( verbose_output=False): return False try: sys.stdout.flush() tool.ExtractDataFromSources(mode='Analyze') except (KeyboardInterrupt, errors.UserAbort): logging.warning('Aborted by user.') return False except (errors.BadConfigOption, errors.SourceScannerError, errors.BadConfigObject) as exception: # Display message on stdout as well as the log file. print(exception) logging.error(exception) return False return True