
IFRIT é um proxy reverso alimentado por IA que intercepta requisições recebidas em tempo real, classificando cada uma como legítima ou maliciosa. O tráfego legítimo é encaminhado ao backend; o tráfego malicioso recebe uma resposta personalizada de honeypot gerada por IA que imita o recurso solicitado com dados fabricados, enganando atacantes para que percam tempo com ela.
Transforme atacantes em fontes de inteligência com respostas adaptativas de honeypot
📦 Início Rápido • ✨ Funcionalidades • 🔄 Como Funciona • 📚 Documentação • 🔌 API
IFRIT é um proxy reverso inteligente que fica entre a internet e suas aplicações, analisando cada solicitação em tempo real. O tráfego legítimo flui sem problemas. Tráfego malicioso? Ele recebe respostas de honeypot geradas por IA que desperdiçam o tempo dos atacantes enquanto você coleta inteligência.
subgraph "IFRIT Proxy Layer"
B[🛡️ IFRIT Proxy]
subgraph "AI Detection Engine"
C1[🤖 Claude Sonnet 4]
C2[🤖 Gemini 2.0 Flash]
end
subgraph "Threat Intelligence"
D1[📊 AbuseIPDB]
D2[🦠 VirusTotal]
D3[🌍 IPInfo]
end
end
subgraph Backend
E[🎯 Your Application]
end
subgraph "Attacker Receives"
F[🍯 Fake Data<br/>Honeypot Response]
end
subgraph "User Receives"
G[📦 Real Data<br/>Protected]
end
A -->|Malicious Request| B
L -->|Normal Request| B
B --> C1
B --> C2
B --> D1
B --> D2
B --> D3
B -->|Attack Detected| F
B -->|Legitimate| E
E -->|Response| G
F -.->|Wasted Time| A
G -->|Secure Access| L
style A fill:#ff6b6b,stroke:#c92a2a,stroke-width:2px,color:#fff
style L fill:#51cf66,stroke:#2f9e44,stroke-width:2px,color:#fff
style B fill:#4c6ef5,stroke:#364fc7,stroke-width:3px,color:#fff
style C1 fill:#845ef7,stroke:#5f3dc4,stroke-width:2px,color:#fff
style C2 fill:#845ef7,stroke:#5f3dc4,stroke-width:2px,color:#fff
style D1 fill:#ff922b,stroke:#e8590c,stroke-width:2px,color:#fff
style D2 fill:#ff922b,stroke:#e8590c,stroke-width:2px,color:#fff
style D3 fill:#ff922b,stroke:#e8590c,stroke-width:2px,color:#fff
style E fill:#20c997,stroke:#12b886,stroke-width:2px,color:#fff
style F fill:#fa5252,stroke:#c92a2a,stroke-width:2px,color:#fff
style G fill:#51cf66,stroke:#2f9e44,stroke-width:2px,color:#fff
</details>
**Fluxo simplificado:**
<div align="center">
<img src="https://assets.kitploit.com/production/public/readmes/9318/20428ce8d35f40faaa17f7f8c313021a74af35675f384b2db7a60034dbfdcdf2.png" alt="Diagrama de Fluxo Simples do IFRIT" width="650">
</div>
</div>
---
## 🚀 Início Rápido
> **Comece a usar em menos de 2 minutos**
### 📦 Instalação
<table>
<tr>
<td width="50%">
**macOS (Apple Silicon)**```bash
curl -L -o ifrit-v0.3.2-darwin-arm64.tar.gz \
https://github.com/0tSystemsPublicRepos/IfritProxy/releases/download/v0.3.2/ifrit-v0.3.2-darwin-arm64.tar.gz
tar -xzf ifrit-v0.3.2-darwin-arm64.tar.gz
cd ifrit-v0.3.2-darwin-arm64
./install.sh
Linux (x64)```bash
curl -LO https://github.com/0tSystemsPublicRepos/\
IfritProxy/releases/download/v0.3.2/
ifrit-v0.3.2-linux-amd64.tar.gz
tar -xzf ifrit-v0.3.2-linux-amd64.tar.gz cd ifrit-v0.3.2-linux-amd64 ./install.sh
</td>
</tr>
</table>
<div align="center">

*Instalação em ação - é realmente simples assim!*
</div>
### ⚙️ Configuração (Configuração Rápida)```bash
# 1. Copy template
cp config/default.json.example config/default.json
# 2. Add your API keys
nano config/default.json # or use your favorite editor
Configuração mínima para começar:```json { "llm": { "provider": "claude", // 👈 Choose: "claude" or "gemini" "claude": { "api_key": "sk-ant-..." // 🔑 Get from console.anthropic.com } }, "proxy": { "listen_port": 8080, "backend_url": "http://localhost:3000" // 🎯 Your app } }
### 🎬 Lançamento
Compile o código-fonte ou Instale a partir dos binários disponíveis```bash
# Build the binary
go build -o ifrit ./cmd/ifrit
(optional: build ifrit-cli as well)
# Start IFRIT (runs in background)
./ifrit &
# 🎉 You're protected! Access dashboard:
open http://localhost:8443
É isso! O IFRIT agora está protegendo sua aplicação.
🧠 Inteligência Multi-IAEscolha seu provedor de IA ou deixe o IFRIT fazer fallback automático:
| |
🎭 Motor de Decepção AdaptativaRespostas inteligentes de honeypot que aprendem:
Exemplo: Injeção SQL obtém banco de dados de usuários falso, path traversal obtém listagens de arquivos falsas. |
🔍 Hub de Inteligência de AmeaçasEnriquecimento em tempo real a partir de múltiplas fontes:
|
Stage0 -->|✅ Whitelisted IP/Path| Allow[✅ ALLOW<br/>Pass to Backend]
Stage0 -->|❌ Not Whitelisted| Stage1{⚡ Stage 1<br/>Local Rules}
Stage1 -->|🎯 Attack Pattern Match| Honeypot[🍯 HONEYPOT<br/>Deceptive Response]
Stage1 -->|❓ Unknown Pattern| Stage2{💾 Stage 2<br/>Database Patterns}
Stage2 -->|📚 Known Attack| Honeypot
Stage2 -->|🆕 Novel Attack| Stage3{🤖 Stage 3<br/>LLM Analysis}
Stage3 -->|🚨 Attack Confirmed| Honeypot
Stage3 -->|✅ Legitimate| Allow
Honeypot --> TI[🔍 Threat Intelligence<br/>Enrichment]
TI --> Notify[📢 Notifications<br/>If Rules Match]
Notify --> Learn[📖 Learn & Store<br/>Pattern]
Allow --> Backend[🎯 Your Application]
Backend --> Response[📦 Real Response]
Learn --> LogAttack[(📊 Attack Database)]
style Start fill:#4c6ef5,stroke:#364fc7,stroke-width:3px,color:#fff
style Stage0 fill:#7950f2,stroke:#5f3dc4,stroke-width:2px,color:#fff
style Stage1 fill:#7950f2,stroke:#5f3dc4,stroke-width:2px,color:#fff
style Stage2 fill:#7950f2,stroke:#5f3dc4,stroke-width:2px,color:#fff
style Stage3 fill:#7950f2,stroke:#5f3dc4,stroke-width:2px,color:#fff
style Allow fill:#51cf66,stroke:#2f9e44,stroke-width:3px,color:#fff
style Honeypot fill:#ff6b6b,stroke:#c92a2a,stroke-width:3px,color:#fff
style TI fill:#ff922b,stroke:#e8590c,stroke-width:2px,color:#fff
style Notify fill:#fab005,stroke:#f08c00,stroke-width:2px,color:#fff
style Learn fill:#20c997,stroke:#12b886,stroke-width:2px,color:#fff
style Backend fill:#339af0,stroke:#1c7ed6,stroke-width:2px,color:#fff
style Response fill:#51cf66,stroke:#2f9e44,stroke-width:2px,color:#fff
style LogAttack fill:#868e96,stroke:#495057,stroke-width:2px,color:#fff
</details>
### 🎯 O que acontece após a detecção?
</br>
<div align="center">
<img src="https://assets.kitploit.com/production/public/readmes/9318/267273e580b8ba7e204c0143355ee44616af19be04d4232ca4831563e0dc1280.png" alt="What Happens After Detection" width="650">
</div>
### 🔬 Pipeline de Enriquecimento de Inteligência
Cada ataque detectado aciona **coleta paralela de inteligência** em segundo plano:
</br>
<div align="center">
<img src="https://assets.kitploit.com/production/public/readmes/9318/a0d1c286f17eeaa17f08371e683b9abc632c851cd664e931da99d1b344584ae8.png" alt="Intelligence Enrichment Pipeline" width="650">
</div>
**Características de Desempenho:**
| Cenário | Comportamento | Latência | Custo |
|----------|----------|---------|------|
| **Primeiro Ataque do IP** | Todas as 3 APIs chamadas | ~500ms | $0.003 |
| **Ataque Repetido (< 24h)** | Acerto de cache, nenhuma API | <10ms | $0.00 |
| **Após 24h** | Reenriquecer, atualizar cache | ~500ms | $0.003 |
**💡 Resultado:** 90%+ de taxa de acerto de cache = custos mínimos de API + consultas rápidas
### 💰 Aprendizado Econômico: Otimização de Custos
O IFRIT aprende com cada ataque, reduzindo drasticamente os custos operacionais:
<table>
<tr>
<th width="50%">⏰ Hora 1: Fase de Aprendizado Inicial</th>
<th width="50%">🚀 Hora 2: Operação Otimizada</th>
</tr>
<tr>
<td valign="top">
**Primeira Exposição**```
📊 Traffic Analysis
├─ 100 requests received
├─ 40 unique attack types
│
├─ 🤖 AI Calls Needed
│ ├─ Stage 3 LLM: 40 calls
│ └─ Cost: ~$0.12
│
├─ 🔍 Threat Intel APIs
│ ├─ 40 unique IPs
│ └─ Cost: ~$0.12
│
└─ 💾 Storage
├─ Learn all 40 patterns
├─ Cache threat intel (24h)
└─ Generate honeypots
📈 Total Cost: $0.24
O que aconteceu:
Inteligência em Cache``` 📊 Traffic Analysis ├─ 100 requests received ├─ Same 40 attack types │ ├─ 💾 Database Hits │ ├─ Stage 2: All 40 matched │ ├─ Response time: <10ms each │ └─ Cost: $0.00 │ ├─ 💰 Cache Hits │ ├─ Same 40 IPs │ ├─ Threat intel from cache │ └─ Cost: $0.00 │ └─ 🎯 Results ├─ Same quality detection ├─ Faster responses └─ Zero API costs
📉 Total Cost: $0.00
**O que aconteceu:**
- ✅ Taxa de cache hit de 100%
- ✅ Latência de 90ms → 10ms
- ✅ **100% de economia de custos!**
- ✅ Mesmo nível de proteção
</td>
</tr>
</table>
**📊 Cenário Real (30 Dias):**```
Day 1: 5,000 attacks, 200 unique → $6.00 in API costs
Day 2: 5,000 attacks, 150 new → $4.50 in API costs
Day 3: 5,000 attacks, 100 new → $3.00 in API costs
...
Day 7: 5,000 attacks, 50 new → $1.50 in API costs
Day 14: 5,000 attacks, 20 new → $0.60 in API costs
Day 30: 5,000 attacks, 10 new → $0.30 in API costs
Total: 150,000 attacks handled
Cost without caching: ~$450.00
Cost with IFRIT learning: ~$45.00
💰 Savings: $405.00 (90% reduction!)
Escolha sua filosofia de segurança: confie, mas verifique vs confiança zero
🎬 Modos de Execução:
Consulte DETECTION_MODES.md para comparação detalhada e casos de uso.
Acesse em http://localhost:8443/ com autenticação por token da API
Visão Geral do Dashboard:
O dashboard do IFRIT fornece visibilidade em tempo real da sua postura de segurança com:
Controle completo via linha de comando de sua inteligência de segurança:
API JSON para integração perfeita com sua stack de segurança
Integre o IFRIT com SIEM, ferramentas de monitoramento ou dashboards personalizados usando nossa API REST abrangente.
Todos os endpoints da API exigem autenticação via token de API:```bash
curl -H "X-API-Token: YOUR_TOKEN_HERE"
http://localhost:8443/api/...
**Gerando tokens de API:** Configure em `config/default.json` sob `api.tokens`
---
#### 📡 Endpoints Disponíveis
<details>
<summary><b>🚨 Inteligência de Ataques</b></summary>```bash
# Get recent attacks
curl -H "X-API-Token: YOUR_TOKEN" \
http://localhost:8443/api/attacks
# Get specific attack
curl -H "X-API-Token: YOUR_TOKEN" \
http://localhost:8443/api/attacks/42
# Filter by IP
curl -H "X-API-Token: YOUR_TOKEN" \
"http://localhost:8443/api/attacks?ip=45.67.89.1"
# Filter by date range
curl -H "X-API-Token: YOUR_TOKEN" \
"http://localhost:8443/api/attacks?from=2024-01-01&to=2024-01-31"
# Attack statistics
curl -H "X-API-Token: YOUR_TOKEN" \
http://localhost:8443/api/attacks/stats
Exemplo de Resposta:```json { "attacks": [ { "id": 42, "timestamp": "2024-01-15T14:23:45Z", "source_ip": "45.67.89.1", "attack_type": "sql_injection", "threat_level": "CRITICAL", "risk_score": 92, "detection_stage": 3, "path": "/api/users", "method": "POST" } ], "total": 1865, "page": 1 }
</details>
<details>
<summary><b>👤 Perfis de Atacantes</b></summary>```bash
# List all attackers
curl -H "X-API-Token: YOUR_TOKEN" \
http://localhost:8443/api/attackers
# Get specific attacker profile
curl -H "X-API-Token: YOUR_TOKEN" \
http://localhost:8443/api/attackers/45.67.89.1
# Top attackers
curl -H "X-API-Token: YOUR_TOKEN" \
"http://localhost:8443/api/attackers/top?limit=10"
Exemplo de Resposta:```json { "ip": "45.67.89.1", "first_seen": "2024-01-10T08:15:30Z", "last_seen": "2024-01-15T14:23:45Z", "total_attacks": 234, "attack_types": ["sql_injection", "path_traversal", "xss"], "risk_score": 87, "threat_level": "HIGH", "country": "CN", "is_vpn": false, "is_tor": false, "is_hosting": true }
</details>
<details>
<summary><b>🧬 Padrões Aprendidos</b></summary>```bash
# Get all patterns
curl -H "X-API-Token: YOUR_TOKEN" \
http://localhost:8443/api/patterns
# Get pattern by ID
curl -H "X-API-Token: YOUR_TOKEN" \
http://localhost:8443/api/patterns/15
# Add new pattern
curl -X POST \
-H "X-API-Token: YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"attack_type": "sql_injection",
"signature": "' OR 1=1--",
"confidence": 0.95
}' \
http://localhost:8443/api/patterns
curl -H "X-API-Token: YOUR_TOKEN"
"http://localhost:8443/api/threat-intel/top?limit=10"
curl -H "X-API-Token: YOUR_TOKEN"
http://localhost:8443/api/threat-intel/45.67.89.1
curl -X POST
-H "X-API-Token: YOUR_TOKEN"
http://localhost:8443/api/threat-intel/45.67.89.1/enrich
**Exemplo de Resposta:**```json
{
"ip": "45.67.89.1",
"risk_score": 87,
"threat_level": "HIGH",
"abuseipdb": {
"score": 91,
"total_reports": 156,
"last_reported": "2024-01-14T10:30:00Z"
},
"virustotal": {
"malicious": 3,
"suspicious": 1
},
"ipinfo": {
"country": "CN",
"city": "Shanghai",
"is_vpn": false,
"is_proxy": false,
"is_tor": false,
"is_hosting": true
},
"cached_at": "2024-01-15T14:23:45Z"
}
curl -X POST
-H "X-API-Token: YOUR_TOKEN"
-H "Content-Type: application/json"
-d '{
"alert_on_critical": true,
"alert_on_high": true,
"alert_on_medium": false,
"alert_on_low": false
}'
http://localhost:8443/api/notifications/config/update
curl -H "X-API-Token: YOUR_TOKEN"
http://localhost:8443/api/notifications/history
curl -X POST
-H "X-API-Token: YOUR_TOKEN"
http://localhost:8443/api/notifications/test
</details>
<details>
<summary><b>💾 Gestão de Cache</b></summary>```bash
# Get cache statistics
curl -H "X-API-Token: YOUR_TOKEN" \
http://localhost:8443/api/cache/stats
# Clear threat intel cache
curl -X POST \
-H "X-API-Token: YOUR_TOKEN" \
http://localhost:8443/api/cache/clear
# Clear specific IP from cache
curl -X DELETE \
-H "X-API-Token: YOUR_TOKEN" \
http://localhost:8443/api/cache/45.67.89.1
📚 Documentação Completa da API: Consulte API_ENDPOINTS.md para referência completa incluindo esquemas de requisição/resposta, códigos de erro e limites de taxa.
Dados sensíveis são automaticamente ocultados antes de alcançar LLMs externos:
| Ocultado | Preservado |
|---|---|
| 🔒 Tokens de autenticação e credenciais | ✅ Método/caminho HTTP |
| 🔒 Cookies de sessão | ✅ Padrões de ataque |
| 🔒 Chaves de API | ✅ Content-Type |
| 🔒 Endereços de e-mail | ✅ User-Agent |
| 🔒 Informações pessoais | ✅ Assinaturas de ataque |
Cobertura de conformidade:
Consulte ANONYMIZATION_TESTING.md para detalhes.
Claude (Recomendado para segurança):```json { "llm": { "provider": "claude", "claude": { "api_key": "${ANTHROPIC_API_KEY}", "model": "claude-sonnet-4-20250514", "max_tokens": 4096, "temperature": 0.0 } } }
**Gemini (Alternativa de baixo custo):**```json
{
"llm": {
"provider": "gemini",
"gemini": {
"api_key": "${GOOGLE_API_KEY}",
"model": "gemini-2.0-flash-exp",
"max_tokens": 4096,
"temperature": 0.0
}
}
}
SQLite (Padrão - Zero Config):```json { "database": { "type": "sqlite", "sqlite": { "path": "./data/ifrit.db" } } }
**PostgreSQL (Escala Empresarial):**```json
{
"database": {
"type": "postgresql",
"postgresql": {
"host": "localhost",
"port": 5432,
"user": "ifrit_user",
"password": "${POSTGRES_PASSWORD}",
"database": "ifrit",
"ssl_mode": "require"
}
}
}
Quando usar cada um:
Ativar enriquecimento externo:```json { "threat_intelligence": { "enabled": true, "cache_ttl_hours": 24, "enrichment_workers": 3, "apis": { "abuseipdb": { "enabled": true, "api_key": "${ABUSEIPDB_API_KEY}" }, "virustotal": { "enabled": true, "api_key": "${VIRUSTOTAL_API_KEY}" }, "ipinfo": { "enabled": true, "api_key": "${IPINFO_API_KEY}" } }, "threat_level_thresholds": { "critical": 80, "high": 60, "medium": 40, "low": 0 } } }
### Sistema de Notificação
Alertas multicanal com filtragem baseada em regras:```json
{
"notifications": {
"enabled": true,
"providers": {
"email": {
"enabled": true,
"smtp_host": "smtp.gmail.com",
"smtp_port": 587,
"smtp_username": "${SMTP_USERNAME}",
"smtp_password": "${SMTP_PASSWORD}",
"from_address": "[email protected]"
},
"slack": {
"enabled": true,
"webhook_url": "${SLACK_WEBHOOK_URL}"
},
"twilio": {
"enabled": false,
"account_sid": "${TWILIO_ACCOUNT_SID}",
"auth_token": "${TWILIO_AUTH_TOKEN}",
"from_number": "${TWILIO_FROM_NUMBER}",
"to_number": "${TWILIO_TO_NUMBER}"
}
},
"rules": {
"alert_on_critical": true,
"alert_on_high": false,
"alert_on_medium": false,
"alert_on_low": false
}
}
}
Dica profissional: Comece apenas com alertas CRÍTICOS ativados para evitar fadiga de alertas.
| Documento | Descrição |
|---|---|
| START_HERE.md | Guia de navegação para toda a documentação |
| INSTALLATION.md | Instruções detalhadas de configuração |
| DETECTION_MODES.md | Comparação entre Detecção e Lista de Permissões |
| THREAT_INTELLIGENCE.md | Guia de coleta de inteligência |
| NOTIFICATIONS.md | Configuração do sistema de alertas |
| API_ENDPOINTS.md | Referência completa da API REST |
| FEATURES.md | Lista completa de recursos |
| DECEPTIVE_PAYLOADS_MANAGEMENT.md | Sistema de resposta honeypot |
| ANONYMIZATION_TESTING.md | Detalhes de privacidade e conformidade |
v0.4.0 - Inteligência Aprimorada
v0.5.0 - Recursos Empresariais
v0.6.0 - Automação
IFRIT é open source sob a Licença Apache 2.0. Recebemos contribuições!
Áreas que precisam de ajuda:
Veja CONTRIBUTING.md para diretrizes.
Suporte Comercial: Para implantações empresariais, integrações personalizadas ou consultoria:
| Métrica | Valor |
|---|---|
| Precisão de Detecção | 99.2% |
| Tempo Médio de Resposta | < 15ms |
| Redução de Custos | 90% após aprendizado |
| LLMs Suportados | Claude, Gemini |
| Opções de Banco de Dados | SQLite, PostgreSQL |
| Fontes de Inteligência de Ameaças | 3 (AbuseIPDB, VirusTotal, IPInfo) |
| Canais de Notificação | 4 (E-mail, Slack, SMS, Webhook) |
O IFRIT Proxy está licenciado sob a Licença Apache 2.0.
Suporte comercial, integração personalizada ou consultoria:
📧 [email protected]
Construído com:
Agradecimento especial à comunidade de segurança pela inteligência de ameaças e contribuições de padrões.
📦 Instalar IFRIT • 📖 Ler a Documentação • 🔌 Referência da API
Transformando atacantes em fontes de inteligência, um honeypot de cada vez
Perguntas? Problemas? Ideias?
📧 E-mail: [email protected]
🐛 Reportar bugs: GitHub Issues
💬 Discussões: GitHub Discussions
📊 Visibilidade CompletaInteligência em tempo real na ponta dos seus dedos:
|
| 🔍 Modo de Detecção (Padrão) | 🛡️ Modo de Lista de Permissões (Confiança Zero Estrita) |
|---|---|
Filosofia
Configuração```json{ "detection": { "mode": "detection", "enable_local_rules": true, "enable_llm": true, "whitelist_ips": [], // Optional "whitelist_paths": [] // Optional } } Melhor para
Vantagens
Desvantagens
|
Filosofia
Configuração```json{ "detection": { "mode": "allowlist", "whitelist_ips": [ "192.168.1.100", "10.0.0.0/24" ], "whitelist_paths": [ "/health", "/metrics" ] } } Melhor Para
Vantagens
Desvantagens
|
💡 Dica Profissional: Abordagem HíbridaComece com o Modo de Integração (7 dias) para descobrir automaticamente padrões legítimos e, em seguida, mude para o modo desejado: | |
| |
|
Após a integração → Mude para o Modo Detecção ou Modo Lista de Permissões conforme sua necessidade | |
| Modo | Propósito | Bloqueio | Aprendizado | Duração |
|---|
| 🎓 Integração | Aprender tráfego legítimo | ❌ Não | ✅ Sim | 7 dias (padrão) |
| 🛡️ Detecção | Proteção total | ✅ Sim | ✅ Sim | Produção |
🚨 Inteligência de Ataques```bashView recent attacks./ifrit-cli attack list Detailed analysis./ifrit-cli attack view 42 Statistics./ifrit-cli attack stats Filter by source./ifrit-cli attack by-ip 45.67.89.1 Filter by target./ifrit-cli attack by-path /api/users Export to JSON./ifrit-cli attack export |
👤 Perfis de Atacante```bashList all attackers./ifrit-cli attacker list Profile details./ifrit-cli attacker view 5 Search by IP./ifrit-cli attacker search 45.67.89.1 Top attackers./ifrit-cli attacker top 10 |
🔍 Inteligência de Ameaças```bashRecent threat intel./ifrit-cli threat list IP details./ifrit-cli threat view 45.67.89.1 Top risky IPs./ifrit-cli threat top 10 Statistics./ifrit-cli threat stats Force re-enrich IP./ifrit-cli threat enrich 45.67.89.1 🔄 Independente de banco de dados: Os mesmos comandos funcionam tanto para SQLite quanto para PostgreSQL! |