library/src/exploitation/ModularExploitation/BP-ModularExploitation.cc
// displays the contents of a modular exploitation session
displays the contents of a modular exploitation session
displays the contents of a modular exploitation session
BP_ERROR_T BP_MEDisplaySession(P_BP_MODULAR_EXPLOITATION_SESSION session)
{
	if(!session)
		return ERR_FAILURE;
	char *session_status = "UNKNOWN BAD SESSION STATUS";
	switch(session->enabled_status)
	{
		case BP_MODULAR_EXPLOITATION_SESSION_UNSET:
			session_status = "BP_MODULAR_EXPLOITATION_SESSION_UNSET";
			break;
		case BP_MODULAR_EXPLOITATION_SESSION_ENABLED:
			session_status = "BP_MODULAR_EXPLOITATION_SESSION_ENABLED";
			break;
		case BP_MODULAR_EXPLOITATION_SESSION_DISABLED:
			session_status = "BP_MODULAR_EXPLOITATION_SESSION_DISABLED";
			break;
		default:
			break;
	}
	char *run_status = "UNKNOWN BAD RUN STATUS";
	switch(session->run_status)
	{
		case BP_MODULAR_EXPLOITATION_SESSION_RUN_STATUS_UNSET:
			run_status = "BP_MODULAR_EXPLOITATION_SESSION_RUN_STATUS_UNSET";
			break;
		case BP_MODULAR_EXPLOITATION_SESSION_RUN_STATUS_RUNNING:
			run_status = "BP_MODULAR_EXPLOITATION_SESSION_RUN_STATUS_RUNNING";
			break;
		case BP_MODULAR_EXPLOITATION_SESSION_RUN_STATUS_PENDING:
			run_status = "BP_MODULAR_EXPLOITATION_SESSION_RUN_STATUS_PENDING";
			break;
		case BP_MODULAR_EXPLOITATION_SESSION_RUN_STATUS_PAUSED:
			run_status = "BP_MODULAR_EXPLOITATION_SESSION_RUN_STATUS_PAUSED";
			break;
		case BP_MODULAR_EXPLOITATION_SESSION_RUN_STATUS_STOPPED:
			run_status = "BP_MODULAR_EXPLOITATION_SESSION_RUN_STATUS_STOPPED";
			break;
		default:
			break;
	}
	printf("\n [+] Displaying Modular Exploitation System: %p", session);
	printf("\n\t Status:               %s", session_status);
	printf("\n\t Run Status:           %s", run_status);
	printf("\n\t Database Pool:        %p (%u connections in pool)", session->db_pool, session->db_pool ? session->db_pool->entries_total : 0);
	printf("\n\t Session ID:           %u", session->session_id);
	printf("\n\t Tail Queue Allocator: %p", session->tq);
	printf("\n");
	printf("\n\t [-]Loaded Modules:  %p", session->modules);
	printf("\n\t\t Total Modules Loaded: %u", session->module_n);
	printf("\n");
	printf("\n\t [-] Loaded Targets: %p", session->targets);
	printf("\n\t\t Target Count: %u", session->targets_n);
	printf("\n");
	return ERR_SUCCESS;
}
BP_ERROR_T BP_MEDisplaySession ( P_BP_MODULAR_EXPLOITATION_SESSION session ) { if ( ! session ) return ERR_FAILURE ; char * session_status = " " ; switch ( session -> enabled_status ) { case BP_MODULAR_EXPLOITATION_SESSION_UNSET : session_status = " " ; break ; case BP_MODULAR_EXPLOITATION_SESSION_ENABLED : session_status = " " ; break ; case BP_MODULAR_EXPLOITATION_SESSION_DISABLED : session_status = " " ; break ; default : break ; } char * run_status = " " ; switch ( session -> run_status ) { case BP_MODULAR_EXPLOITATION_SESSION_RUN_STATUS_UNSET : run_status = " " ; break ; case BP_MODULAR_EXPLOITATION_SESSION_RUN_STATUS_RUNNING : run_status = " " ; break ; case BP_MODULAR_EXPLOITATION_SESSION_RUN_STATUS_PENDING : run_status = " " ; break ; case BP_MODULAR_EXPLOITATION_SESSION_RUN_STATUS_PAUSED : run_status = " " ; break ; case BP_MODULAR_EXPLOITATION_SESSION_RUN_STATUS_STOPPED : run_status = " " ; break ; default : break ; } printf ( " \n " , session ) ; printf ( " \n \t " , session_status ) ; printf ( " \n \t " , run_status ) ; printf ( " \n \t " , session -> db_pool , session -> db_pool ? session -> db_pool -> entries_total : 0 ) ; printf ( " \n \t " , session -> session_id ) ; printf ( " \n \t " , session -> tq ) ; printf ( " \n " ) ; printf ( " \n \t " , session -> modules ) ; printf ( " \n \t \t " , session -> module_n ) ; printf ( " \n " ) ; printf ( " \n \t " , session -> targets ) ; printf ( " \n \t \t " , session -> targets_n ) ; printf ( " \n " ) ; return ERR_SUCCESS ; }
displays the contents of a modular exploitation session
displays the contents of a modular exploitation session
// test to see if we have a session // get session status for entire session // string representation of run status // switch to determine run status /* default string is already set during initial initialization */ // return indicating print success