From bnsql
BNSQL analysis workflows: triage, security audit, crypto/network detection, multi-table queries.
How this skill is triggered — by the user, by Claude, or both
Slash command
/bnsql:analysisThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
High-level recipes for cross-domain analysis. Each recipe composes multiple
High-level recipes for cross-domain analysis. Each recipe composes multiple
bnsql skills (disassembly, xrefs, data, decompiler).
-- 1. Orientation
SELECT * FROM db_info;
SELECT * FROM entries;
SELECT * FROM capabilities;
-- 2. Imports hint at capability surface
SELECT module, COUNT(*) AS apis
FROM imports
GROUP BY module
ORDER BY apis DESC;
-- 3. Long strings often reveal purpose
SELECT content, hex(address) AS addr
FROM strings
WHERE length > 16
ORDER BY length DESC
LIMIT 20;
-- 4. Most-called functions are usually utilities/dispatchers
WITH caller_counts AS (
SELECT to_ea, COUNT(*) AS n
FROM xrefs WHERE is_code = 1
GROUP BY to_ea
)
SELECT f.name, hex(f.address) AS addr, c.n AS callers
FROM funcs f
JOIN caller_counts c ON c.to_ea = f.address
ORDER BY c.n DESC
LIMIT 10;
-- Dangerous string functions
SELECT module, name FROM imports
WHERE name IN ('strcpy', 'strcat', 'sprintf', 'gets', 'scanf');
-- Find call sites in the binary
SELECT DISTINCT c.caller_name, hex(c.caller_addr) AS addr
FROM callers c
WHERE c.callee_name IN ('strcpy', 'strcat', 'sprintf', 'gets');
-- Crypto-related imports
SELECT module, name FROM imports
WHERE name LIKE '%Crypt%' OR name LIKE '%Hash%'
OR name LIKE '%AES%' OR name LIKE '%RSA%'
OR name LIKE '%MD5%' OR name LIKE '%SHA%';
-- Constants in code (common AES S-box bytes via search_bytes)
SELECT search_first('63 7C 77 7B F2 6B 6F C5'); -- AES S-box prefix
-- Crypto-named functions
SELECT name, hex(address) AS addr
FROM funcs
WHERE name LIKE '%crypt%' OR name LIKE '%aes%' OR name LIKE '%sha%';
-- Network-related imports
SELECT module, name FROM imports
WHERE name LIKE '%socket%' OR name LIKE '%connect%'
OR name LIKE '%recv%' OR name LIKE '%send%'
OR name LIKE '%bind%' OR name LIKE '%listen%';
-- URL / domain strings
SELECT content, hex(address) AS addr
FROM strings
WHERE content LIKE 'http://%' OR content LIKE 'https://%'
OR content LIKE '%.com%' OR content LIKE '%.net%';
-- Functions containing network call sites
SELECT DISTINCT c.caller_name, hex(c.caller_addr) AS addr
FROM callers c
WHERE c.callee_name IN ('socket', 'connect', 'send', 'recv');
-- 1. Survey
SELECT * FROM funcs WHERE address = 0x401000;
-- 2. Who calls it?
SELECT * FROM callers WHERE callee_addr = 0x401000;
-- 3. What does it call?
SELECT DISTINCT callee_name
FROM hlil_calls
WHERE func_addr = 0x401000;
-- 4. Local variables
SELECT name, type, storage
FROM hlil_vars
WHERE func_addr = 0x401000;
-- 5. Decompiled body
SELECT decompile(0x401000);
WITH inbound AS (
SELECT to_ea AS addr, COUNT(*) AS in_count
FROM xrefs WHERE is_code = 1
GROUP BY to_ea
),
outbound AS (
SELECT from_func AS addr, COUNT(*) AS out_count
FROM xrefs WHERE is_code = 1 AND from_func IS NOT NULL
GROUP BY from_func
)
SELECT f.name, hex(f.address) AS addr,
i.in_count, o.out_count,
(i.in_count * o.out_count) AS connectivity
FROM funcs f
JOIN inbound i ON i.addr = f.address
JOIN outbound o ON o.addr = f.address
ORDER BY connectivity DESC
LIMIT 10;
SELECT hex(address) AS addr, original, patched, status
FROM patches
ORDER BY address;
connect for session bootstrapxrefs for the underlying call graphdata for search_bytes patternsdecompiler for HLIL-level investigationannotations for marking findings with comments / renamesnpx claudepluginhub 0xeb/bnsql-skills --plugin bnsqlSearches MemPalace before answering questions about past work, people, projects, or prior decisions. Returns verbatim stored content instead of guessing from model memory.
Guides Payload CMS config (payload.config.ts), collections, fields, hooks, access control, APIs. Debugs validation errors, security, relationships, queries, transactions, hook behavior.
Implements vector databases with Pinecone, Weaviate, Qdrant, Milvus, pgvector for semantic search, RAG, recommendations, and similarity systems. Optimizes embeddings, indexing, and hybrid search.