Advertisement
Guest User

Untitled

a guest
Apr 17th, 2015
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.42 KB | None | 0 0
  1. <?
  2. define('_IN_JOHNCMS', 1);
  3. $from = 'ADMIN';
  4. $user_id = '1';
  5.  
  6. $rootpath = '';
  7. require('incfiles/core.php');
  8. @set_time_limit(6000);
  9. function userAgent() {
  10. $userAgent = array('NokiaN73-2/3.0-630.0.2 Series60/3.0 Profile/MIDP-2.0 Configuration/CLDC-1.1');
  11. return $userAgent[rand(0,0)];
  12. }
  13. function grab_link($url,$cookie='',$user_agent='',$header='') {
  14. if(function_exists('curl_init')){
  15. $ch = curl_init();
  16. $headers[] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8';
  17. $headers[] = 'Accept-Language: en-us,en;q=0.5';
  18. $headers[] = 'Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7';
  19. $headers[] = 'Keep-Alive: 300';
  20. $headers[] = 'Connection: Keep-Alive';
  21. $headers[] = 'Content-type: application/x-www-form-urlencoded;charset=UTF-8';
  22. curl_setopt($ch, CURLOPT_URL, $url);
  23. if($user_agent)curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
  24. else curl_setopt($ch, CURLOPT_USERAGENT, userAgent());
  25. if($header)
  26. curl_setopt($ch, CURLOPT_HEADER, 1);
  27. else
  28. curl_setopt($ch, CURLOPT_HEADER, 0);
  29. curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  30. curl_setopt($ch, CURLOPT_REFERER, 'http://www.google.com.vn/search?hl=vi&client=firefox-a&rls=org.mozilla:en-US:official&hs=hKS&q=video+clip&start=20&sa=N');
  31. curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
  32. if(strncmp($url, 'https', 6)) curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  33. if($cookie)curl_setopt($ch, CURLOPT_COOKIE, $cookie);
  34. curl_setopt($ch, CURLOPT_TIMEOUT, 100);
  35. $html = curl_exec($ch);
  36. $mess_error = curl_error($ch);
  37. curl_close($ch);
  38. }
  39. else {
  40. $matches = parse_url($url);
  41. $host = $matches['host'];
  42. $link = (isset($matches['path'])?$matches['path']:'/').(isset($matches['query'])?'?'.$matches['query']:'').(isset($matches['fragment'])?'#'.$matches['fragment']:'');
  43. $port = !empty($matches['port']) ? $matches['port'] : 80;
  44. $fp=@fsockopen($host,$port,$errno,$errval,30);
  45. if (!$fp) {
  46. $html = "$errval ($errno)<br />\n";
  47. } else {
  48. $rand_ip = rand(1,254).".".rand(1,254).".".rand(1,254).".".rand(1,254);
  49. $out = "GET $link HTTP/1.1\r\n".
  50. "Host: $host\r\n".
  51. "Referer: http://www.google.com.vn/search?hl=vi&client=firefox-a&rls=org.mozilla:en-US:official&hs=hKS&q=video+clip&start=20&sa=N\r\n".
  52. "Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5\r\n";
  53. if($cookie) $out .= "Cookie: $cookie\r\n";
  54. if($user_agent) $out .= "User-Agent: ".$user_agent."\r\n";
  55. else $out .= "User-Agent: ".userAgent()."\r\n";
  56. $out .= "X-Forwarded-For: $rand_ip\r\n".
  57. "Via: CB-Prx\r\n".
  58. "Connection: Close\r\n\r\n";
  59. fwrite($fp,$out);
  60. while (!feof($fp)) {
  61. $html .= fgets($fp,4096);
  62. }
  63. fclose($fp);
  64. }
  65. }
  66. return $html;
  67. }
  68.  
  69. if (isset($_POST['url'])){
  70. $refid= abs(intval($_POST['chuyenmuc']));
  71. $link = $_POST['url'];
  72. $nd = grab_link($link);
  73. $btit = '<title>';
  74. $ktit ='</title>';
  75. preg_match('/<title>(.*?)<\/title>/', $nd, $tit);
  76. $tieude = str_replace('- mPlay.Pro', '', $tit[1]);
  77. preg_match('/<\!-- Tiêu đề -->(.*?)<div class="phai">/is', $nd, $content);
  78. $noidung = str_replace('<div class="list1">', '', $content[1]);
  79. $noidung = html_entity_decode($noidung,ENT_QUOTES,'UTF-8');
  80. $noidung = str_replace('<font color="#FFFFFF">', '<font color="red">', $noidung);
  81. mysql_query("INSERT INTO `forum` SET
  82. `refid` ='$refid',
  83. `type` ='t',
  84. `hienthi` = '1',
  85. `time` ='". time() ."',
  86. `user_id` ='$user_id',
  87. `from` ='$from',
  88. `text` ='$tieude',
  89. `nametopic` = '".rw($tieude)."',
  90. `soft` ='',
  91. `edit` ='',
  92. `curators` =''
  93. ") or exit(__LINE__ . ':' . mysql_error());
  94. $rid = mysql_insert_id();
  95. mysql_query("INSERT INTO `forum` SET
  96. `refid` ='$rid',
  97. `type` ='m',
  98. `time` ='". time() ."',
  99. `user_id` ='$user_id',
  100. `from` ='$from',
  101. `ip` ='". core::$ip ."',
  102. `soft` = 'BOT',
  103. `ip_via_proxy` ='". core::$ip_via_proxy ."',
  104. `text` ='". mysql_real_escape_string($noidung) ."',
  105. `edit` ='',
  106. `curators` =''
  107. ") or exit(__LINE__ . ':' . mysql_error());
  108. echo '<div style="color:green">leech <b>'.$tieude.'</b> thành công</div>';
  109. }
  110. echo 'Nhap 1 link tu mplay.pro<br/><form action ="" method="post"><br>
  111. &bull;Link: *<br/><input type="text" name="url" value="" size="15"/>';
  112. echo '<br/>Chuyện mục<br/><select name="chuyenmuc">';
  113. $q=mysql_query("select text,id from forum where type = 'r' order by realid ASC");
  114. while($cm=mysql_fetch_assoc($q)){
  115. echo '<option value="'.$cm['id'].'">'.$cm['text'].'</option>';
  116. }
  117. echo '</select><br/><input type="submit" value="Gửi bài viết"></form>';
  118.  
  119. echo'<hr>FB <a href="https://www.facebook.com/taiw96">Kí Ức Theo Mưa</a>';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement