{"id":48140030,"url":"https://github.com/adityamiskin/loki","last_synced_at":"2026-04-04T16:50:53.791Z","repository":{"id":327514050,"uuid":"990767929","full_name":"adityamiskin/loki","owner":"adityamiskin","description":"AI-powered CTF solver and security analysis assistant ","archived":false,"fork":false,"pushed_at":"2025-12-27T11:00:30.000Z","size":564,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-28T01:23:25.128Z","etag":null,"topics":["ai","ctf","cybersecurity","tui"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adityamiskin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-26T15:50:05.000Z","updated_at":"2025-12-27T11:00:34.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/adityamiskin/loki","commit_stats":null,"previous_names":["adityamiskin/loki"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/adityamiskin/loki","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityamiskin%2Floki","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityamiskin%2Floki/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityamiskin%2Floki/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityamiskin%2Floki/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adityamiskin","download_url":"https://codeload.github.com/adityamiskin/loki/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityamiskin%2Floki/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31406373,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","ctf","cybersecurity","tui"],"created_at":"2026-04-04T16:50:53.702Z","updated_at":"2026-04-04T16:50:53.780Z","avatar_url":"https://github.com/adityamiskin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Loki\n\n**Loki** is an advanced AI-powered CTF (Capture The Flag) solver and security analysis assistant that combines the intelligence of Google's Gemini Flash model with a comprehensive suite of cybersecurity tools. Built with a modern terminal user interface (TUI), Loki helps security researchers, penetration testers, and CTF enthusiasts identify vulnerabilities, analyze code, and solve security challenges.\n\n## Features\n\n### 🤖 AI-Powered Analysis\n\n- **Intelligent Security Analysis**: Leverages Google Gemini Flash to reason about vulnerabilities, attack vectors, and security flaws\n- **Expert-Level Reasoning**: Trained to think like a world-class security analyst, identifying bugs, logic errors, and common CVE-like vulnerabilities\n- **Interactive TUI**: Beautiful terminal interface built with React and OpenTUI for seamless interaction\n\n### 🛠️ Comprehensive Tool Suite\n\nLoki includes a powerful set of security tools organized into several categories:\n\n#### 1. **Reconnaissance \u0026 OSINT**\n\n- Subdomain enumeration (Amass)\n- DNS interrogation (A, AAAA, MX, TXT, NS, SOA, CNAME records)\n- WHOIS lookups\n- Search engine dorking (Google, Bing, DuckDuckGo, Shodan, Censys)\n- Certificate transparency search (crt.sh)\n- Shodan and Censys integration\n\n#### 2. **Scanning \u0026 Enumeration**\n\n- Port scanning (Nmap, Masscan, RustScan)\n- Web directory bruteforcing (Gobuster, ffuf)\n- Web vulnerability scanning (OWASP ZAP)\n- Network vulnerability scanning\n- Service version detection\n\n#### 3. **Exploitation**\n\n- Metasploit Framework integration\n- SQL injection exploitation (SQLMap)\n- XSS fuzzing and testing\n- Custom exploit module execution\n\n#### 4. **Code Analysis**\n\n- Static Application Security Testing (SAST) with Semgrep\n- CodeQL analysis for multiple languages\n- Secret discovery (Bandit, TruffleHog)\n- Dependency vulnerability checking\n- Source code security analysis\n\n#### 5. **Local Shell Access**\n\n- Execute shell commands directly\n- File system exploration\n- System information gathering\n- Custom tool execution\n\n## Installation\n\n### Prerequisites\n\n- [Bun](https://bun.sh) (JavaScript runtime)\n- Node.js 18+ (if not using Bun)\n- Python 3.8+ (for Python tools)\n- Google API key for Gemini\n\n### Setup\n\n1. **Clone the repository**\n\n   ```bash\n   git clone \u003crepository-url\u003e\n   cd ctf-solver\n   ```\n\n2. **Install dependencies**\n\n   ```bash\n   bun install\n   ```\n\n3. **Configure environment variables**\n\n   Create a `.env` file in the root directory:\n\n   ```bash\n   GOOGLE_GENERATIVE_AI_API_KEY=your_api_key_here\n\n   # Optional: For advanced features\n   SHODAN_API_KEY=your_shodan_key\n   CENSYS_UID=your_censys_uid\n   CENSYS_SECRET=your_censys_secret\n   MSF_USER=metasploit_user\n   MSF_PASSWORD=metasploit_password\n   ```\n\n4. **Install Python dependencies** (for Python tools)\n   ```bash\n   pip install -r requirements.txt  # If available\n   # Or install individually:\n   pip install fastmcp dnspython python-whois requests shodan pymetasploit3 python-nmap\n   ```\n\n## Usage\n\n### Starting Loki\n\n```bash\nbun dev\n```\n\nThis will:\n\n- Start the local chat API server on `http://localhost:3001`\n- Launch the TUI interface\n- Connect to Google Gemini Flash model\n\n### Health \u0026 Diagnostics\n\n- Query `GET /health` for a structured status payload that now includes log summaries, skill-loading insights, and helpful recovery notes.\n- Use `GET /logs?level=info` to stream recent log entries when debugging issues reported by the diagnostics block.\n\n### Using the Interface\n\n- **Type your query**: Enter your security question, CTF challenge description, or analysis request\n- **Press Enter**: Submit your message\n- **Press ESC**: Stop the current operation or exit the application\n- **Ctrl+C**: Exit the application\n\n### Example Queries\n\n- _\"Analyze this code for SQL injection vulnerabilities: [code snippet]\"_\n- _\"Perform a port scan on 192.168.1.100\"_\n- _\"Enumerate subdomains for example.com\"_\n- _\"Find secrets in this codebase: /path/to/code\"_\n- _\"Help me solve this CTF challenge: [description]\"_\n\n### Skill Integration\n\n- **Enable the feature** by setting `LOKI_SKILLS=true` before starting Loki.\n- **Skill files** now live inside this repo under `skills/**/SKILL.md` by default, so you can keep your procedural knowledge versioned alongside Loki. Each file needs YAML front matter with `name` (≤100 chars) and `description` (≤500 chars); the body remains on disk until the skill is triggered.\n- **Custom directories** are supported via `LOKI_SKILLS_DIR=/path/to/skills` if you want to relocate skills elsewhere.\n- **Loki lists** each discovered skill in the runtime prompt so the agent can mention available helpers without loading their full bodies.\n- **Invalid skill files** are skipped with a warning logged in the terminal; fix the front matter and restart to reload them.\n\n## Architecture\n\nLoki is built with:\n\n- **Frontend**: React + OpenTUI for the terminal interface\n- **Backend**: Bun runtime with a local Pi agent and lightweight health/log HTTP endpoints\n- **AI Model**: OpenAI GPT-5.1 via `@mariozechner/pi-agent-core` and `@mariozechner/pi-ai`\n- **Tools**: Modular tool system supporting both TypeScript and Python tools\n- **Communication**: Direct in-process agent events for chat interactions\n\n## Tool Integration\n\nLoki uses a flexible tool system that allows the AI to:\n\n1. **Execute shell commands** via the `local_shell` tool\n2. **Call Python tools** for specialized security operations (recon, scanning, exploitation, analysis)\n3. **Chain operations** together to perform complex security assessments\n\nThe AI automatically selects and uses the appropriate tools based on your queries.\n\n## Security Considerations\n\n⚠️ **Important**: Loki is designed for authorized security testing and educational purposes only.\n\n- Only use Loki on systems you own or have explicit permission to test\n- Be aware that some tools (port scanning, exploitation) may be illegal if used without authorization\n- Always follow responsible disclosure practices\n- Review and understand what commands Loki executes before running them\n\n## Contributing\n\nContributions are welcome! Please feel free to submit issues, feature requests, or pull requests.\n\n## License\n\n[Add your license here]\n\n## Acknowledgments\n\n- Built with [OpenTUI](https://github.com/opentui-org/opentui) for the terminal interface\n- Powered by [Vercel AI SDK](https://sdk.vercel.ai/) and Google Gemini\n- Inspired by the CTF and security research community\n\n---\n\n**Happy Hacking! 🚀**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadityamiskin%2Floki","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadityamiskin%2Floki","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadityamiskin%2Floki/lists"}