More Guides will be available soon, Stay tuned!
What if your terminal could:
• Interpret Nmap scans
• Summarize new CVEs
• Write PoC exploits
Meet "ai-hack" - your local AI-powered shell assistant.
This function lives in your .zshrc and gives your command line instant access to DeepSeek-Coder insights. Let’s build it.
Open your terminal and run:
$ nano ~/.zshrc
Then paste the following function:
# AI hack
ai-hack() {
# === Colors ===
RED="\033[1;31m"
GREEN="\033[1;32m"
YELLOW="\033[1;33m"
BLUE="\033[1;34m"
MAGENTA="\033[1;35m"
CYAN="\033[1;36m"
RESET="\033[0m"
# === API Key (Replace this!) ===
local api_key="Your-API-Goes-Here"
# === Get input (argument or piped) ===
if [ -t 0 ]; then
local input="$*"
else
local input=$(cat /dev/stdin)
fi
# === Use DeepSeek API for live info ===
if [[ "$input" == *"CVE"* || "$input" == *"latest"* || "$input" == *"exploit"* || "$input" == *"news"* ]]; then
echo "${CYAN}[+] Querying DeepSeek API for live data...${RESET}"
curl -s -X POST "https://api.deepseek.com/v1/chat/completions" \
-H "Authorization: Bearer $api_key" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-chat",
"messages": [{"role": "user", "content": "'"$input"'"}]
}' | jq -r '.choices[0].message.content' | tee /tmp/ai_response.txt
return
fi
# === Otherwise use local DeepSeek-Coder via Ollama ===
echo "${GREEN}[+] Querying local DeepSeek-Coder...${RESET}"
local ai_response=$(ollama run deepseek-coder "$input")
# === Basic formatting ===
echo "${BLUE}=== AI RESPONSE ===${RESET}"
echo "$ai_response"
}
Save and close (Ctrl+X, then Y + Enter).
Reload your config:
$ source ~/.zshrc
( The same goes for bsharc)
## ⚡ Usage Examples:
1. Analyze Nmap Scan
nmap -sV 192.168.1.1 | ai-hack
2. Get the Latest CVEs
$ ai-hack "List recent critical CVEs"
3. Ask for Exploit Help
$ ai-hack "Write a Python exploit for CVE-2023-1234"
From here, all that's left is to just imagine and execute.
All the guides, tips, and tricks on this web site are for education purpose only, the website owner is not accountable for any use of this information