bsteo
bsteo

Reputation: 1779

PHP dump unknown/undefined VARIABLE to file

I have the following HTTP data:

POST /forum/post.php HTTP/1.1
Accept: text/xml, text/html, text/plain, */*
Host: myhost.com
Content-Length: 752
Cache-Control: no-cache

LxINAXyIgvOZQBF28yt0/NYmrYy7/dWENDNdFybIqYSWxLS6Ystk1pHfFDEBOJPgfJMWPQwqojMTvLugMOD7ZeXm33WYxFnjhR8C+Q8es49bGp8GiBmU7o3VYvJYKHSsknRXoB9tp9hhnzBJ4RMOhLbIIk5i6QwR8sFHxqUsL+i/8mKJDAcDsXXZcJXlXqhRN7fCDqLb/vTmnSTm+qA2HWU1AsBAGpWoQycRr0BT62lI2H3WnKevGi7fePJdCKWmwp5yoztKYCI3QJKrJbt5f60zb8TR5JHEs2S8ne0e6mssV7N4A3rwE+/O08pfHAmsVVtotpdqkPHWEWr+S7te9r01grfJt6GY0ozH0BPqSkP98wUwlrD385sRzf8M8uOw3hI1DWliZl0ea2Dc4b/7zVfwsqHl94Hk5x2p6nzXaW0vEsAVrodNIIcv3ZGGEkk97BOsHXP1rvJNiQLuM/7D3X9WFX/cYYqnNrIW84rhtbhty04r6JH37G9hPDlHjiYAogQ0lpMubsTNaW35Gn9G7X/qaH4+uQtYDVt67graNB3dDEBQRfXHw/sOM57hlxU/o/Q52RgAcekhGABXsLtXH3Sd5rurYg+qjMtceK9hC37ylXOJ+0bTKVf/A8nLlMarTtGhQK+oG8Rx8juy/USlCvg4++dCXS3qr0pFC9u2tcLAgND0g3tcBN1kYw2Ca4TTxP5m932pBTict7PE0jAXITmOoV3MGFE9AsKMJAVUdRK0sg==

How can I capture the BASE64 data and write it to a file, I tried to dump the $_POST variables but I get nothing, tried with $_REQUEST or serialize($_REQUEST) and all I get is:

Array
(
)

How can I capture an undefined post data? Thanks!

Upvotes: 1

Views: 140

Answers (1)

MrCode
MrCode

Reputation: 64526

It can be found in $HTTP_RAW_POST_DATA:

echo $HTTP_RAW_POST_DATA;

Or:

echo file_get_contents("php://input");

Manual.

You can then write it to a file with file_put_contents() or any of the other methods to write to a file.

Upvotes: 3

Related Questions