Attack Surface Mapping logo

Attack Surface Mapping

OrganizationPopular
yaklang
attack-surface-mapping

Draw a testable attack surface from one authorized target URL or one application. Use when the user says 攻击面, 供给面, 画攻击面, map the surface, application recon, find the business host, JS inventory, or when the only visible page is login. Derive hosts, APIs, keys, and the object graph from what the app already exposes. Do not open with directory brute or payload spray. Use when the user runs /attack-surface-mapping.

Overview

Publisheryaklang
Repositoryhack-skills
Skill nameattack-surface-mapping
Stars
2.2K
Forks
292
Bundled files
1
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by yaklang on GitHub. Read the source before you install it.

Installation

Install the Attack Surface Mapping AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/yaklang/hack-skills.git /tmp/hack-skills
mkdir -p .claude/skills
cp -r /tmp/hack-skills/skills/attack-surface-mapping .claude/skills/attack-surface-mapping
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Attack Surface Mapping in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Attack Surface Mapping on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Attack Surface Mapping is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Attack Surface Mapping

Given one target and one application, draw the surface from what that application already exposes. Then stop. Testing lives in other skills.

This skill is the fast path. Success is a portrait plus a host/API inventory plus a key table plus response-class labels plus an object graph. A probe count is not success.

Field patterns for where the rest of the surface actually lives: SURFACE_PATTERNS.md.

When

  • A new URL, a new app, or "I only see a login page"
  • Need to know what to test before loading injection / auth / upload skills
  • The agent is about to brute directories, spray quotes, or expand to unrelated hosts

Do not use this skill to expand an organization-wide host universe. Map the current application cluster. Finish it. Then, if scope allows, take the next cluster.

Authorization and destruction bounds: hack start gate. Stay in scope.

What must exist (not a file tree)

Before any vulnerability skill, these facts must be retrievable. Persist them in whatever the local workspace already uses for notes and evidence — an existing task folder, a proxy project, session notes, a ticket. Do not invent a new directory layout when one is already in play.

FactKeep
Portrait3–5 sentences, not an essay
HostsBusiness hosts, gateways, API domains this app already named
EndpointsMethod, path, params, auth required?
KeysSigning salt, ciphertext id + frontend pubkey, hidden/admin route, hardcoded demo account. Record none per row if absent
Response classLogin-gate / differential / unauthenticated exception
Object graphlist → detail → attachment / export / approval

Requests, diffs, and screenshots stay where they were captured when that store is already the working set. Empty inventory plus "I will brute paths next" is a failed mapping.

Fast path

Portrait
  → find the business plane (login is a shell)
  → inventory from the app (JS / traffic / docs), keys not just paths
  → classify responses
  → grow the object graph from responses
  → same-skin / same-gate collapse
  → surface-done → hand off

Do not insert directory brute, full-template scanning, or password spraying into this loop.

1. Portrait (mandatory, before any request spray)

Three to five sentences:

  • Who uses this (consumer / merchant / operator)
  • Core objects (order, ticket, coupon, document, tenant)
  • Which fields hold money, privilege, or state
  • What an unauthenticated caller can already touch

Cannot write it → capture one real page's traffic first. Do not scan into a blank portrait.

Mini-program, native app, GraphQL, WebSocket, batch export, agent-with-tools, template preview, file convert, command RPC: treat as this site's surface, not a sidenote.

2. Find the business plane

A login page is a shell. The surface is the post-login business host or the same-host gateway behind the form. Seeing a login page is not a reason to change assets.

Find the plane without logging in:

  • Query: service= / redirect_uri= / callback= / returnUrl= / jumpUrl= / next=
  • Client: env.js / baseURL / apiHost / /prod-api / VUE_APP_* / REACT_APP_*
  • Transport: 302 Location, X-Frame-Options: ALLOW-FROM
  • Naming: same-product api / admin / gateway / product host

Someone else's SSO / CAS / OAuth page: do not audit the identity product. Follow it back to this product's business plane. Criterion: the login page's owner is not this business.

Alive vs dead:

Treat as aliveTreat as dead
401, 403, login wall, admin challengeTimeout, parking page, no business response
Management console challengeDefault CDN / empty static shell with no script

Alive ≠ grind the form. Captcha OCR, slider farms, and login-box dictionaries are not mapping.

Form checks that are in-scope for mapping (once, then stop): empty password, skip-password step, extra fields on the login API (tenant / corpId / moduleId), business paths already visible next to the form (list / detail / stats). Username and password boxes are not business parameters.

3. Inventory from the application

Frontend present: open a business page → collect scripts (including async chunks and sourcemaps) → extract APIs and keys → capture traffic to fill gaps → persist endpoints and keys in the local evidence store.

JS extracts more than /api/ paths. For each row, write the value or none:

ExtractWhy it is surface
/api/ paths, RPC cmd numbers, GraphQL operationsEndpoint list
Signing salt, hardcoded key, sign that does not need a cookieReplay without a session
Ciphertext id + frontend public key (modulus / JSEncrypt)Neighbor-id is encryptable
Hidden / admin routes in the router, unpublished chunksAPIs the UI never shows
Hardcoded demo account, test tenant, experience entryA key, not a login-form dictionary
Command / template / expression / file-convert / RPC-with-exec / agent toolsExecution plane; do not invent params if none exist

No frontend / JS blocked: Swagger, OpenAPI, captured traffic, HTML inline, known gateway prefixes. Do not idle waiting for a full JS dump.

Frontend present but inventory empty → directory brute is forbidden.

Docs and debug planes, if this app already linked them: api-recon-and-docs. Exposed VCS / backups: insecure-source-code-management. Both are this cluster's extra planes, not a new search.

4. Classify responses before any probe

ResponseClassMapping action
One sentence "please log in" / NotLogin, no list / total / roster / detailLogin gateDo not mark as an injection surface
Has list / total / business fields, even total=0DifferentialKeep on the test list
Error, 500, timeout, or length/timing off baselineDifferentialKeep; unstable diff → stop after one or two compares
Missing a parameter dumps a roster or detailUnauthenticated exceptionHighest-priority unauth surface

An empty list is "structure returned, count is 0", not a login gate.

5. Object graph is surface

Identifiers in any field name (id / userId / tenantId / fileKey / openid / ciphertext PK) are surface.

Walk, and write it down:

list → detail → attachment / export / preview / approval

Parent authorized, child often not. After a list passes, the next surface is the attachment, not a new host.

Anything a response newly names — id, download URL, token, internal host, role field — goes onto this site's queue immediately. Do not drop it when changing pages.

6. Collapse same-skin and same-gate

Fingerprint-same (title, skeleton, build hash, API prefix, login chain): pick 2–3 representatives. Siblings only get a glance: new path / new port / another app / another jump / service= / moduleId business plane. No new plane → do not open a full matrix.

Same-gate (all four):

  1. Business paths already extracted
  2. Unauthenticated exceptions already probed
  3. Remaining business endpoints return the same login-code family
  4. No unauthenticated other-subject data, and no missing-param dump

Then stop this gate. Siblings with the same baseURL + same code: glance for new paths or a code change. Auth endpoints (issue session / reset / rebind / ticket-swap) still go on the list if present; they are not "please log in, so skip".

Same host is not same-skin. Extra paths on the same host always expand.

No business script, default server page, or leftover behind the same login-code family: falsify once and leave. Do not pad with a full matrix.

7. Surface-done (then hand off)

Mapping is done when:

  1. Portrait exists, or this is recorded as a shell with no business object
  2. Endpoint inventory exists (full or degraded); keys have values or none — in the local evidence store, not a prescribed path
  3. Response classes labeled; unauthenticated exceptions ticked
  4. Object graph recorded, or recorded as unlistable
  5. Same-skin / same-gate leftovers glanced, not rematrixed
  6. Auth endpoints listed if the inventory has issue-session / reset / rebind / ticket-swap / 2FA — listed, not yet exploited

Then load hack for effort order and the matching category skill. Do not start testing inside this file.

Handoff

Surface you drewLoad
Unauthenticated other-subject data, object idsauth-sec, idor-broken-object-authorization
Issue-session / reset / rebind / ticket-swapauthbypass-authentication-flaws
Differential filters, URL-fetch params, templatesinjection-checking
Upload / preview / convertupload-insecure-files
Money / coupon / stock / approvalbusiness-logic-vuln
REST / GraphQL / gateway docsapi-sec
Public middleware adminunauthorized-access-common-services

Anti-patterns

  • Opening with directory brute or full-template scanning
  • Grinding captcha / default passwords on login HTML
  • Seeing a login page and changing assets
  • Script extracted only paths; salts, ciphertext ids, hidden routes, demo accounts unread
  • Treating 401 / 403 / login wall as dead
  • Pouring a full matrix into the same login-code family
  • Expanding to a new cluster while this application's live surface is unfinished
  • Calling mapping "done" because the homepage returned 200
  • Minting a new notes tree when the workspace or proxy project already holds the evidence

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Attack Surface Mapping AI skill do?

Draw a testable attack surface from one authorized target URL or one application. Use when the user says 攻击面, 供给面, 画攻击面, map the surface, application recon, find the business host, JS inventory, or when the only visible page is login. Derive hosts, APIs, keys, and the object graph from what the app already exposes. Do not open with directory brute or payload spray. Use when the user runs /attack-surface-mapping.

Why use Attack Surface Mapping on TypingMind?

Because you install it once and use it with any model. Attack Surface Mapping is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Attack Surface Mapping in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/yaklang/hack-skills/tree/main/skills/attack-surface-mapping. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Attack Surface Mapping?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Attack Surface Mapping?

As many as you like. As long as a model supports skills, you can use Attack Surface Mapping with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Attack Surface Mapping AI skill free?

Yes. It is published on GitHub by yaklang under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇