agentleFS
kaandgnshkaandgnsh/Claude-Blue/skills/database-security/db-exfiltration-investigation/SKILL.md

db-exfiltration-investigation

Skill0 starsChanged 12 days agoMITView on GitHub

Investigate suspected database data theft — anomalous query volume, bulk SELECT/export commands, new logins from unusual hosts, SQL injection traces in web logs, backup/snapshot exports, dump tool usage — using database audit logs, application logs, network and cloud control-plane logs to scope records taken. Use when a database may have been dumped, SQL injection was exploited, or stolen data appears externally.

The file

Files
SKILL.md

Database Exfiltration Investigation

Exfil paths and evidence

PathEvidence
SQL injection via web appWeb/WAF logs with injection payloads (UNION SELECT, information_schema, sleep(, WAITFOR DELAY, xp_cmdshell), large response sizes, sqlmap user agents; DB logs of unusual queries from the app account (web-server-log-analysis)
Stolen DB credentialsLogins from new client hosts/IPs/apps (application_name, client_addr, SQL Server client_net_address/program_name)
Dump toolspg_dump, mysqldump, bcp, sqlcmd -Q "SELECT..." -o, mongodump, expdp on servers or jump hosts (EDR process events)
Bulk export featuresCOPY ... TO, SELECT ... INTO OUTFILE, SSIS/BACPAC exports, BigQuery EXPORT DATA
Backups/snapshotsCloud: ModifyDBSnapshotAttribute/CopyDBSnapshot to another account, StartExportTask (RDS export to S3), Azure SQL Export, GCS exports; backup files copied off-host
ReplicationNew replica/subscription to external host

Queries

PostgreSQL current/recent activity (live): SELECT usename, client_addr, application_name, backend_start, query FROM pg_stat_activity WHERE state <> 'idle'; SQL Server audit file: SELECT event_time, server_principal_name, client_ip, application_name, statement FROM sys.fn_get_audit_file('D:\Audit\*.sqlaudit', DEFAULT, DEFAULT) WHERE statement LIKE '%SELECT%customers%'; AWS: CloudTrail for rds: snapshot/export events (cloudtrail-investigation); Performance Insights / Database Activity Streams for query history.

Scoping records

  1. Identify the queries/exports and their time window.
  2. Determine row counts returned (audit logs with row counts, app logs with response sizes, re-run the query read-only on a restored snapshot from that time to count rows).
  3. Map columns to data categories for privacy-incident-assessment.

Contain

Rotate compromised DB and application credentials, block attacker IPs, patch the injection flaw (and add WAF virtual patch), revoke snapshot sharing, review new users/grants created during the window.

Related skills

db-audit-logging, web-server-log-analysis, data-exposure-investigation, privacy-incident-assessment

References

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.