Giter Club home page Giter Club logo

hackerbot's Introduction

hackerBot

An AI-CyberSecurity Bot Based on OpenAI's Models. hackerbot is being trained to do various Cyber Security tasks. You can either run hackerBot in a docker container (the fast option) or install it locally

Skills

Skill Tools Status
aws cli aws cli Beta
Port Scanning nmap Beta
Netcat nc Beta
Reading AWS logs Using LangChain Agent and AWS CloudWatch tool (CWTOOL) Beta

Run in Docker

The easiest way to run hackerBot is to run it inside a docker container. Set your secrets and run the command below:

sudo docker run -w /home/hb/hackerbot/ \
-e SERPAPI_API_KEY=<SERPAPI_API_KEY> \
-e OPENAI_API_KEY=<OPENAI_API_KEY> \
-e CWTOOL_LOG_GROUPS=cloudtrail,vpcflow \
-e CWTOOL_REGION=us-east-1 \
-ti ahmedag/hackerbot python hb.py

Dockerfile is at docker/Dockerfile

Manual Setup

Instead of using the docker image, you can set your own environment.

  • Clone the repo
git clone https://github.com/Ahmed-AG/hackerbot.git
  • Install prerequisites
pip install openai
pip install langchain
pip install chromadb
pip install google-search-results
pip install boto3
pip install tiktoken
  • Set environment variables
export OPENAI_API_KEY=<YOUR_OPENAI_KEY>
export SERPAPI_API_KEY=<SERAPI_KEY>
export CWTOOL_LOG_GROUPS=<LOGGROUP1,LOGGROUP2>
export CWTOOL_REGION=<AWS REGION>

Use

hackerBot will examine the first word of the user's input. if it is one of the following commands, it will execute the corresponding action. Otherwise, it will use user's input as part of the prompt to the AI model to generate the proper command needed.

Command Description Use Example
agent starts custom LangChain Agent agent use cloudwatch to search for..
go Executes the command last generated. Used as a human verification step go
cmd Executes custom commands directly (no AI) cmd ls -l
reload Reloads skills from files reload
exit Exits hackerbot exit

Examples

Search CloudWatch Logs

python hb.py
hb>agent use cloudwatch to find out the IP addresses used by admin

alt text

Showing instances

python hb.py
hb>show me instances in us-east-2. display instance ID, instance name, and AMi in a table

alt text

Scanning an IP address

python hb.py
hb>scan 8.8.8.8 for ports less than 1000 and run services scan

alt text

Run commands directly (no AI)

$ python hb.py
hb>cmd python --version
Python 3.10.8

Support

To report a bug, request a feature, or submit a suggestion/feedback, please submit an issue through the GitHub repository: https://github.com/Ahmed-AG/hackerbot/issues/new

Privacy Disclaimer

By default, hackerBot logs the human requests as well as the AI generated responses to a remote location. This is to enhance the skills. If you want to disable this feature run hackerBot with --stats-off

python hb.py --stats-off

hackerbot's People

Contributors

ahmed-ag avatar

Stargazers

Bang Juwon(方ジュウォン) avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.