Skip to content

Automated conversion of existing exploit code into modules for automated penetration testing frameworks

Notifications You must be signed in to change notification settings

securityinmobility/exploit-to-module-conversion

Repository files navigation

Exploit to module conversion

This Programm is for converting exploit code into a module for an automated penetration testing framwork e.g. the autosec framework.

Prompts

The Prompts need to be privided in files called Prompt_x.txt where the x is replaced with the number of the prompt starting from one. These prompt files has to be in one directory. This directory is passed as a command line argument and is also used for saving the results.

Example Prompts

  1. How can a large language model proceed systematically and step-by-step to find out which artifacts are required as input for the aforementioned exploit code and which artifacts are output?
  2. Please identify all necessary input artifacts and all possibly generated output artifacts for the previously specified exploit code using the procedure of the last message. Information: It is possible, that one class is used as an input and an output artifact for the same module.
  3. Are the necessary artifacts for the exploit code covered by the existing artifacts from the Autosec framework? Some artifacts maybe can be used for multiple purposes. Please start your answer with "Yes" or "No"
  4. How can an LLM proceed systematically and step by step to convert the exploit code into a module for the Autosec framework and use only the existing artifacts?
  5. Please convert the specified exploit code into a module for the Autosec framework using the steps just mentioned. Make sure that the generated module only contains calls that fit to the code of the autosec framework shown above. It must not be necessary to adapt the code in order to insert the module into the framework. All used artifacts in the exploit code must be from the existing artifacts shown in the beginning.

Adaptions before execution

Adopt the structure of the initial_system_content to your needs if necessary.

If you changed the prompts, you may need to adopt the check_answer_to_continue() function in the prompt_handling.py file to your needs.

You also have to create the environment file with the api key inside. The name of the file can be changed in load_env.py and the content should look like this: API_KEY=your-key-from-the-gpt-api-1234567890

Execution

Execute the main.py file with the necessary arguments e.g. python main.py --prompt_directory="C:\prompts" --exploit_path="C:\exploits\test_exploit.py" --example_module_path="C:\frameworks\automated-pentesting\modules\port_scan.py" --artifact_directory="C:\frameworks\automated-pentesting\artifacts"

About

Automated conversion of existing exploit code into modules for automated penetration testing frameworks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages