πŸ€– How I Integrated Kali Linux and DeepSeek (Local AI) to Build a Self-Defending Security Bot for MyZubster A developer integrated Kali Linux penetration testing tools with a local DeepSeek AI model to build an autonomous security bot for MyZubster, a decentralized marketplace. The bot scans the gateway hourly using nmap, nikto, and sqlmap, analyzes results with DeepSeek R1:1.5B running on Ollama, and automatically blocks suspicious IPs, suspends users, or cancels orders. The system runs entirely locally to ensure privacy and zero ongoing costs. πŸ€– How I Integrated Kali Linux and DeepSeek Local AI to Build a Self-Defending Security Bot for MyZubster A step-by-step guide on why and how I combined penetration testing tools with local AI to protect a decentralized marketplace. 🧠 Introduction MyZubster is a decentralized marketplace where users tokenize real‑world assets and trade them using Monero XMR payments. But any platform handling tokens, transactions, and sensitive user data must be secure. Instead of relying on passive security measures or expensive third‑party APIs, I decided to build an autonomous security bot that: Scans the gateway every hour using Kali Linux tools nmap, nikto, sqlmap . Analyzes the results with a local AI model DeepSeek R1:1.5B running on Ollama . Acts automatically: blocks suspicious IPs, suspends users, cancels open orders. Everything runs locally – zero data shared with third parties, zero ongoing costs. πŸ” Why Kali Linux? Kali Linux is the de‑facto standard for security auditing and penetration testing. It bundles over 600 pre‑installed tools for network scanning, web application testing, and forensics. In MyZubster, I use: nmap – to scan open ports on the gateway. nikto – to check for common web vulnerabilities. sqlmap – to detect SQL injection risks. All tools are integrated into a single Python script that runs automatically. Benefits of Kali Linux in MyZubster βœ… Reliable – battle‑tested tools trusted by security professionals. βœ… Up‑to‑date – actively maintained by the Kali community. βœ… Modular – I can easily add or remove tools. βœ… Containerizable – I run Kali inside a Docker container, isolated from the main system. 🧠 Why DeepSeek Local ? For log analysis, I didn't want to use external APIs e.g., OpenAI for two main reasons: Privacy – logs may contain sensitive information about users and transactions. Cost – continuous analysis would incur significant recurring fees. I chose DeepSeek R1:1.5B running locally via Ollama: βœ… Zero cost – no API keys, no credit usage. βœ… Total privacy – data never leaves the server. βœ… Fast response – the model is lightweight and CPU‑optimised. βœ… Customisable – I can tailor prompts to produce structured reports. πŸ—οΈ System Architecture text β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ MyZubster Server β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ Gateway Node.js + Express β”‚ β”‚ β”‚ β”‚ - REST API β”‚ β”‚ β”‚ β”‚ - JWT Authentication β”‚ β”‚ β”‚ β”‚ - MongoDB models β”‚ β”‚ β”‚ β”‚ - PaymentMonitor Monero β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β–² β”‚ β”‚ β”‚ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ Security Bot Python β”‚ β”‚ β”‚ β”‚ - Runs nmap / nikto / sqlmap β”‚ β”‚ β”‚ β”‚ - Calls DeepSeek via internal API β”‚ β”‚ β”‚ β”‚ - Executes actions: block IP, suspend user, cancel orderβ”‚ β”‚ β”‚ β”‚ - Logs everything to /var/log/security bot.log β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β–² β”‚ β”‚ β”‚ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ DeepSeek Ollama β”‚ β”‚ β”‚ β”‚ - Model: deepseek-r1:1.5b β”‚ β”‚ β”‚ β”‚ - Local API on http://localhost:11434 http://localhost:11434 β”‚ β”‚ β”‚ β”‚ - Analyses logs and returns structured reports β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ πŸ› οΈ Implementation Steps 1️⃣ Install Kali Tools bash apt update apt install nmap nikto sqlmap -y 2️⃣ Install Ollama and Pull DeepSeek bash curl -fsSL https://ollama.com/install.sh https://ollama.com/install.sh | sh ollama pull deepseek-r1:1.5b 3️⃣ Python Security Bot security bot.py The bot logs into MyZubster, runs nmap, sends the output to DeepSeek, and takes action. python import subprocess import requests import json MYZUBSTER API = " http://localhost:3000/api http://localhost:3000/api " def login : resp = requests.post f"{MYZUBSTER API}/auth/login", json={"email":" test@example.com mailto:test@example.com ","password":"Test123 "} return resp.json .get 'token' def ask deepseek prompt : resp = requests.post f"{MYZUBSTER API}/ai/ask", json={"prompt": prompt}, headers={'Authorization': f'Bearer {TOKEN}'} return resp.json .get 'response' def scan gateway : result = subprocess.run 'nmap', '-p', '3000,80,443', 'localhost' , capture output=True, text=True return result.stdout def block ip ip : subprocess.run 'ufw', 'deny', 'from', ip , check=False 4️⃣ Node.js Service for DeepSeek Integration deepseekService.js javascript const axios = require 'axios' ; const OLLAMA URL = ' http://localhost:11434/api/chat http://localhost:11434/api/chat '; const MODEL NAME = 'deepseek-r1:1.5b'; async function askDeepSeek prompt { const response = await axios.post OLLAMA URL, { model: MODEL NAME, messages: { role: 'user', content: prompt } , stream: false } ; return response.data.message.content; } 5️⃣ Automate with Cron Every Hour bash crontab -e 0 /usr/bin/python3 /root/security bot.py /var/log/security bot.log 2 &1 πŸ§ͺ Example Output text πŸ” Login to MyZubster... πŸ” Starting security scan... πŸ“Š Scan completed. Sending to DeepSeek for analysis... MyZubster Security Report Open ports detected: Potential vulnerabilities: Recommendations: βœ… Benefits of This Integration Feature Advantage Automation Scans and analysis run without manual intervention Privacy Data never leaves the server Cost Zero API costs DeepSeek is local Reactivity Immediate actions when a threat is detected Customisability I can extend tools and AI prompts as needed πŸš€ Next Steps Add more Kali tools – nikto, sqlmap, gobuster. Telegram/Email webhooks – get notified when the bot detects a threat. Security dashboard – visualise reports in real time. Predictive analysis – use DeepSeek to forecast potential attacks. πŸ“Œ Conclusion Kali Linux and DeepSeek are not competing tools – they complement each other perfectly: Kali provides the means to detect threats. DeepSeek provides the intelligence to interpret data and decide on actions. Together, they turn MyZubster into a self‑defending platform that proactively protects itself and its users. πŸ”— Resources GitHub: DanielIoni-creator/MyZubsterGateway Live Demo: https://myzubster.com Ollama: https://ollama.com Kali Linux: https://www.kali.org Built with ❀️ by the MyZubster team. 🏷️ Tags