library/src/exploitation/WebExploitation/CommandExecution/BP-WebExploitationCommandExecution.cc
// Generate a new command injection test session, complete with default values filled
// in, by providing a web assessment.
Generate a new command injection test session, complete with default values filled
in, by providing a web assessment.
Generate a new command injection test session complete with default values filled in by providing a web assessment .
P_BP_WEB_COMMAND_INJECTION_TEST_SESSION BP_CommandInjectionGenerateNewSessionFromWebAssessmentAndHTMLExtraction
(
		P_BP_WEB_ASSESSMENT assessment,
		P_BP_HTML_FULL_EXTRACTION html_extraction
)
{
	if(!assessment)
		return NULL;
	if(!html_extraction)
		return NULL;
	if(!html_extraction->forms && !html_extraction->anchors)
		return NULL;
	P_BP_WEB_COMMAND_INJECTION_TEST_SESSION session = BP_CommandInjectionGenerateNewCommandInjectionSession();
	session->assessment_reference = assessment;
	session->html_extraction_reference = html_extraction;
	session->stop_cmd_injection_test_after_code_execution_discovered = BP_TRUE;
	BP_CommandInjectionParseHtmlExtractionForNewTargets
	(
			session,
			session->html_extraction_reference
	);
	return session;
}
P_BP_WEB_COMMAND_INJECTION_TEST_SESSION BP_CommandInjectionGenerateNewSessionFromWebAssessmentAndHTMLExtraction ( P_BP_WEB_ASSESSMENT assessment , P_BP_HTML_FULL_EXTRACTION html_extraction ) { if ( ! assessment ) return NULL ; if ( ! html_extraction ) return NULL ; if ( ! html_extraction -> forms && ! html_extraction -> anchors ) return NULL ; P_BP_WEB_COMMAND_INJECTION_TEST_SESSION session = BP_CommandInjectionGenerateNewCommandInjectionSession ( ) ; session -> assessment_reference = assessment ; session -> html_extraction_reference = html_extraction ; session -> stop_cmd_injection_test_after_code_execution_discovered = BP_TRUE ; BP_CommandInjectionParseHtmlExtractionForNewTargets ( session , session -> html_extraction_reference ) ; return session ; }
Generate a new command injection test session, complete with default values filled
in, by providing a web assessment.
Generate a new command injection test session complete with default values filled in by providing a web assessment .
// return null if we have no assessment // we must have some forms or anchors to parse to create the session // generate a new empty command injection session // set the assessment reference // set the html assessment reference // set flag to stop execution after discovery (prevents overzealous testing) // Parse the html for new targets // return NULL for failure