Skip to content
Tutorials Center
My learning

Topics

Lesson 16 of 38 ยท Repeater and Intruder

Decoder and Comparer

Use Burp Decoder to read URL, Base64, hex and HTML encodings and create hashes, and Comparer to spot the exact difference between two requests or responses.

Two small Burp tools quietly save hours: Decoder, which converts a value between encodings, and Comparer, which shows exactly how two messages differ. Neither attacks anything. They help you understand what you are looking at, which is half of security testing.

A cookie that looks like eyJ1c2VyIjoiYWxpY2UifQ== is not random noise; it is Base64 text. A response of length 1,204 versus 1,206 is not "about the same"; the two bytes may be the whole story. These tools make such details visible.

Decoder

Open the Decoder tab, paste a value into the top box, and choose what to do with it. The transformations you will use:

Operation Example input Result
URL decode a%20b%3Dc a b=c
HTML decode &lt;b&gt; <b>
Base64 decode YWxpY2U6c2VjcmV0 alice:secret
ASCII hex decode 68656c6c6f hello
Gzip decode compressed bytes readable text
Hash (SHA-256, MD5โ€ฆ) any text a digest

Press Smart decode and Burp guesses the encoding for you, handy for layered values (URL-encoded Base64 of JSON). You can chain several decode or encode steps, each shown in its own box, and the Text/Hex toggle switches between a readable and a byte-level view.

Why decoding matters

  • Reading cookies and tokens. A session value that Base64-decodes to user=alice;role=user shows that the server stores state in the cookie. Whether the cookie is signed or encrypted decides whether you can tamper with it.
  • Understanding parameters. Long opaque-looking parameters (state=..., data=...) are often JSON or serialised objects.
  • Encoding payloads correctly. When you test special characters, you must encode them in the way the application expects, or the test is meaningless.
  • Checking hashes. Comparing a leaked password hash against a known test value tells you whether a site uses an unsalted fast hash (a weakness).

Encoding is not encryption. Base64, URL encoding and hex are reversible by anyone without a key. Never describe a Base64-encoded secret as "protected".

Comparer

Comparer takes two items (requests, responses or any data) and shows the differences, either by words or by bytes. Send an item there by right-clicking and choosing Send to Comparer, then select two and click Words or Bytes.

Typical uses:

  • Login behaviour. Compare the response for a valid username with a wrong password against a response for an unknown username. Differences in wording, length or timing can allow username enumeration.
  • Access control. Compare what a normal user and an admin receive from the same endpoint.
  • Before and after. Send the same request before and after a change to see exactly what changed in the response.
  • Cache and CDN behaviour. Compare two replies to the same URL with different headers.

The word diff colours changed, added and removed parts, which beats reading two long responses by eye.

Decoder and Comparer in a workflow

  1. Repeater shows a login error: "Invalid password".
  2. Another attempt with a different username shows: "No such user".
  3. Send both responses to Comparer: the words differ, so the application leaks which usernames exist.
  4. That is a finding (user enumeration), recorded with the two responses as evidence.

Try it: a Decoder stand-in

A stand-in that implements the common decoders and a "smart decode" that peels layers, so you can see how a layered cookie unwraps.

Python Stand-in: a smart decoder

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The decoded cookie reads {"user": "alice", "role": "user"} in clear text. If the server trusted such a cookie without a signature, changing role would be a serious flaw, which is why a tester always checks whether state in a cookie is signed.

Try it: a Comparer stand-in

A second stand-in uses Python's difflib to show word-level differences between a "valid user" and "unknown user" login response, exactly the enumeration check above.

Python Stand-in: word-level diff of two responses

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The safe design is one generic message for both cases ("Invalid username or password") and similar timing.

Practical tips

  • Use Smart decode first, then adjust by hand.
  • Decode on a copy; do not overwrite the only version of a value.
  • Remember hashes are one-way; "decoding" a hash means guessing and comparing.
  • When comparing, send identical requests apart from the one change; extra differences (timestamps, tokens) make noise. Comparer's word view helps ignore layout.
  • Keep long diffs as evidence screenshots, with secrets redacted.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. A cookie decodes from Base64 to user=alice;role=user. What should you check next?

    Base64 only encodes. If the server trusts an unsigned value, changing it could change privileges.
  2. 2. What is Comparer best at?

    Comparer highlights changed, added and removed content so small but important differences stand out.
  3. 3. Two login responses differ in wording for 'wrong password' and 'unknown user'. What does this suggest?

    Different messages, lengths or timings let an attacker confirm valid usernames.
  4. 4. Is Base64 a form of encryption?

    Base64 has no key and gives no secrecy; it only changes representation.

Summary

  • Decoder converts URL, HTML, Base64, hex and gzip, chains steps, guesses with Smart decode and computes hashes.
  • Encoding is reversible and is not protection; check whether state in cookies is signed.
  • Comparer diffs two items by words or bytes, ideal for login messages and access-control comparisons.
  • Together they turn vague differences into concrete evidence.

Next: Intruder attack types