HackList Doc: AI-Powered Cybersecurity Project Guide

As a beginner in cybersecurity, one thing that can make you stand out from others and get you steady on your path faster is working on projects.

This tool helps you become better by suggesting cybersecurity projects relevant to different paths in cybersecurity with just a single query.

It doesn’t just stop there; it also presents to you GitHub repos, tutorials, and materials to run these projects.

You can run this tool on your computer using any of the three methods. This is a detailed guide on how to set up.

The three methods are:

The Docker Method, the Local Installation method, and the setup script.

This guide will walk you through the three methods, so you can follow the steps for whichever method you choose.

Before we begin, this project was built by Abigail Inyang, an Application Security Engineer. Check out here GitHub here.

The Docker Method

Install Docker if you don’t already have it installed. If you are a Windows user, follow here; if you are a Linux user, follow here; if you are a Mac user, follow here.

After you are done with the Docker installation and setup, open it in terminal mode.

Following the steps from the GitHub README:

Pull the image from Docker:

docker pull abigaila11/hacklist:latest

Set up environment variables:

cp env_example.txt .env

Open .env and add your API keys(Reference the Local Installation Method for how to get your OpenAI API and Serper API keys).

nano .env for UNIX-based and notepad .env for Windows

NOTE: You can use whatever text editor you wish; I simply used the default for Windows and UNIX-based systems. This applies to all use of text editors in this project set up.

Run the container:

Open your browser and go to http://localhost:8501 or follow the options on the screen as seen below:

Using the Local Installation Method

This looks straightforward, but you may experience issues, which I will focus on here.

The first thing is to clone the repository on an Administrator Powershell or with sudo if you are using a UNIX-based system like Linux or MacOS.

Using Administrator PowerShell:

git clone https://github.com/abigailajohn/HackList

Once that is done, navigate to the HackList directory via:

cd HackList

Using sudo:

sudo git clone https://github.com/abigailajohn/HackList

Once that is done, navigate to the HackList directory via:

cd HackList

Right within the HackList directory, install the necessary dependencies with:

pip install -r requirements.txt

NOTE: This project is built with Python, so you must have Python 3.7 or later on your computer to run this project.

Set up your environment variables with:

cp env_example.txt .env

Next up, you need to edit the .env file created with the last command above:

On Administrator PowerShell, run

notepad .env

Using sudo run:

nano .env

This will open a text editor with something like this:

Getting your API keys

To get your OpenAI API keys, go to https://platform.openai.com, log in or sign up for free, then navigate to the menu, click on API Keys, or alternatively, just type in platform.openai.com/api-keys if you already have an account. Copy your key and paste it after the equals sign, ensuring that the preset parameter is replaced completely.

For Serper API keys, go to https://server.dev, log in or create an account for free, access your keys from the menu, copy and like you did for the OpenAI key, paste it on your .env file. Ensure you save using CTRL + S for Windows and CTRL/CMD + O, ENTER, then CTRL/CMD + X for Linux/Mac.

Head back to your terminal, and type in:

streamlit run app.py

Running the above command will open your web browser on localhost, port 8501. This is where you can run your AI Cybersecurity Guide.

Troubleshooting:

Sometimes, Streamlit may not run. This is due to two possible reasons.

  1. Streamlit is not running on the system path (Often found with Windows users)

  2. Streamlit is not installed or is installed improperly.

To fix these, type in Environment Variables on your search bar, open it, click on Environment Variables, and click on NEW, add the full path of your Streamlit installation

(Find the full path using:

python -m site --user-base, it should be under the scripts subfolder under the Python directory like this: .C:\Users\Chisom\AppData\Roaming\Python\Python312\Scripts OR you can inspect the logs from when you ran pip install -r requirements.txt, if Streamlit is installed at all, its path should be there.

If you don’t find it, install it using:

pip install streamlit

Once you have verified that it is installed and you have the full path, on your Environment Variables, paste the full path, add a name for it, then click on OK till all pop-ups close.

Go back to your terminal and run the command again: streamlit run app.py

While the fix given above is permanent, if you don’t intend to have Streamlit on your path, or go through this long process, skip the entire process and use this command to run your HackList app whenever you wish:

python -m streamlit run app.py

This will open the webpage:

The Setup Script

This method helps you handle some of the processes, with its inbuilt script that runs on the Command Line.

To use this method, begin by cloning the repository using this command:

git clone https://github.com/abigailajohn/HackList

Then navigate into the repo:

cd HackList

After that, just as you did with the method above, edit your .env file with your OpenAPI key and Serper key.

Reference the guide for Local Installation setup for how to get your API keys.

Once you are done, on your terminal, type in:

python setup.py install

This should install all necessary dependencies, and when it is done, type in

python agent.test.py

20
Subscribe to my newsletter

Read articles from Joseph Chisom Ofonagoro directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Joseph Chisom Ofonagoro
Joseph Chisom Ofonagoro

Hi there! I am a curious techie. My spare time is spent with books.