The rar format external chain of the compressed package in a network disk has a referer to detect anti-Leech.

Source: Internet
Author: User
Tags php online
The rar external chain of a compressed package in an online storage has a referer anti-Leech detection function. for example, if the rar external chain of a compressed package in a php online storage has a referer detection anti-Leech function, I want to put it on my blog, attackers can download files directly. could you tell me how to forge a path, and then open and download files in rar format?
I am tossing the code http://bbs.csdn.net/topics/390842920, I feel bad


Reply to discussion (solution)

Counterfeit referer

Counterfeit referer



Code

$ Url = '/A connection address in url.rar format'; $ ch = curl_init (); // initialize curl_setopt ($ ch, CURLOPT_URL, $ url ); // The page you want to access curl_setopt ($ ch, CURLOPT_REFERER, 'a specific url '); // counterfeit the url curl_setopt ($ ch, CURLOPT_HEADER, 1 ); // read the http header curl_setopt ($ ch, CURLOPT_WRITEFUNCTION, 'func'); // listen to the returned data curl_exec ($ ch); // execute function func ($ ch, $ str) {static $ s = '@'; if ($ s) {$ s = trim ($ str); if ($ s) header ($ s ); // if it is the header information, send the corresponding header} else echo $ str; // otherwise, send the data return strlen ($ str );}

Since the other party provides download, the relevant information is provided, including the file name and file length.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.