benjamin_ Posted September 11, 2009 Share Posted September 11, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/173909-forwarding-_files-requests/ Share on other sites More sharing options...
benjamin_ Posted September 14, 2009 Author Share Posted September 14, 2009 UP please. Quote Link to comment https://forums.phpfreaks.com/topic/173909-forwarding-_files-requests/#findComment-918218 Share on other sites More sharing options...
benjamin_ Posted September 15, 2009 Author Share Posted September 15, 2009 Uping again the topic. If you think of another way for sending $_FILES or get the raw content before it's processed by php please let me know. Quote Link to comment https://forums.phpfreaks.com/topic/173909-forwarding-_files-requests/#findComment-918903 Share on other sites More sharing options...
benjamin_ Posted September 16, 2009 Author Share Posted September 16, 2009 I need some help, I can't find anything on the web about this. Quote Link to comment https://forums.phpfreaks.com/topic/173909-forwarding-_files-requests/#findComment-919461 Share on other sites More sharing options...
benjamin_ Posted September 18, 2009 Author Share Posted September 18, 2009 up Quote Link to comment https://forums.phpfreaks.com/topic/173909-forwarding-_files-requests/#findComment-920531 Share on other sites More sharing options...
benjamin_ Posted September 22, 2009 Author Share Posted September 22, 2009 up Quote Link to comment https://forums.phpfreaks.com/topic/173909-forwarding-_files-requests/#findComment-922762 Share on other sites More sharing options...
Zane Posted September 22, 2009 Share Posted September 22, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/173909-forwarding-_files-requests/#findComment-922775 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.