Database Credential Extraction

Database Credential Extraction is a skill for Claude Code 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 Code

Written for Claude Code: shipped in a Claude Code plugin.

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

Good fit Use it during authorized assessments to find database files, list tables, inspect columns, and examine user records.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/allsmog/blackbox-claude-plugin/database-extraction
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.

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.

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/github.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/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for Database Credential Extraction

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00045 $0.01195
Opus 5.5 $0.00018 $0.00478
Sonnet 5.5 $0.00009 $0.00239
Haiku 4.5 $0.00005 $0.00120

Measured 2mo ago against content hash faca4bbfd953, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 2mo 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. 2mo 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 (6 stars, last pushed 8mo ago), licensed MIT. It adds 45 tokens to every session and 1,195 once invoked, about $0.0002 per session on Opus 5.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.