mrwadams / attackgen

AttackGen is a cybersecurity incident response testing tool that leverages the power of large language models and the comprehensive MITRE ATT&CK framework. The tool generates tailored incident response scenarios based on user-selected threat actor groups and your organisation's details.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Scenario Generation Error: 'ascii' codec can't encode character '\xa3' - Possible Encoding Issue

0xhav0c opened this issue · comments

Hello, firstly i want to thank u for this tool. It's amazing. I have one issue about "Generate Scenario". When i try the this function get a fail. Fail output like that:

image

UI Output
An error occurred while generating the scenario: 'ascii' codec can't encode character '\xa3' in position 16: ordinal not in range(128)

Console output
/app/pages/1_🛡️_Threat_Group_Scenarios.py:198: DeprecationWarning: DataFrameGroupBy.apply operated on the grouping columns. This behavior is deprecated, and in a future version of pandas the grouping columns will be excluded from the operation. Either pass include_groups=False to exclude the groupings or explicitly select the grouping columns after groupby to silence this warning.
.apply(lambda x: x.sample(n=1) if len(x) > 0 else None)
/app/pages/1_🛡️_Threat_Group_Scenarios.py:198: DeprecationWarning: DataFrameGroupBy.apply operated on the grouping columns. This behavior is deprecated, and in a future version of pandas the grouping columns will be excluded from the operation. Either pass include_groups=False to exclude the groupings or explicitly select the grouping columns after groupby to silence this warning.
.apply(lambda x: x.sample(n=1) if len(x) > 0 else None)
/usr/local/lib/python3.12/site-packages/langchain_core/_api/deprecation.py:117: LangChainDeprecationWarning: The class langchain_community.chat_models.openai.ChatOpenAI was deprecated in langchain-community 0.0.10 and will be removed in 0.2.0. An updated version of the class exists in the langchain-openai package and should be used instead. To use it run pip install -U langchain-openai and import as from langchain_openai import ChatOpenAI warn_deprecated(

Thanks in advance for your help

Hi @0xhav0c,

Glad you like the tool.

I'm aware of the Pandas deprecation warning and have just fixed the langchain_community.chat_models.openai.ChatOpenAI warning in 89dd937

Could you please confirm if you're using the version of the tool hosted at https://attackgen.streamlit.app, or are you cloning the repo and running the Streamlit app locally?

Thanks,

Matt

I installed latest build today. Same issue still continue. By the way, same issue on https://attackgen.streamlit.app/

image

Thanks a lot

Hi @0xhav0c,

Thanks for continuing to test the tool. It looks like you're generating a Threat Group Scenario. Could you please tell me which threat actor group you're selecting so I can try and replicate the issue?

Thanks,

Matt

Hello @mrwadams

First of all, you're welcome, with pleasure. Frankly, I experience this problem in all threat actor groups. I tried it in "gpt-4-turbo-preview", "gpt-4" and "gpt-3.5-turbo" versions. I even chose 5-6 models on the "Select your company's industry" side. I'm getting the same error.

Thanks

That's interesting, and it makes me think that you might have some browser settings or a specific configuration that's affecting how your browser is interpreting or rendering certain characters. For example, the browser's character encoding settings or language preferences could be influencing how the response from the model is displayed.

Could you try using AttackGen from a different browser or machine to see if you still get the same error?

Chrome MacOS

image

Safari MacOS
image

Can u share with me about create a Threat Group Scenarios with step by step. Maybe i made a mistake when i try to usage.

It's really straightforward, so I don't think you could be making a mistake when trying to generate a scenario. Here's a quick walkthrough of me generating a Threat Group Scenario. I was using Safari on MacOS when recording the video (about 10 minutes ago).

https://www.canva.com/design/DAGBFtXSoQU/FpGfF5jDaG_Xu8SXUuuKVw/watch?utm_content=DAGBFtXSoQU&utm_campaign=designshare&utm_medium=link&utm_source=editor

One thing I noticed in your screenshots is that you seem to have Google Translate running? Could you try disabling all browser / plugins extensions and then testing again?

Thank you for sharing the steps with me. After removing the plugins and trying again, I got the same error. When I installed Opera and tried it through Opera, I got the same error again.

I checked my API key. When I enter any different random API key, another error occurs. It has nothing to do with my fault. I'm wondering what the problem could be. I've never encountered a bug like this before. Have you set any ".env" configuration for Attackgen on your device? I can't think of anything else.

You can watch the error I get with Opera from the Video Link.

Hi again @mrwadams

I found the problem. This error occurs if characters such as "£" are given in the API key. I solved the problem by regenerating the API key. Thank you very much.

Glad you managed to resolve it! Which model provider were / are you using?