GreyDGL / PentestGPT

A GPT-empowered penetration testing tool
MIT License
7.28k stars 883 forks source link

shift + right-arrow Exception: RetryError #237

Open endlesslyou opened 5 months ago

endlesslyou commented 5 months ago

Describe the bug When i end my input with shift + right-arrow, pentestgpt gave me error. I use macos Sonoma 14.5 and latest pentestgpt version

pentestgpt --reasoning_model=gpt-4 Your CHATGPT_COOKIE is not set. Please set it in the environment variable. Your GOOGLE_API_KEY is not set. Please set it in the environment variable. Your GOOGLE_API_KEY is not set. Please set it in the environment variable. Welcome to pentestGPT, an automated penetration testing parser empowered by GPT. The settings are:

New conversation.3c9ae05a-2285-11ef-9583-8ecc7cb9e95f is created.

Step 1: Open your terminal.

Step 2: Use Nmap, a free and open-source network scanner, for the port scanning. If it's not installed, you can install it using the following command on Ubuntu:

sudo apt-get install nmap

Step 3: Once Nmap is installed, you can use it to perform a full port scan on test.com by typing the following command into your terminal:

nmap -p- test.com

This command will scan all 65535 ports on test.com.

Step 4: Review the output. The open ports will be listed in the command line output.

Remember, the purpose of this task is to identify all open ports on test.com, which will help us understand the network better and plan further penetration testing steps.

next Please choose the source of the information. () tool Paste the output of the security test tool used ^ ( ) user-comments
( ) web Paste the relevant content of a web page
( ) default Write whatever you want, the tool will handle it v Your input: (End with <shift + right-arrow>) nmap scan only show port 80 and 443 Exception: RetryError[<Future at 0x10698f050 state=finished raised KeyError>] Exception details are below. You may submit an issue on github and paste the error trace Traceback (most recent call last): File "/Users/myuser/Work/venvpentest/lib/python3.12/site-packages/tenacity/init.py", line 470, in call result = fn(
args, **kwargs) ^^^^^^^^^^^^^^^^^^^ File "/Users/myuser/Work/Tools/PentestGPT/pentestgpt/utils/llm_api.py", line 268, in send_message conversation = self.conversation_dict[conversation_id]


KeyError: None

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/Users/myuser/Work/Tools/PentestGPT/pentestgpt/utils/pentest_gpt.py", line 742, in main result = self.input_handler() ^^^^^^^^^^^^^^^^^^^^ File "/Users/myuser/Work/Tools/PentestGPT/pentestgpt/utils/pentest_gpt.py", line 471, in input_handler parsed_input = self.input_parsing_handler( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/myuser/Work/Tools/PentestGPT/pentestgpt/utils/pentest_gpt.py", line 312, in input_parsing_handler summarized_content += self.parsingAgent.send_message( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/myuser/Work/venvpentest/lib/python3.12/site-packages/tenacity/init.py", line 330, in wrapped_f return self(f, *args, **kw) ^^^^^^^^^^^^^^^^^^^^ File "/Users/myuser/Work/venvpentest/lib/python3.12/site-packages/tenacity/init.py", line 467, in call do = self.iter(retry_state=retry_state) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/myuser/Work/venvpentest/lib/python3.12/site-packages/tenacity/init.py", line 368, in iter result = action(retry_state) ^^^^^^^^^^^^^^^^^^^ File "/Users/myuser/Work/venvpentest/lib/python3.12/site-packages/tenacity/init.py", line 411, in exc_check raise retry_exc from fut.exception() tenacity.RetryError: RetryError[<Future at 0x10698f050 state=finished raised KeyError>]

Before you quit, you may want to save the current session. Please enter the name of the current session. (Default with current timestamp)

GreyDGL commented 5 months ago

Let me try to debug and reproduce this one.

yaojijiayou commented 2 months ago

image same error.

GreyDGL commented 2 months ago

I cannot reproduce the error, but likely this is due to the connection lost. I'll add a more robust debugger for it.

river-li commented 2 months ago

Same to me

freya270 commented 3 weeks ago

我出现下拉框进行选择的时候,我输入shift + 向右箭头无反应,无法进行选择

GreyDGL commented 3 weeks ago

@freya270 can you try running PnetestGPT in tmux again?

river-li commented 3 weeks ago

@GreyDGL FYI, I think this issue not only relates to tmux, but also relates to the terminal emulator. Since different terminal emulator encode shift+<right arrow> as a different character. I previously tried alacritty+tmux, and it didn't work. But macos's default terminal.app+tmux works normally.