_ _ _ ____ _
| | | | __ _ ___| | _| __ ) ___ | |_
| |_| |/ _` |/ __| |/ / _ \ / _ \| __| By: Morpheuslord
| _ | (_| | (__| <| |_) | (_) | |_ AI used: Meta-LLama2
|_| |_|\__,_|\___|_|\_\____/ \___/ \__|
介绍
欢迎使用 HackBot,这是一个由人工智能驱动的网络安全聊天机器人,旨在为您的网络安全相关查询提供有用且准确的答案,并进行代码分析和扫描分析。无论您是安全研究人员、道德黑客,还是只是对网络安全感到好奇,HackBot 都可以帮助您找到所需的信息。
HackBot 通过“LlamaCpp”库利用强大的语言模型 Meta-LLama2。这使得 HackBot 能够以连贯且相关的方式回答您的问题。请确保您的查询使用英语并遵守提供的指南,以便从 HackBot 获得最佳结果。
特征
- 本地 AI/ Runpod 部署支持:我添加了一个选项,您可以使用它轻松部署 Hackbot 聊天界面并通过 2 种方式使用 llama:
- 使用 RunPod:
AI_OPTION
您可以使用 llama 的 runpod 无服务器端点部署,并通过更改.env 文件中的Runpod you need to use RUNPOD
和部分将它们连接到聊天机器人Local Llama deployment LOCALLLAMA
。RUNPOD
&LOCALLLAMA
- 要点:要使 llama 的 runpod 版本正常工作,您需要确保
RUNPOD ID
和RUNPOD API KEY
已设置。 - AI网络安全聊天: HackBot可以回答各种网络安全相关的查询,帮助您进行渗透测试、安全分析等。
- 交互界面:聊天机器人提供了交互式命令行界面,可以轻松与HackBot进行对话。
- 清晰的输出: HackBot 以格式良好的降价形式呈现其响应,提供易于阅读和组织的答案。
- 静态代码分析:利用提供的扫描数据或日志文件进行静态代码分析。它会彻底检查源代码而不执行源代码,识别潜在的漏洞、编码错误和安全问题。
- 漏洞分析:使用提供的扫描数据或日志文件执行全面的漏洞分析。它识别和评估目标系统或网络中存在的安全弱点、错误配置和潜在的漏洞。
看起来怎么样
使用
使用 LLama2 是最好的离线和免费选项之一。目前正在改进,我正在研究一个提示,以更好地将网络安全视角融入人工智能中。我必须感谢@thisserand和他的llama2_local存储库以及他的 YT 视频YT_Video。他们是很好的资源。坦率地说,llama2 代码 95% 是他的,我只是删除了代码并为其添加了 Flask API 功能。
离线和代码测试之外的人工智能的准确性非常好,并且与 openai 或 bard 具有相同的准确性,但在代码中它面临一些问题,可能是由于提示等原因。我会尝试修复它。速度取决于您的系统以及您拥有的 GPU 和 CPU 配置。目前,它正在使用该TheBloke/Llama-2-7B-Chat-GGML
模型,并且可以通过portscanner
和dnsrecon
文件进行更改。
目前,美洲驼代码和扫描的处理方式有所不同。经过几次测试后,我发现 llama 需要接受一些训练才能像我想要的那样工作,所以它需要一些时间。有关如何做到这一点的任何建议都可以添加到此存储库讨论链接的讨论中。目前,输出不会是所有数据的划分列表,而是对人工智能发现的漏洞或问题的解释。
模型使用的提示如下所示:
[INST] <<SYS>> {user_instruction}<</SYS>> NMAP Data to be analyzed: {user_message} [/INST]
指令看起来像这样:
Do a NMAP scan analysis on the provided NMAP scan information. The NMAP output must return in a asked format accorging to the provided output format. The data must be accurate in regards towards a pentest report.
The data must follow the following rules:
1) The NMAP scans must be done from a pentester point of view
2) The final output must be minimal according to the format given.
3) The final output must be kept to a minimal.
4) If a value not found in the scan just mention an empty string.
5) Analyze everything even the smallest of data.
6) Completely analyze the data provided and give a confirm answer using the output format.
7) mention all the data you found in the output format provided so that regex can be used on it.
8) avoid unnecessary explaination.
9) the critical score must be calculated based on the CVE if present or by the nature of the services open
10) the os information must contain the OS used my the target.
11) the open ports must include all the open ports listed in the data[tcp] and varifying if it by checking its states value. you should not negect even one open port.
12) the vulnerable services can be determined via speculation of the service nature or by analyzing the CVE's found.
The output format:
critical score:
- Give info on the criticality
"os information":
- List out the OS information
"open ports and services":
- List open ports
- List open ports services
"vulnerable service":
- Based on CVEs or nature of the ports opened list the vulnerable services
"found cve":
- List the CVE's found and list the main issues.
使用指令集和通过提示提供的数据,llama AI 生成其输出。
对于大多数用法,我建议您创建 llama 的 runpod 无服务器端点部署,您可以参考本教程以获取该教程。按照教程更好地使用。
聊天:
![图片[1]-HackBot:一个人工智能网络安全聊天机器人-IT熊技术站](https://www.cutrui.cn/wp-content/uploads/2023/09/image-19-1024x515.png)
静态代码分析:
![图片[2]-HackBot:一个人工智能网络安全聊天机器人-IT熊技术站](https://www.cutrui.cn/wp-content/uploads/2023/09/image-20-1024x370.png)
漏洞分析:
![图片[3]-HackBot:一个人工智能网络安全聊天机器人-IT熊技术站](https://www.cutrui.cn/wp-content/uploads/2023/09/image-21-1024x321.png)
安装
先决条件
在继续安装之前,请确保满足以下先决条件:
- Python(3.11 或更高版本)
pip3
包管理器Visual studio Code
– 按照此链接llama-cpp-prereq-install-instructions中的步骤操作cmake
第 1 步:克隆存储库
git clone https://github.com/morpheuslord/hackbot.git
cd hackbot
第2步:安装依赖项
pip3 install -r requirements.txt
第三步:下载AI模型
python3 hackbot.py
第一次运行 HackBot 时,它将检查聊天机器人所需的 AI 模型。如果模型不存在,则会自动下载并在项目目录中保存为“llama-2-7b-chat.ggmlv3.q4_0.bin”。
用法
要开始与 HackBot 对话,请运行以下命令:
对于本地 LLama 用户
该.env
文件必须如下所示:
RUNPOD_ENDPOINT_ID = ""
RUNPOD_API_KEY = ""
AI_OPTION = "LLAMALOCAL"
完成后运行这个:
python hackbot.py
对于 RunPod LLama 用户
该.env
文件必须如下所示:
RUNPOD_ENDPOINT_ID = "<<SERVERLESS ENDPOINT ID>>"
RUNPOD_API_KEY = "<<RUNPOD API KEY>>"
AI_OPTION = "RUNPOD"
完成后运行这个。
python3 hackbot.py
HackBot 将显示一个横幅并等待您的输入。您可以提出与网络安全相关的问题,HackBot 会提供信息丰富的答案。要退出聊天,只需在输入提示中键入“quit_bot”即可。
以下是您可以使用的一些附加命令:
clear_screen
:清除控制台屏幕以获得更好的可读性。quit_bot
:用于退出聊天应用程序bot_banner
:打印默认的机器人横幅。contact_dev
: 提供我的联系信息。save_chat
:保存当前会话交互。vuln_analysis
:使用扫描数据或日志文件进行漏洞分析。static_code_analysis
:使用扫描数据或日志文件进行静态代码分析。
注意:我正在开发更多插件和更多此类命令,以提供更多的 chatGPT 体验
请注意: HackBot 的响应基于 Meta-LLama2 AI 模型,其准确性取决于提供给它的查询和数据的质量。
我还致力于人工智能培训,通过它我可以教它如何更准确地调整,以更专业的水平为黑客工作。
项目地址
HackBot:【GitHub】
暂无评论内容