Dave Aitel
10/25/2024, 8:56 PMDave Aitel
10/25/2024, 8:57 PMDave Aitel
10/25/2024, 8:57 PMDave Aitel
10/25/2024, 8:58 PMsucceeded = False
        things_we_tried = []
        i = 0
        while not succeeded and i < MAX_TRIES:
            i += 1
            # Create a task for the exploit agent using the tools and results from recon
            exploit_task = cf.Task(
                code_inject_exploit_sysmsg,
                agents=[exploitagent],
                tools=[PythonRunnerTool(), CommandRunnerTool()],
                context={
                           "workbook": code_injection_workbook,
                           "target_website": start_url,
                           "recon_result": str(endpoint),  # Pass the recon result
                           "things_we_tried": str(things_we_tried),
                       },
                result_type=ExploitResult,
                completion_tools=["SUCCEED"]
            )
            # Execute the exploit task
            exploit_result = exploit_task.run()
            succeeded = exploit_result.succeeded
            things_we_tried += exploit_result.things_we_tried
            print("Exploit Result: %s" % exploit_result)Dave Aitel
10/25/2024, 8:58 PM