What are PHP wrappers?
PHP wrappers are used to encode different PHP streams. Whenever you access a webpage the data is sent to you as a stream as opposed to downloading the entire file first before opening it. Utilizing streams is a way for PHP to save on bandwidth, time and memory. A wrapper can be used to tell the stream how to handle specific protocols encoding. So instead outputing the output with its default encoding a wrapper can be used to encode the stream with say base64 encoding instead. This post will focus on using PHPs base64 encode wrapper.
The scenario
Example:
Note the base64 encoded string at the top of the page.
The line is too long to read off the page as is so looking at the source code reveals the entire string.
Kali comes with an inbuilt base64 encoder/decoder so it is just a matter of echoing the string to console and piping it into the base64 function with the decode switch of -d.