Kyfx

IP info grabber save as php any name and run with cmd

Mar 20th, 2015
394
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. Example run with cmd cd Desktop
  2. 11.php with the ip
  3.  
  4.  
  5. <?php
  6.  
  7. if(isset($_SERVER['argv'][1]) || isset($_GET['ip']) ) {
  8. $ip = $_SERVER['argv'][1] or $_GET['ip'] ;
  9.  
  10. echo "\n IP: ".$ip."\n";
  11. echo " PLeas wait:..\n\n";
  12. }else{die("\n Pleas Insert a ip.\n EX: php cloudflare-bypass.php 127.0.0.1 \n\n");}
  13.  
  14. if(!filter_var($ip, FILTER_VALIDATE_IP)) {
  15. die(" Not a valid IP address!\n");
  16. }
  17.  
  18. function entre2v2($text,$marqueurDebutLien,$marqueurFinLien,$i=1){
  19. $ar0=explode($marqueurDebutLien, $text);
  20. $ar1=explode($marqueurFinLien, $ar0[$i]);
  21. return trim($ar1[0]);
  22. }
  23.  
  24.  
  25. $url = 'http://ipmap.net/index.php/ipmap/?ip='.$ip;
  26. $check = @file_get_contents(''.$url.'');
  27. //echo $check;
  28.  
  29.  
  30.  
  31. $ip = @entre2v2($check,'<span onclick="sdiv(this);"><font size="" color="red">',"</font></span>") or die(" [!] Error\n");
  32. $Hostname = @entre2v2($check,'<font color="red" id=hostname>',"</font></span></td>");
  33. $country_name = entre2v2($check,'<font color="red" id=country_name>',"</font></span></td>");
  34. $country_code = entre2v2($check,'<font color="red" id=country_code>',"</font></span></td>");
  35. $region = entre2v2($check,'<font color="red" id=region>',"</font></span></td>");
  36. $city = entre2v2($check,'<font color="red" id=city>',"</font></span></td>");
  37. $postal_code = entre2v2($check,'<font color="red" id=postal_code>',"</font></span></td>");
  38. $area_code = entre2v2($check,'<font color="red" id=area_code>',"</font></span></td>");
  39.  
  40. echo ' IP: '.$ip."\n";
  41. echo ' Hostname: '.$Hostname."\n";
  42. echo ' Country: '.$country_name."\n";
  43. echo ' Country Code: '.$country_code."\n";
  44. echo ' Region/State: '.$region."\n";
  45. echo ' City: '.$city."\n";
  46. echo ' Postal : '.$postal_code."\n";
  47. echo ' Phone code : '.$area_code."\n";
  48.  
  49.  
  50.  
  51. ?>
Advertisement
Add Comment
Please, Sign In to add comment