agentleFS
mahumadadmahumadad/quarry/skills/core/email-security/SKILL.md

email-security

Skill1 starsChanged 11 days agoMITView on GitHub

Email and domain hygiene checks: SPF, DKIM, DMARC, CAA, MTA-STS, DANE/TLSA, DNSSEC, and MX/TLS configuration. Passive checks that run with standard DNS tools — no traffic to the target's web app. Use during recon to surface email spoofing risk, missing authentication, and transport security gaps. Inspired by CVEngine's MailFail module and industry baselines (M3AAWG, NIST SP 800-177r1).

5 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use browser-extension-reverse, cloud-k8s and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • zhaoxuya520Skill

    browser-extension-reverse

    Use for authorized reverse engineering of browser extensions (Chrome/Firefox) including manifest analysis, background workers, and extension-based credential or traffic logic recovery.

    Also in 3 projects that use this

  • zhaoxuya520Skill

    cloud-k8s

    Use for authorized cloud, container, and Kubernetes security assessment including metadata SSRF, IAM misconfig, container escape paths, and cluster RBAC review.

    Also in 3 projects that use this

  • Wang200935Skill

    digital-forensics

    Comprehensive CTF forensics workflows covering file type identification,

    Also in 3 projects that use this

  • DorianGalloSkill

    binary-diff

    跨版本符号迁移与二进制差分。当你有旧版本的符号/逆向结果,需要快速迁移到新版本时使用。 适用场景:内核缺 PDB 用旧版符号推导、程序更新后批量迁移函数名、应用更新后快速定位新偏移。 核心方法:用 LLM 做结构化差异比对,程序化输入输出,成本极低(200 函数 ~1 元)。 触发关键词:符号迁移、bindiff、跨版本、PDB 缺失、函数偏移迁移、symbol migration、binary diff、版本对比。

    Also in 3 projects that use this

  • DorianGalloSkill

    js-reverse

    Also in 3 projects that use this

  • +6 more from zhaoxuya520
  • +1 more from DorianGallo

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No MX records → domain may not send email (confirm before reporting).

    line 45
  2. Distinctive:

    No way to enumerate all selectors — probe common ones:

    line 69
  3. Distinctive:

    No DKIM selectors found among common names → medium (Inferred — may use a non-standard selector.

    line 88
  4. Very specific:

    Check sp= (subdomain policy) — if absent, subdomains inherit p=, which may be weaker than intended.

    line 103
  5. Very specific:

    Check rua= / ruf= — absent means the domain owner gets no feedback on spoofing.

    line 105

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Signals

  • Recon phase of any engagement where the target owns a domain that sends email.
  • Client asks about phishing risk or email spoofing exposure.
  • Passive recon discovers MX records for the target domain.
  • Compliance check requested (PCI DSS, SOC 2, NIST, or GDPR data-in-transit).

Prerequisites

  • Target domain is in scope (scope-discipline cleared for DNS queries).
  • DNS resolution works from the operator's machine (no firewall blocking UDP/53).

Methodology

1. MX records and SMTP TLS

dig +short MX {domain}

For each MX host, verify STARTTLS support and certificate validity:

openssl s_client -starttls smtp -connect {mx_host}:25 -servername {domain} </dev/null 2>&1 | \
  grep -E "Verify return|subject=|issuer=|notAfter"

Findings:

  • No MX records → domain may not send email (confirm before reporting).
  • MX without STARTTLS → medium (email in transit is plaintext).
  • Expired/self-signed MX certificate → medium.

2. SPF

dig +short TXT {domain} | grep "v=spf1"

Evaluate the record:

  • Absent → medium (any server can send as the domain).
  • +all → medium (SPF present but permits everything).
  • ?all → low-medium (neutral — no assertion, same as absent for receivers that honor it).
  • ~all (softfail) → acceptable if DMARC p=quarantine/reject backs it up; otherwise low.
  • -all (hardfail) → correct.
  • Count DNS lookups (each include:, a:, mx:, redirect= costs one; >10 → SPF permerror):
    # quick count — recursive resolution needed for accurate count
    dig +short TXT {domain} | grep -o 'include:\|a:\|mx\|redirect=' | wc -l

3. DKIM

No way to enumerate all selectors — probe common ones:

for sel in default google selector1 selector2 k1 k2 dkim s1 s2 mail; do
  echo -n "$sel: "
  dig +short TXT "${sel}._domainkey.{domain}" 2>/dev/null || echo "(none)"
done

For each found selector, check key length:

dig +short TXT {selector}._domainkey.{domain} | \
  sed 's/" "//g;s/"//g' | grep -oP 'p=\K[^;]+' | \
  base64 -d 2>/dev/null | openssl rsa -pubin -inform DER -text -noout 2>/dev/null | \
  head -1

Findings:

  • No DKIM selectors found among common names → medium (Inferred — may use a non-standard selector; note this caveat).
  • Key < 2048 bits → low-medium (1024-bit RSA is factorable with moderate resources).

4. DMARC

dig +short TXT _dmarc.{domain}

Evaluate:

  • Absent → medium-high (no policy — receivers handle spoofed mail however they want).
  • p=none → medium (policy exists but doesn't enforce — useful only for monitoring).
  • p=quarantine → acceptable (spoofed mail goes to spam).
  • p=reject → correct (spoofed mail is dropped).
  • Check sp= (subdomain policy) — if absent, subdomains inherit p=, which may be weaker than intended.
  • Check rua= / ruf= — absent means the domain owner gets no feedback on spoofing.
  • pct= < 100 → note partial rollout (legitimate transition, but reduces protection).

5. CAA

dig +short CAA {domain}

Findings:

  • Absent → low-info (any CA can issue certificates for the domain).
  • Present → note which CAs are authorized; flag if issuewild is missing (wildcard certificates unconstrained).

6. MTA-STS

dig +short TXT _mta-sts.{domain}
# should return something like: v=STSv1; id=20240101
curl -sL https://mta-sts.{domain}/.well-known/mta-sts.txt
# should return: version, mode (enforce|testing|none), mx patterns, max_age

Findings:

  • Absent (no TXT or no policy file) → low (SMTP TLS is opportunistic, susceptible to downgrade).
  • mode: testing → info (monitoring only, no enforcement).
  • mode: enforce → correct.

7. DANE / TLSA

# For each MX host:
dig +short TLSA _25._tcp.{mx_host}

Findings:

  • Absent → info (DANE is uncommon; its absence is not a vuln, but its presence is a positive signal worth noting).
  • Present → note and verify the record matches the MX certificate.

8. DNSSEC

dig +dnssec +short {domain} A
dig +short DS {domain}
# or check the full chain:
dig +sigchase +trusted-key=/etc/trusted-key.key {domain} A 2>&1 | tail -5

Findings:

  • No DNSSEC → info (DNS responses can be spoofed, which undermines SPF/DKIM/DMARC lookups, but DNSSEC adoption is still partial — context-dependent severity).
  • DNSSEC present but broken (SERVFAIL on +dnssec) → medium (worse than no DNSSEC — legitimate mail may fail validation).

Severity summary

CheckAbsent / MisconfiguredSeverity
DMARC p=none or absentSpoofing unrestrictedmedium-high
SPF +all or absentSpoofing unrestricted (sender auth)medium
DKIM not found (common selectors)No message integritymedium
MX without STARTTLSPlaintext email transportmedium
DNSSEC broken (SERVFAIL)Worse than absentmedium
SPF ~all without DMARC enforceSoftfail ignored by most receiverslow-medium
DKIM key < 2048 bitsFactoring feasiblelow-medium
MTA-STS absentTLS downgrade possiblelow
CAA absentAny CA can issue certslow-info
DANE absentNo cert pinning for SMTPinfo
DNSSEC absentDNS spoofable (partial adoption)info

Tooling

dig (or drill/delv for DNSSEC), nslookup, openssl s_client (STARTTLS check), curl (MTA-STS policy fetch), base64 + openssl rsa (DKIM key size). All standard on Kali and macOS (install bind / dnsutils if dig missing).

Validation gate

  • MX records enumerated, STARTTLS tested on each.
  • SPF record retrieved and mechanism evaluated (especially the all qualifier).
  • DKIM probed with at least 10 common selectors; key size checked for any found.
  • DMARC policy retrieved; p=, sp=, rua/ruf, pct evaluated.
  • CAA record checked.
  • MTA-STS TXT + policy file checked.
  • DANE/TLSA records checked for MX hosts.
  • DNSSEC validation attempted.
  • Each finding tagged Demonstrated/Inferred per finding-discipline.

Gotchas

  • DKIM selector enumeration is inherently incomplete — failing to find a selector does NOT prove DKIM is absent. Tag as Inferred with the caveat that a non-standard selector may exist. Check email headers if you have a legitimate email from the domain (the DKIM-Signature header names the selector).
  • SPF lookup count >10 causes a permanent error (permerror) that silently breaks SPF for all receivers — this is worse than ~all because it's invisible to the domain owner.
  • DMARC p=none with rua= is a legitimate monitoring configuration during rollout — report it but note the context (it's a finding, not necessarily negligence).
  • Some domains legitimately don't send email (parked domains, API-only services). Check MX and SPF for v=spf1 -all (explicit "we don't send") before reporting missing email auth as a finding.
  • MTA-STS requires HTTPS on mta-sts.{domain} — if that subdomain doesn't exist or has cert issues, the policy can't be fetched and MTA-STS is effectively absent.
  • DANE requires DNSSEC on the MX domain (not the sender domain) — without DNSSEC, TLSA records are ignored by validating resolvers.

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.