mirror of
https://github.com/BigBodyCobain/Shadowbroker.git
synced 2026-06-04 13:28:13 +02:00
668ce16dc7
Gate messages now propagate via the Infonet hashchain as encrypted blobs — every node syncs them through normal chain sync while only Gate members with MLS keys can decrypt. Added mesh reputation system, peer push workers, voluntary Wormhole opt-in for node participation, fork recovery, killwormhole scripts, obfuscated terminology, and hardened the self-updater to protect encryption keys and chain state during updates. New features: Shodan search, train tracking, Sentinel Hub imagery, 8 new intelligence layers, CCTV expansion to 11,000+ cameras across 6 countries, Mesh Terminal CLI, prediction markets, desktop-shell scaffold, and comprehensive mesh test suite (215 frontend + backend tests passing). Community contributors: @wa1id, @AlborzNazari, @adust09, @Xpirix, @imqdcr, @csysp, @suranyami, @chr0n1x, @johan-martensson, @singularfailure, @smithbh, @OrfeoTerkuci, @deuza, @tm-const, @Elhard1, @ttulttul
44 lines
1.4 KiB
TypeScript
44 lines
1.4 KiB
TypeScript
import { API_BASE } from '@/lib/api';
|
|
import type {
|
|
ShodanCountResponse,
|
|
ShodanHostResponse,
|
|
ShodanSearchResponse,
|
|
ShodanStatusResponse,
|
|
} from '@/types/shodan';
|
|
|
|
type JsonBody = Record<string, unknown>;
|
|
|
|
async function postJson<T>(path: string, body: JsonBody): Promise<T> {
|
|
const res = await fetch(`${API_BASE}${path}`, {
|
|
method: 'POST',
|
|
headers: { 'Content-Type': 'application/json' },
|
|
body: JSON.stringify(body),
|
|
});
|
|
const data = await res.json().catch(() => ({}));
|
|
if (!res.ok) {
|
|
throw new Error(String((data as { detail?: string }).detail || 'Request failed'));
|
|
}
|
|
return data as T;
|
|
}
|
|
|
|
export async function fetchShodanStatus(): Promise<ShodanStatusResponse> {
|
|
const res = await fetch(`${API_BASE}/api/tools/shodan/status`);
|
|
const data = await res.json().catch(() => ({}));
|
|
if (!res.ok) {
|
|
throw new Error(String((data as { detail?: string }).detail || 'Failed to load Shodan status'));
|
|
}
|
|
return data as ShodanStatusResponse;
|
|
}
|
|
|
|
export function searchShodan(query: string, page = 1, facets: string[] = []) {
|
|
return postJson<ShodanSearchResponse>('/api/tools/shodan/search', { query, page, facets });
|
|
}
|
|
|
|
export function countShodan(query: string, facets: string[] = []) {
|
|
return postJson<ShodanCountResponse>('/api/tools/shodan/count', { query, facets });
|
|
}
|
|
|
|
export function lookupShodanHost(ip: string, history = false) {
|
|
return postJson<ShodanHostResponse>('/api/tools/shodan/host', { ip, history });
|
|
}
|