Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shift + right-arrow Exception: RetryError #237

Open
endlesslyou opened this issue Jun 4, 2024 · 7 comments
Open

shift + right-arrow Exception: RetryError #237

endlesslyou opened this issue Jun 4, 2024 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@endlesslyou
Copy link

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:

  • parsing model: gpt-4o-2024-05-13
  • reasoning model: gpt-4
  • use API: True
  • log directory: logs
    Do you want to continue from previous session? (y/n) n
    New conversation.3bffd88a-2285-11ef-9583-8ecc7cb9e95f is created.

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

  • ChatGPT Sessions Initialized.
    Please describe the penetration testing task in one line, including the target IP, task type, etc.

i want to pentest test.com
PentestGPT output:

  1. Reconnaissance -
    1.1 Passive Information Gathering - (completed)
    1.2 Active Information Gathering - (completed)
    1.3 Identify Open Ports and Services - (to-do)
    1.3.1 Perform a full port scan on test.com - (to-do)
    1.3.2 Determine the purpose of each open port - (to-do)
    From the provided Penetration Testing Tree (PTT), it's clear that the next task to be executed is 1.3.1 'Perform a full port scan on test.com'. Here are the detailed steps to perform this task:

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
Copy link
Owner

GreyDGL commented Jun 19, 2024

Let me try to debug and reproduce this one.

@yaojijiayou
Copy link

image
same error.

@GreyDGL
Copy link
Owner

GreyDGL commented Sep 4, 2024

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

@GreyDGL GreyDGL self-assigned this Sep 4, 2024
@GreyDGL GreyDGL added the bug Something isn't working label Sep 4, 2024
@river-li
Copy link

Same to me

@freya270
Copy link

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

@GreyDGL
Copy link
Owner

GreyDGL commented Oct 29, 2024

@freya270 can you try running PnetestGPT in tmux again?

@river-li
Copy link

river-li commented Oct 29, 2024

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants