jmyeom

ip convert from shitrissa

Jul 26th, 2012
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. this is a warning... please follow as i have stated... thinking you know better and can ignore what i say can leave your sql damaged, all bans removed, and it banning everyone.... EVER!
  2. READ EVERYTHING BEFORE ATTEMPTING, MAKE SURE YOU UNDERSTAND WHAT YOU ARE DOING BEFORE YOU DO IT, IF UNSURE, FUCKING ASK.....
  3.  
  4. any damaged caused by running this script without following what i have stated is not my problem, .... <13.4>
  5.  
  6.  
  7.  
  8.  
  9. here is the code... save it, but dont run it...
  10.  
  11. <?php
  12.  
  13. require 'config.php';
  14. require KU_ROOTDIR . 'inc/functions.php';
  15. if (isset($_GET["start"])) {
  16. $tc_db->Execute("ALTER TABLE `" . KU_DBPREFIX . "banlist` ADD `checked` INT NOT NULL DEFAULT '0'");
  17. }
  18. $results = $tc_db->GetAll("SELECT * FROM `" . KU_DBPREFIX . "banlist` WHERE `checked` =0");
  19. foreach ($results as $line) {
  20.  
  21. $ip = md5_decrypt($line['ip'], KU_RANDOMSEED);
  22. $ipcheck = substr($ip, -1);
  23. while ($ipcheck == "*") {
  24. $ip = substr($ip, 0, -2);
  25. $ipcheck = substr($ip, -1);
  26. }
  27. $ip = $ip . ".";
  28. $ip = md5_encrypt($ip, KU_RANDOMSEED);
  29. $tc_db->Execute("UPDATE `" . KU_DBPREFIX . "banlist` SET `ipmd5` = '" . $ip . "', `checked` = '1' WHERE `id` =" . $line['id'] . ";");
  30. }
  31. $tc_db->Execute("ALTER TABLE `" . KU_DBPREFIX . "banlist`DROP `checked`;");
  32.  
  33. echo "your done!! stop running this script and delete it...";
  34. ?>
  35.  
  36.  
  37. now you must run it with the arg "start=1" when you first run it... after that you run it normally...
  38. i.e,
  39. (ipconvert.php is the name i saved it under, change it if you saved it under something else)
  40.  
  41. you run it first like this: http://derpmydomain.com/ipconvert.php?start=1
  42.  
  43. you will most likely get a blank screen after a long time of loading, or a warning saying your over the time limit/timed out... THIS IS NORMAL
  44.  
  45. after that, you run it normally without any args, like so : http://derpmydomain.com/ipconvert.php
  46.  
  47. now, keep on running it normally untill you see this message: "your done!! stop running this script and delete it..."
  48. you now double check that it has converted the bans, if its not done them all, you must try again, using the "?start=1" arg first time, then without the rest
  49.  
  50.  
  51. depending on how many bans you have, depends on how long it will take, if you have 2k bans, you may have to run it a few times (about 40 times :( )
  52.  
  53. :)
Advertisement
Add Comment
Please, Sign In to add comment