GreyDGL / PentestGPT

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

How to resolve this error; #109

Closed AjGaht closed 1 year ago

AjGaht commented 1 year ago

Please describe the penetration testing task in one line, including the target I

  • Task information generated.

Traceback (most recent call last): File "/usr/local/bin/pentestgpt", line 33, in sys.exit(load_entry_point('pentestgpt==0.8.0', 'console_scripts', 'pentestgpt')()) File "/home/asus/.local/lib/python3.9/site-packages/pentestgpt/main.py", line 29, in main pentestGPTHandler.main() File "/home/asus/.local/lib/python3.9/site-packages/pentestgpt/utils/pentest_gpt.py", line 643, in main self.initialize(previous_session_ids=loaded_ids) File "/home/asus/.local/lib/python3.9/site-packages/pentestgpt/utils/pentest_gpt.py", line 221, in initialize self._feed_init_prompts() File "/home/asus/.local/lib/python3.9/site-packages/pentestgpt/utils/pentest_gpt.py", line 147, in _feed_init_prompts self.prompts.first_todo + _response TypeError: can only concatenate str (not "tuple") to str

GreyDGL commented 1 year ago

May you check if the error is the same as #111 ?

GreyDGL commented 1 year ago

This issue should be fixed now.

anoth3rus3r commented 1 year ago

I experienced a similar problem:

└─# pentestgpt --reasoning_model=gpt-3.5-turbo --useAPI
Your CHATGPT_COOKIE is not set. Please set it in the environment variable.
Welcome to pentestGPT, an automated penetration testing parser empowered by GPT.
The settings are: 
 - reasoning model: gpt-3.5-turbo
 - use API: True
 - API base URL: https://api.openai.com/v1
 - log directory: logs
Do you want to continue from previous session? (y/n) n
- ChatGPT Sessions Initialized.
Please describe the penetration testing task in one line, including the target IP, task type, etc.
> HTB, OS Linux, 10.10.11.224
Traceback (most recent call last):
  File "/usr/local/bin/pentestgpt", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/pentestgpt/main.py", line 37, in main
    pentestGPTHandler.main()
  File "/usr/local/lib/python3.11/dist-packages/pentestgpt/utils/pentest_gpt.py", line 667, in main
    self.initialize(previous_session_ids=loaded_ids)
  File "/usr/local/lib/python3.11/dist-packages/pentestgpt/utils/pentest_gpt.py", line 245, in initialize
    self._feed_init_prompts()
  File "/usr/local/lib/python3.11/dist-packages/pentestgpt/utils/pentest_gpt.py", line 166, in _feed_init_prompts
    _response = self.reasoning_handler(prefixed_init_description)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/pentestgpt/utils/pentest_gpt.py", line 252, in reasoning_handler
    response = self.chatGPT4Agent.send_message(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/pentestgpt/utils/chatgpt_api.py", line 231, in send_message
    conversation = self.conversation_dict[conversation_id]
                   ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
KeyError: None

It;s replicate on my diffrent vm's.