Blog

Spoofing User Agent met cURL

Laatst retourneerde Wikipedia aan een datamining script van mij het volgende :

Scripts should use an informative User-Agent string with contact information, or they may be IP-blocked without notice.

De useragent geeft aan welke browser het verzoek indiend, deze kunnen we spoofen door CURLOPT_USERAGENT mee te sturen met als gewenst resultaat dat het script niet wordt geblokkeerd.


Browser User Agents

Browser: Internet Explorer 7.0

Besturingssysteem: Windows Server 2008

curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727)");

Browser: Internet Explorer 7.0

Besturingssysteem: Windows Vista

curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)");

Browser: Internet Explorer 6.0

Besturingssysteem: Windows XP

curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)");

Browser: Firefox 3.0

Besturingssysteem: Windows XP

curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.9) Gecko/2008052906 Firefox/3.0");

Browser: Firefox 2.0.0.6

Besturingssysteem: WindowsXP

curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6");

Browser: Safari 3.0.2

Besturingssysteem: Mac OS X

curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en) AppleWebKit/522.11 (KHTML, like Gecko) Safari/3.0.2");

Browser: Safari v125

Besturingssysteem: Mac OS X

curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/124 (KHTML, like Gecko) Safari/125");

Browser: Google Chrome V 0.2.149

Besturingssysteem: Windows XP

curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.30 Safari/525.13");

Browser: Opera 9.00

Besturingssysteem: WindowsXP

curl_setopt ($ch, CURLOPT_USERAGENT, "Opera/9.00 (Windows NT 5.1; U; en)");

Browser: Opera 7.23

Besturingssysteem: Windows 98

curl_setopt ($ch, CURLOPT_USERAGENT, "Opera/7.23 (Windows 98; U) [en]");

Browser: Konqueror 3.5

Besturingssysteem: Fedora Core 6

curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.4 (like Gecko)");

Zoekmachine User Agents

Google

curl_setopt ($ch, CURLOPT_USERAGENT, "Googlebot/2.1 ( http://www.googlebot.com/bot.html)");

Google Image

curl_setopt ($ch, CURLOPT_USERAGENT, "Googlebot-Image/1.0 ( http://www.googlebot.com/bot.html)");

MSN Live

curl_setopt ($ch, CURLOPT_USERAGENT, "msnbot-Products/1.0 (+http://search.msn.com/msnbot.htm)");

Yahoo

curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)");

Meer informatie : Wikipedia - User Agent

Zoeken