Decrypting a CBC block with PadBuster

If you run PadBuster with no parameters, you'll get a help screen that gives us the very simple usage requirements: we just need that URL, the encrypted block of data itself, and the block size (in bytes). Since we're assuming AES, the block size would be 128 bits (128 / 8 = 16 bytes):

# padbuster "http://192.168.108.106/ctf/challenge1/?&c=7b7c11989ee1067f80bd910cf5725ea0026b1e519669377705f7d3de8f356c41" 7b7c11989ee1067f80bd910cf5725ea0026b1e519669377705f7d3de8f356c41 16 -noiv -encoding 1

Don't worry about the fact that the encrypted message here doesn't match the one in your lab; it changes with every session. The basic usage format is padbuster "[url]" [message] [block size] but we've added two options to the end:

  • -noiv is specifying that there is no IV known to us; it isn't in the URL like in our last demonstration, so we're roughing it without as it will be derived from the first [block size] bytes 
  • -encoding 1 is important, we're letting PadBuster know to use lower hexadecimal (lowercase letters) encoding

When we execute the command, PadBuster has a chat with the oracle. A table is shown to us with response signatures based on the oracle's answers. PadBuster will recommend one for you, but we already saw a 500 status code when we tampered with the padding, so that's what we pick here. PadBuster then gets to work decrypting based on the information it gathered, and after about 10 seconds, we get our decrypted result: some random ASCII characters, a pipe symbol, and the file path. Now we know how the message is formatted, we're going to reverse the process to generate an encrypted message with our request in it:

We're just going back and using the same command but with the plaintext flag at the end. That's it. PadBuster makes this too simple:

# padbuster "http://192.168.108.106/ctf/challenge1/?&c=7b7c11989ee1067f80bd910cf5725ea0026b1e519669377705f7d3de8f356c41" 7b7c11989ee1067f80bd910cf5725ea0026b1e519669377705f7d3de8f356c41 16 -noiv -encoding 1 -plaintext "GU5O_B+SWE,S5]|../../../../../../../../../etc/passwd"
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.140.185.170