Jump to content

Recommended Posts

Hello,

 

I've written php scripts that emulate a simple web proxy server, it forwards each request to the requested server and can authenticate users on several applications.

 

One of these applications provides a file upload feature, with a bit of tampering I tried to reverse the $_POST data in order to replicate it and send it to the right server.

 

It turns out to be like that:

// MAGIC + Content-Disposition: form-data; name="wpUploadFile"; filename=""\r\nContent-Type: $contenttype\r\n\r\n
// DATA OF THE FILE\r\n
// MAGIC\r\n
// Content-Disposition: form-data; name="wpSourceType"\r\n\r\nfile\r\nMAGIC\r\n
// Content-Disposition: form-data; name="wpDestFile"\r\n\r\n
// FILENAME\r\nMAGIC\r\n
// Content-Disposition: form-data; name="wpUploadDescription"\r\n\r\n
// DESCRIPTION\r\nMAGIC\r\n
// Content-Disposition: form-data; name="wpUpload"\r\n\r\n
// import file\r\nMAGIC\r\n

 

As you see, there's a MAGIC value, typically something like:

-----------------------1234412412312312312312

That's the only thing I need to send the file, all the data is in $_POST['POST_DATA'] on the client side. On the server side, you have the tmp_name instead of the file's data, so you can fopen the file, read it and so on.

 

Does anyone know what the MAGIC value is ? Please give me a clue !

 

Thanks in advance.

 

Benjamin.

 

PS: I figured out that the MAGIC value doesn't change if you send the same file, but changes when you send another file, it may be a sort of checksum, there are only numbers in this MAGIC.

Link to comment
https://forums.phpfreaks.com/topic/173909-forwarding-_files-requests/
Share on other sites

bumping your thread over and over will not get your question answered.

 

If nobody has answered you it's probably because you haven't made any sense..which you haven't.  Please elaborate if you want any worthwhile help.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.