wirecrab-0.2.0 is not a library.
wirecrab
Agent-first CLI network analysis platform.
Build
Key Commands
Create/list/delete sessions:
Start/stop live capture:
Run SQL queries:
Save and run parameterized saved queries ({{param_name}} placeholders):
Export filtered packets to PCAP:
Inject packets from spec:
Run probe script:
Ingest/replay PCAP:
Tail normalized event stream:
Retention and maintenance:
Start MCP compatibility endpoint:
The MCP endpoint speaks newline-delimited JSON-RPC 2.0 over TCP and supports:
initialize, ping, tools/list, tools/call.
Inspect schema and environment:
SQL Contract v1
Wirecrab is decision-neutral: it exposes facts for agents via SQL.
Canonical entities:
v1_sessionsv1_packetsv1_flowsv1_dns_queriesv1_http_requestsv1_service_discoveryv1_stun_eventsv1_endpoint_ownershipv1_snapshotsv1_snapshot_protocol_mixv1_snapshot_top_endpointsv1_snapshot_top_flowsv1_snapshot_discoveryv1_snapshot_dns_top_qnamesv1_snapshot_protocol_diffv1_snapshot_endpoint_diffv1_snapshot_flow_diffv1_eventsv1_events_enrichedv1_tls_handshakesv1_quic_handshakesv1_protocol_fingerprintsv1_saved_queriesv1_retention_policyv1_streamsv1_stream_http_requestsv1_plugins_registryv1_stream_buffersv1_ipv4_fragments
SQL functions:
v1_snapshot_create(label)->snapshot_idv1_snapshot_create(label, start_sec, end_sec)->snapshot_idv1_snapshot_delete(snapshot_id)->rows_deletedv1_enrich_ip(ip)->1if updated/inserted,0if cache still fresh
Examples:
Inject Spec (YAML)
iface: en0
payload_hex: "ffffffffffff0011223344550800450000280001000040060000c0a80101c0a8010204d2005000000000000000005002200000000000"
count: 1
interval_ms: 100
You can use payload_base64 instead of payload_hex.
Probe Script (YAML)
iface: en0
steps:
- type: inject
payload_hex: "ffffffffffff0011223344550800450000280001000040060000c0a80101c0a8010204d2005000000000000000005002200000000000"
count: 1
- type: sleep
ms: 500
- type: query
sql: "SELECT count(*) AS n FROM packets"
Notes
- Live capture and packet injection require OS-level capture permissions.
- Session data is stored in
~/.wirecrab/sessions/<session-id>/session.db. - Query output formats:
json,jsonl,csv,human. events tailstreams normalized facts for agents with cursor-based resume.- Plugin manifests can be placed in
~/.wirecrab/plugins/*.jsonand matching packets emitkind='plugin'events.