Files
urutau/scripts/screenshots/demo/sites.go
T
Lucas RayanandClaude Opus 5.5 b7462c14fa
CI / Docker image (build and smoke test) (push) Skipped
CI / Format and vet (push) Successful in 27s
CI / Dependency audit (push) Successful in 18s
CI / Tests (Linux, race detector) (push) Successful in 58s
Release / Plan (reuse the published image?) (push) Successful in 4s
Release / ci (push) Skipped
Release / Build image (amd64) (push) Skipped
Release / Build image (arm64) (push) Skipped
Release / Publish tags (push) Successful in 13s
Release / Gitea release (push) Successful in 5s
feat: 1.2.0 attack intelligence, replay, 30-day history and new interface
Intelligence: attack families mapped to MITRE ATT&CK, network type from
ASN/rDNS without external APIs, request cadence, sessions with
recon/probe/exploit/access/banned stages, campaigns across IPs, verdict
with reasons, recommended actions, exposure detection (2xx with a body
on sensitive paths), STIX 2.1 export, FCrDNS for search engine bots,
optional Tor exit list.

Data: 30-day retention, twelve ranges plus custom from/to, an on-disk
event log (daily files, hourly gzip members, size cap, corruption and
disk-full tolerant), /events, /period, /metrics with stable per-hour
metrics, an extended /ip/{ip}, and peer /period merged on the hub.

Interface: layout system with fixed card sizes, range picker in the
URL, IP analysis page, Replay page, Geography down to state and city
(Natural Earth admin-1), Live page redesigned with stable metrics and a
reusable attack map. Demo data and documentation screenshots.

Security: bounded and deadline-limited period computations, linear
campaign clustering, singleflight caches, sanitized peer studies, event
query budgets, gzip bomb guard.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 21:45:59 -03:00

85 lines
6.9 KiB
Go

package main
import (
"net/netip"
)
// site é uma sub-faixa de endereços RESERVADOS (198.18.0.0/15, 203.0.113.0/24,
// 198.51.100.0/24, 192.0.2.0/24, 2001:db8::/32) mapeada para uma cidade real.
// Nada aqui é um endereço de verdade: a geolocalização existe só na base de
// demonstração gerada por este programa.
type site struct {
id string
cc string
country string
countryPT string
cont string
region string
city string
lat, lon float64
asn uint32 // 64512..65534 (uso privado)
org string
v4 []string
v6 []string
legit bool // faixa de visitantes legítimos (senão, de atacantes)
}
var sites = []site{
// ---- atacantes (198.18.0.0/16 e faixas de documentação) ----
{"nl1", "NL", "Netherlands", "Países Baixos", "EU", "North Holland", "Amsterdam", 52.3676, 4.9041, 64512, "Demo Hosting BV", []string{"198.18.1.0/24"}, []string{"2001:db8:1::/48"}, false},
{"nl2", "NL", "Netherlands", "Países Baixos", "EU", "North Holland", "Amsterdam", 52.3676, 4.9041, 64513, "Example VPN Services BV", []string{"198.18.2.0/24", "203.0.113.0/25"}, nil, false},
{"de1", "DE", "Germany", "Alemanha", "EU", "Hesse", "Frankfurt am Main", 50.1109, 8.6821, 64514, "Beispiel Cloud GmbH", []string{"198.18.3.0/24", "203.0.113.128/25"}, []string{"2001:db8:3::/48"}, false},
{"de2", "DE", "Germany", "Alemanha", "EU", "Berlin", "Berlin", 52.52, 13.405, 64515, "Demo Server GmbH", []string{"198.18.4.0/24"}, nil, false},
{"cn1", "CN", "China", "China", "AS", "Guangdong", "Shenzhen", 22.5431, 114.0579, 64516, "Demo Telecom Guangdong", []string{"198.18.5.0/24", "198.18.6.0/24"}, []string{"2001:db8:5::/48"}, false},
{"cn2", "CN", "China", "China", "AS", "Zhejiang", "Hangzhou", 30.2741, 120.1551, 64517, "Demo Cloud Computing Co", []string{"198.18.7.0/24"}, nil, false},
{"cn3", "CN", "China", "China", "AS", "Beijing", "Beijing", 39.9042, 116.4074, 64518, "Example Unicom Beijing", []string{"198.18.8.0/24"}, nil, false},
{"us1", "US", "United States", "Estados Unidos", "NA", "Virginia", "Ashburn", 39.0438, -77.4874, 64519, "Demo Cloud Inc", []string{"198.18.9.0/24", "198.51.100.0/25"}, []string{"2001:db8:9::/48"}, false},
{"us2", "US", "United States", "Estados Unidos", "NA", "Illinois", "Chicago", 41.8781, -87.6298, 64520, "Example Hosting LLC", []string{"198.18.10.0/24"}, nil, false},
{"us3", "US", "United States", "Estados Unidos", "NA", "California", "San Jose", 37.3382, -121.8863, 64521, "Demo Datacenter Corp", []string{"198.18.11.0/24"}, nil, false},
{"br1", "BR", "Brazil", "Brasil", "SA", "Pernambuco", "Recife", -8.0476, -34.877, 64522, "Exemplo Telecom", []string{"198.18.12.0/24", "192.0.2.128/25"}, nil, false},
{"br2", "BR", "Brazil", "Brasil", "SA", "São Paulo", "São Paulo", -23.5505, -46.6333, 64523, "Exemplo Banda Larga", []string{"198.18.13.0/24"}, nil, false},
{"br3", "BR", "Brazil", "Brasil", "SA", "Minas Gerais", "Belo Horizonte", -19.9167, -43.9345, 64524, "Exemplo Fibra", []string{"198.18.14.0/24"}, nil, false},
{"br4", "BR", "Brazil", "Brasil", "SA", "Bahia", "Salvador", -12.9777, -38.5016, 64525, "Exemplo Movel Wireless", []string{"198.18.15.0/24"}, nil, false},
{"in1", "IN", "India", "Índia", "AS", "Maharashtra", "Mumbai", 19.076, 72.8777, 64526, "Demo Broadband India", []string{"198.18.16.0/24"}, nil, false},
{"in2", "IN", "India", "Índia", "AS", "Karnataka", "Bengaluru", 12.9716, 77.5946, 64527, "Example Cloud India", []string{"198.18.17.0/24"}, nil, false},
{"ru1", "RU", "Russia", "Rússia", "EU", "Moscow", "Moscow", 55.7558, 37.6173, 64528, "Demo Hosting RU", []string{"198.18.18.0/24"}, []string{"2001:db8:12::/48"}, false},
{"ru2", "RU", "Russia", "Rússia", "EU", "Saint Petersburg", "Saint Petersburg", 59.9311, 30.3609, 64529, "Example Telecom Nord", []string{"198.18.19.0/24"}, nil, false},
{"sg1", "SG", "Singapore", "Singapura", "AS", "Central Singapore", "Singapore", 1.3521, 103.8198, 64530, "Demo Cloud Singapore", []string{"198.18.20.0/24", "198.51.100.128/25"}, nil, false},
{"gb1", "GB", "United Kingdom", "Reino Unido", "EU", "England", "London", 51.5074, -0.1278, 64531, "Example Hosting Ltd", []string{"198.18.21.0/24"}, nil, false},
{"hk1", "HK", "Hong Kong", "Hong Kong", "AS", "Central and Western", "Hong Kong", 22.3193, 114.1694, 64532, "Demo Datacenter HK", []string{"198.18.22.0/24"}, nil, false},
{"vn1", "VN", "Vietnam", "Vietnã", "AS", "Ho Chi Minh", "Ho Chi Minh City", 10.8231, 106.6297, 64533, "Demo Telecom Vietnam", []string{"198.18.23.0/24"}, nil, false},
{"kr1", "KR", "South Korea", "Coreia do Sul", "AS", "Seoul", "Seoul", 37.5665, 126.978, 64534, "Example Telecom Korea", []string{"198.18.24.0/24"}, nil, false},
{"mon", "BR", "Brazil", "Brasil", "SA", "São Paulo", "São Paulo", -23.5505, -46.6333, 64535, "Exemplo Monitoramento Hosting", []string{"192.0.2.0/25"}, nil, false},
// ---- visitantes legítimos (198.19.0.0/16) ----
{"v-pe", "BR", "Brazil", "Brasil", "SA", "Pernambuco", "Recife", -8.0476, -34.877, 64540, "Exemplo Telecom", []string{"198.19.1.0/24", "198.19.2.0/24"}, nil, true},
{"v-sp", "BR", "Brazil", "Brasil", "SA", "São Paulo", "São Paulo", -23.5505, -46.6333, 64541, "Exemplo Banda Larga", []string{"198.19.3.0/24", "198.19.4.0/24"}, nil, true},
{"v-mg", "BR", "Brazil", "Brasil", "SA", "Minas Gerais", "Belo Horizonte", -19.9167, -43.9345, 64542, "Exemplo Fibra", []string{"198.19.5.0/24"}, nil, true},
{"v-ba", "BR", "Brazil", "Brasil", "SA", "Bahia", "Salvador", -12.9777, -38.5016, 64543, "Exemplo Movel Wireless", []string{"198.19.6.0/24"}, nil, true},
{"v-pt", "PT", "Portugal", "Portugal", "EU", "Lisbon", "Lisbon", 38.7223, -9.1393, 64544, "Exemplo Telecom Portugal", []string{"198.19.7.0/24"}, nil, true},
{"v-us", "US", "United States", "Estados Unidos", "NA", "New York", "New York", 40.7128, -74.006, 64545, "Demo Broadband Inc", []string{"198.19.8.0/24"}, nil, true},
{"v-de", "DE", "Germany", "Alemanha", "EU", "Bavaria", "Munich", 48.1351, 11.582, 64546, "Beispiel Kabel GmbH", []string{"198.19.9.0/24"}, nil, true},
{"v-gb", "GB", "United Kingdom", "Reino Unido", "EU", "England", "Manchester", 53.4808, -2.2426, 64547, "Example Broadband Ltd", []string{"198.19.10.0/24"}, nil, true},
{"v-in", "IN", "India", "Índia", "AS", "Delhi", "New Delhi", 28.6139, 77.209, 64548, "Demo Broadband India", []string{"198.19.11.0/24"}, nil, true},
{"v-ar", "AR", "Argentina", "Argentina", "SA", "Buenos Aires", "Buenos Aires", -34.6037, -58.3816, 64549, "Ejemplo Telecom Argentina", []string{"198.19.12.0/24"}, nil, true},
}
func siteByID(id string) *site {
for i := range sites {
if sites[i].id == id {
return &sites[i]
}
}
panic("site desconhecido: " + id)
}
// reserved confirma que um endereço está numa das faixas reservadas permitidas.
func reserved(a netip.Addr) bool {
for _, p := range []string{"198.18.0.0/15", "203.0.113.0/24", "198.51.100.0/24", "192.0.2.0/24", "2001:db8::/32"} {
if netip.MustParsePrefix(p).Contains(a) {
return true
}
}
return false
}