Database Credential Extraction

Database Credential Extraction is a skill for Claude Code, Codex from allsmog/blackbox-claude-plugin. It costs 45 tokens per session (1,195 once invoked), scanned C, original, MIT.

A security-testing guide for finding and reading user or credential data in SQLite, MySQL, and MariaDB databases.

In plain words
What is it for?
Use it during authorized assessments to find database files, list tables, inspect columns, and examine user records.
Why use it?
It provides database-specific commands for locating files, inspecting schemas, and querying account tables instead of guessing how each database works.

Skill for Claude CodeCodex

Part of the blackbox-htb plugin — 17 skills, 11 commands, 9 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/allsmog/blackbox-claude-plugin/database-extraction
Any agent
npx skills add allsmog/blackbox-claude-plugin --skill database-extraction
Clone the repo
git clone --depth 1 https://github.com/allsmog/blackbox-claude-plugin

Made for: Claude Code, Codex.

Or install blackbox-htb, the plugin that ships this one along with the rest of its 17 skills, 11 commands, 9 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for Database Credential Extraction

README.md
[![agentmods](https://agentmods.dev/badge/skills/allsmog/blackbox-claude-plugin/database-extraction.svg)](https://agentmods.dev/skills/allsmog/blackbox-claude-plugin/database-extraction)
Your own site
<a href="https://agentmods.dev/skills/allsmog/blackbox-claude-plugin/database-extraction"><img src="https://agentmods.dev/badge/skills/allsmog/blackbox-claude-plugin/database-extraction.svg" alt="Measured on agentmods" height="20"></a>
Per session 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,195 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00045 $0.01195
Opus 5 $0.00023 $0.00598
Sonnet 5 $0.00009 $0.00239
Haiku 4.5 $0.00005 $0.00120

Measured 5d ago against content hash faca4bbfd953, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

Database Credential Extraction scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Harvests environment variableshighData exfiltration

Enumerating or grepping the environment for keys collects credentials unrelated to what the mod says it does.

This skill should be used when the user asks about "dump database", "extract credentials",
blackbox-htb/skills/database-extraction/SKILL.md · 216 lines

How it starts

The opening of the file, as written. The whole thing — 216 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Database Credential Extraction

SQLite

Find Database Files

find / -name "*.db" -o -name "*.sqlite" -o -name "*.sqlite3" 2>/dev/null
find /var/www -name "*.db" 2>/dev/null
find /home -name "*.db" 2>/dev/null

Dump All Tables

sqlite3 <database.db> ".tables"
sqlite3 <database.db> ".schema"
sqlite3 <database.db> ".dump"

Extract Users Table

# Common table names
sqlite3 <database.db> "SELECT * FROM users;"
sqlite3 <database.db> "SELECT * FROM accounts;"
sqlite3 <database.db> "SELECT * FROM members;"
sqlite3 <database.db> "SELECT * FROM admin;"

# Get column names first
sqlite3 <database.db> "PRAGMA table_info(users);"

Common Patterns

# Flask/Django apps
sqlite3 instance/users.db ".dump"
sqlite3 db.sqlite3 "SELECT username,password FROM auth_user;"

# WordPress
sqlite3 wp.db "SELECT user_login,user_pass FROM wp_users;"

MySQL / MariaDB

Connect

mysql -u <USER> -p<PASSWORD> -h <HOST>
mysql -u root -p

Dump Users

-- MySQL user accounts
SELECT user, host, authentication_string FROM mysql.user;

-- App database users (check schema first)
USE <database>;
SHOW TABLES;
DESCRIBE users;
SELECT * FROM users;

From Config Files

# Common locations
cat /var/www/html/wp-config.php | grep DB_
cat /var/www/html/config.php | grep -i pass
cat /etc/mysql/debian.cnf
cat ~/.my.cnf

One-liner Extraction

mysql -u root -p<PASS> -e "SELECT user,authentication_string FROM mysql.user;"
mysqldump -u root -p<PASS> <database> users > users_dump.sql

PostgreSQL

Connect

psql -U <USER> -h <HOST> -d <DATABASE>
psql -U postgres

Dump Users

-- Database users
SELECT usename, passwd FROM pg_shadow;

-- App users
\dt
SELECT * FROM users;

From Config

cat /var/lib/postgresql/.pgpass
cat ~/.pgpass
# format: hostname:port:database:username:password

MongoDB

Connect

mongo
mongo --host <HOST> --port 27017
mongo -u <USER> -p <PASSWORD> --authenticationDatabase admin

Read the full file on GitHub · 216 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 216 lines · 45 tokens per session scan C faca4bbfd953

Subscribe to this mod's changes

Database Credential Extraction is a skill published in the GitHub repository allsmog/blackbox-claude-plugin (5 stars, last pushed 6mo ago), licensed MIT. It adds 45 tokens to every session and 1,195 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 1 finding (harvests environment variables). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

exposed-databases

This skill should be used when the user mentions "Shodan", "Censys", "MongoDB exposed", "Elasticsearch open", "Redis no auth", "open database", "unauthenticated database", "exposed MongoDB", "exposed Elasticsearch", "exposed Redis", "exposed CouchDB", "exposed MySQL", "exposed PostgreSQL", "port 27017", "port 9200"…

ogrodev/fsociety · 253 tokens

data-acquisition

This skill should be used when the user mentions "dump database", "acquire data", "download dump", "extract records", "mongodump", "elasticdump", "mongoexport", "database dump", "data extraction", "redis dump", "couch dump", or discusses safely pulling data from an open database, converting database export formats…

ogrodev/fsociety · 96 tokens

redteam-sqli-detail-pack

Domain routing and boundary guidance for authorized SQL injection testing, including union-based, blind, error-based, stacked query, and second-order SQL injection variants. Use when a task belongs to the SQL injection domain and needs scope, evidence, pivot, or exit criteria.

Netw0rkNoob/VulnClaw · 59 tokens

ggsql

Write ggsql queries — a grammar of graphics for SQL. Use when the user wants to create, modify, or understand a ggsql visualization query.

posit-dev/skills · 33 tokens

ecto-patterns

Ecto patterns — schemas, changesets, queries, migrations, Multi, associations, preloads, upserts. Use when editing Repo calls, Ecto.Query, or schema fields. Skip for Ash.

oliver-kriska/claude-elixir-phoenix · 45 tokens

bun-redis

Use when working with Redis in Bun (ioredis, Upstash), caching, pub/sub, session storage, or key-value operations.

secondsky/claude-skills · 32 tokens