Customizing Kali Linux and Setting Up Shell GPT
- Log into Kali Linux
- Open terminal
- Update system:
sudo apt update
sudo apt -y upgrade
pwd
: Print working directoryls
: List filesls -l
: Detailed file listingls -lah
: Show hidden files, and human-readable sizescd
: Change directorymkdir
: Make directory
Create necessary directories:
mkdir ~/repos
cd ~/repos
mkdir notes
Install Git and btop:
sudo apt install git btop
Check if OpenSSH is installed:
sudo apt install openssh-server
Enable and start SSH service:
sudo systemctl enable ssh
sudo systemctl start ssh
sudo systemctl status ssh
- Install OpenSSH Client and Server:
- Generate SSH key (open PowerShell as admin):
ssh-keygen
- On Kali, create .ssh directory:
mkdir ~/.ssh
- Copy SSH key from Windows to Kali (run in PowerShell):
type $env:USERPROFILE\.ssh\id_rsa.pub | ssh username@ip_address "cat >> ~/.ssh/authorized_keys"
-
Download and install Cursor IDE from: https://cursor.sh/
-
Open Cursor IDE
-
Connect to remote host (Kali Linux VM)
-
Navigate to the
~/repos/notes
directory
- Install Shell GPT:
python3 -m pip install shell-gpt
For more information, visit the Shell GPT GitHub repository: https://github.com/TheR1D/shell_gpt
- Add Shell GPT to PATH:
export PATH=$PATH:~/.local/bin
-
Get OpenAI API key from: https://platform.openai.com/api-keys
-
Run Shell GPT for the first time:
sgpt "Please introduce yourself"
- Enter your OpenAI API key when prompted
Basic usage:
sgpt "Your question or command here"
For generating commands:
sgpt -s "Describe the command you want"
Example:
sgpt -s "run an nmap scan on the top 1000 ports on 10.10.10.10 and output in XML"
This will generate the nmap command, which you can then execute, describe, or abort.
- Use the up arrow key to access previously run commands in the terminal
- Use the
history
command to see a list of all commands run in the current session btop
is a system monitoring tool that can be used to view CPU, memory, and process information
- Cursor IDE: https://cursor.sh/
- Shell GPT GitHub Repository: https://github.com/TheR1D/shell_gpt
- OpenAI API Keys: https://platform.openai.com/api-keys