Tero

[+] Schimbare IP intr-un GRABBER care foloseste cURL

Mar 26th, 2017
463
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.52 KB | None | 0 0
  1. /**
  2. + Pastebin: http://pastebin.com/u/tero
  3. **/
  4.  
  5. /**
  6. Aceasta este o modalitate de a schimba IP-ul intr-un GRABBER care foloseste cURL (folositor pentru a evita banarea IP-ului).
  7. Avem nevoie de un host shared cu cPanel !
  8. Avem nevoie de urmatoarele:
  9.  Un script care 'grabuieste'
  10.  Mai multe IP-uri extrase de pe host (citeste mai jos)
  11.  Si o bucata proprietate cURL care se foloseste integrata !
  12. Pentru a face rost de IP-uri avem nevoie sa ne autentificam in FTP apoi sa intram in folderul /.cpanel/datastore, din acest folder descarcam fisierul all_iplist.db. In acest fisier gasiti lista cu toate IP-urile ale serverului pe care sunteti.
  13.  Inainte de a folosii un IP trebuie sa verificati daca IP-ul este functional, copiati IP-ul si accesatil in browser, daca se poate accesa si apare o pagina web inseamna ca este bun, daca nu incercati altul !
  14.  Apoi avem nevoie de:
  15. // grab.lib.php
  16. **/
  17. class grabber{
  18. var $grab;
  19. function page($url,$mode){
  20. //empty ? // fallin' back to file_get_contents
  21. if (empty($mode)){$mode='fget';}  
  22. if ($mode=='fget'){
  23. $opts = array(
  24.   'http'=>array(
  25.     'method'=>"GET",
  26.     'header'=>"Accept-language: en\r\n" .
  27.               "User-Agent: SAMSUNG-SGH-E250/1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 UP.Browser/6.2.3.3.c.1.101 (GUI) MMP/2.0 (compatible; Googlebot-Mobile/2.1; +http://www.google.com/bot.html)\r\n"
  28.   )
  29. );
  30. $context = stream_context_create($opts);
  31. $page=file_get_contents($url, false, $context);
  32. $ret = $this->grab=$page;
  33. }
  34. if ($mode=='curl'){
  35. $crl = curl_init();
  36. curl_setopt ($crl, CURLOPT_URL,$url);
  37. curl_setopt ($crl, CURLOPT_RETURNTRANSFER, 1);
  38. curl_setopt ($crl,CURLOPT_INTERFACE, '127.0.0.1');
  39. curl_setopt($crl,CURLOPT_USERAGENT,'SAMSUNG-SGH-E250/1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 UP.Browser/6.2.3.3.c.1.101 (GUI) MMP/2.0 (compatible; Googlebot-Mobile/2.1; +http://www.google.com/bot.html)');
  40. curl_setopt ($crl, CURLOPT_HTTPHEADER,array('User-Agent: SAMSUNG-SGH-E250/1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 UP.Browser/6.2.3.3.c.1.101 (GUI) MMP/2.0 (compatible; Googlebot-Mobile/2.1; +http://www.google.com/bot.html),'));
  41. curl_setopt($crl, CURLOPT_FOLLOWLOCATION, 1);
  42. $grab = curl_exec($crl); curl_close($crl);
  43. $page=$grab;
  44. $ret = $this->grab=$page;
  45. }
  46. //echo 'Using '.$mode.' fetching contents';
  47. return $ret; }
  48. }
  49. /**
  50. Si de fila care proceseaza. [DEMO]
  51. **/
  52. require_once 'grab.lib.php';
  53. $grab = new grabber();
  54. header("Content-Type: text/plain");
  55. function string($string, $start, $end)
  56. {
  57.     $string = " " . $string ;
  58.     $ini = strpos( $string, $start ) ;
  59.     if ( $ini == 0 ) return "" ;
  60.     $ini += strlen( $start ) ;
  61.     $len = strpos( $string, $end, $ini ) - $ini ;
  62.     return substr( $string, $ini, $len ) ;
  63. }
  64. $data = $grab->page('http://hfiles.ro/s/sisu-tudor','curl');
  65. $vlista = string($data, '<div id="uploader-files" class="files-table">','</div>');
  66. preg_match_all('|<a.*title="Download (.*?)" href="(.*?)">|',$vlista,$vfiles);
  67. foreach (array_combine($vfiles[1], $vfiles[2]) as $row => $row2) {
  68. echo $row."\nhttp://hfiles.ro".$row2."\n\n";
  69. }
  70. /**
  71. A se observa in fisierul grab.lib.php linia:
  72. **/
  73. curl_setopt ($crl,CURLOPT_INTERFACE, '127.0.0.1');
  74.  
  75. /**
  76. Inlocuiti 127.0.0.1 cu un IP functional din fisierul all_iplist.db.
  77.  Se poate face si un array ca folosire random dintr-o lista de ip-uri din fisierul respectiv ca la fiecare conectare, scriptu sa foloseasca alt ip !
  78.  Este posibil ca providerul de unde aveti hostul shared sa va baneze contul pentru ca folositi asta, desi nu prea are cum sa afle...
  79. **/
Advertisement
Add Comment
Please, Sign In to add comment