padbuster-padding-oracle

Automates Padding Oracle attacks against CBC-mode encrypted tokens using PadBuster.

1.7k|238|Updated Dec 7, 2019
One-click install
npx skills add https://github.com/wgpsec/AboutSecurity --skill padbuster-padding-oracle
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: padbuster-padding-oracle
Source: https://github.com/wgpsec/AboutSecurity/tree/main/skills/tool/padbuster-padding-oracle
Command: npx skills add https://github.com/wgpsec/AboutSecurity --skill padbuster-padding-oracle

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Web applications that encrypt cookies, tokens, or URL parameters with CBC-mode ciphers (AES-CBC/DES-CBC) may leak padding validity through differing error responses, and manually exploiting this oracle byte-by-byte is impractical. This Skill operationalizes PadBuster to automatically decrypt such ciphertexts and forge valid ciphertexts for arbitrary plaintexts.

Core Features & Use Cases

  • Automated Decryption: Recover plaintext from encrypted cookies, URL parameters, or tokens by exploiting padding error responses, with support for Base64, hex, .NET UrlToken, and WebSafe Base64 encodings.
  • Ciphertext Forgery: Craft valid encrypted values for attacker-chosen plaintexts, such as forging an admin session cookie like {"role":"admin","uid":1}.
  • Advanced Handling: Custom error-string matching, URL prefix placement, IV-less ciphertexts (-noiv), verbose debugging, and resuming interrupted attacks from known intermediate values.
  • Use Case: During an authorized penetration test you find an auth cookie that returns different responses for bad padding versus bad data; use this Skill to decrypt the cookie and then forge an admin session token.

Quick Start

Use the padbuster-padding-oracle skill to decrypt the Base64-encoded auth cookie from the target application and then forge a ciphertext for the plaintext admin.

Frequently Asked Questions about padbuster-padding-oracle

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I exploit a Padding Oracle vulnerability with PadBuster?

Run PadBuster with the target URL, a sample ciphertext, and the block size (16 for AES, 8 for DES), plus the encoding flag. It iteratively sends modified ciphertexts and uses the server's padding error responses to decrypt the value byte by byte.

How to forge an encrypted cookie using a padding oracle attack?

Use PadBuster's -plaintext option together with a valid captured ciphertext and the -cookies flag. After decrypting, it computes a new ciphertext that decrypts to your chosen plaintext, such as an admin role JSON, which you then substitute into the cookie.

What block size should I use for AES versus DES in PadBuster?

Use block size 16 for AES-CBC and 8 for DES-CBC, passed as the third positional argument. Choosing the wrong block size causes the attack to fail because padding validation operates on fixed cipher block boundaries.

Does PadBuster work when the server does not return different HTTP status codes?

Yes, use the -error option to specify a string that appears only in padding-error responses, such as "Invalid padding". PadBuster then distinguishes oracle responses by response body content instead of status codes.

What are the limitations of Padding Oracle attacks with PadBuster?

The attack requires a CBC-mode cipher and a server that behaves observably differently on padding errors; without such an oracle it cannot proceed. It is also slow, requiring many requests per byte, though interrupted runs can resume via the -intermediate option.