Hack Forums
[PHP] PHP Accessing Censored Websites with Curl - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Web Development (https://hackforums.net/forumdisplay.php?fid=183)
+---- Thread: [PHP] PHP Accessing Censored Websites with Curl (/showthread.php?tid=5983559)



PHP Accessing Censored Websites with Curl - WiseCat - Jun 26, 2019

I want to access censored web sites with curl I setup the proxy and tested it. It works. But it's not enter the censored websites.

It's entering https sites.

<code>

$ch = curl_init();
//curl_setopt ($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9b5) Gecko/2008032620 Firefox/3.0b5');
curl_setopt($ch,CURLOPT_USERAGENT,"Mozilla/5.0 (compatible; Santa1923/bot)");
curl_setopt ($ch, CURLOPT_HEADER, false);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 2);

curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt ($ch, CURLOPT_TIMEOUT, 30);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 30);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);

curl_setopt($ch, CURLOPT_PROXY, '192.241.129.11');
curl_setopt($ch, CURLOPT_PROXYPORT, '8118');
curl_setopt($ch, CURLOPT_PROXYTYPE, 'HTTP');


$url = 'https://www.wikipedia.com';
//$url = 'Google';


curl_setopt($ch, CURLOPT_URL, $url);

$data = curl_exec($ch);

echo $data;

</code>


RE: PHP Accessing Censored Websites with Curl - Kallu609 - Jun 26, 2019

What do you mean with "censored" websites? Cloudflare protected?


RE: PHP Accessing Censored Websites with Curl - biscuit deluxe - Jun 26, 2019

(Jun 26, 2019 01:21 PM)Kallu609 Wrote:  What do you mean with "censored" websites? Cloudflare protected?

I'm assuming he means websites that's blocked by the government or ISP.


RE: PHP Accessing Censored Websites with Curl - Kallu609 - Jun 26, 2019

(Jun 26, 2019 06:33 PM)ebik Wrote:  I'm assuming he means websites that's blocked by the government or ISP.

In that case he could setup forward proxy on some server and fetch the data through that. Maybe even something simple like a VPN would work too.