diff --git a/utils/pentest_gpt.py b/utils/pentest_gpt.py index 67e7176..db658f8 100644 --- a/utils/pentest_gpt.py +++ b/utils/pentest_gpt.py @@ -196,7 +196,7 @@ class pentestGPT: ) user_input = prompt_ask("> ", multiline=True) self.log_conversation( - "user_input", "Source: " + options[int(source)] + "\n" + user_input + "user", "Source: " + options[int(source)] + "\n" + user_input ) with self.console.status("[bold green] PentestGPT Thinking...") as status: parsed_input = self.input_parsing_handler( @@ -221,6 +221,7 @@ class pentestGPT: # generate more test details (beginner mode) elif request_option == "more": + self.log_conversation("user", "more") ## (1) pass the reasoning results to the test_generation session. if self.step_reasoning_response is None: self.console.print( @@ -245,6 +246,8 @@ class pentestGPT: # ask for task list (to-do list) elif request_option == "todo": + ## log that user is asking for todo list + self.log_conversation("user", "todo") ## (1) ask the reasoning session to analyze the current situation, and list the top sub-tasks with self.console.status("[bold green] PentestGPT Thinking...") as status: reasoning_response = self.reasoning_handler(self.prompts.ask_todo) @@ -282,7 +285,7 @@ class pentestGPT: user_input = prompt_ask( "(End with ) Your input: ", multiline=True ) - self.log_conversation("user_input", user_input) + self.log_conversation("user", user_input) ## (2) pass the information to the reasoning session. with self.console.status("[bold green] PentestGPT Thinking...") as status: response = self.reasoning_handler(self.prompts.discussion + user_input) @@ -305,7 +308,7 @@ class pentestGPT: user_input = prompt_ask( "(End with ) Your input: ", multiline=False ) - self.log_conversation("user_input", user_input) + self.log_conversation("user", user_input) with self.console.status("[bold green] PentestGPT Thinking...") as status: # query the question result: dict = google_search(user_input, 5) # 5 results by default diff --git a/utils/report_generator.py b/utils/report_generator.py index 42f30f2..ad490e6 100644 --- a/utils/report_generator.py +++ b/utils/report_generator.py @@ -33,10 +33,11 @@ def main(file_name): print(output) + if __name__ == "__main__": # default filename = "../logs/sample_pentestGPT_log.txt" if len(sys.argv) == 1: file_name = "logs/sample_pentestGPT_log.txt" else: file_name = sys.argv[1] - main(file_name) \ No newline at end of file + main(file_name)