inj3ctor_m4

Reverse IP

Nov 26th, 2014
784
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.53 KB | None | 0 0
  1. <title>Reverse IP - INJ3CTOR_M4</title>
  2. <h1>Reverse IP</h1>
  3. <form method=POST>
  4. IP: <input type=text size=30 name=ip>
  5. <input type=submit value=Start.>
  6. </form>
  7. <?php
  8. #Reverse iP
  9. @set_time_limit(0);
  10. if(isset($_POST['ip'])){
  11. $ip=trim($_POST['ip']);
  12. echo"<font size='2' face='Courier'>Reverse IP results for $ip<br />==============<br /><br />There are ".sizeof(bing($ip))." domains hosted on this server.<br />The complete listing of these is below:<br /><br />";
  13. echo'<table border="1"><tr><td>Domain</td></tr>';
  14. foreach(bing($ip) as $domain){
  15. echo"<tr><td>$domain</td></tr>";
  16. }
  17. echo'</font>';
  18. }
  19. function bing($ip){
  20. $ch=curl_init();
  21. $i=1;
  22. while($i){
  23. curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
  24. curl_setopt($ch,CURLOPT_URL,"http://www.bing.com/search?q=ip%3A$ip&first=$i");
  25. curl_setopt($ch,CURLOPT_COOKIEFILE,'cookie.txt');
  26. curl_setopt($ch,CURLOPT_COOKIEJAR,'cookie.txt');
  27. curl_setopt($ch,CURLOPT_USERAGENT,'msnbot/1.0 (+http://search.msn.com/msnbot.htm)');
  28. curl_setopt($ch,CURLOPT_ENCODING,"gzip, deflate, compress");
  29. $data=curl_exec($ch);
  30. preg_match_all('/<h2><a href="(.*?)"/',$data,$matches);
  31. $links=array_unique($matches[1]);
  32. foreach($links as $link){
  33. $alllinks[]=correctit($link);
  34. }
  35. if(!preg_match('#"sw_next"#',$data)) break;
  36. $i+=10;
  37. }
  38. curl_close($ch);
  39. if(!empty($alllinks) && is_array($alllinks)){
  40. return array_unique($alllinks);
  41. }
  42. }
  43. function correctit($http){
  44. if((strpos(trim($http), "http://") === 0) || (strpos(trim($http), "https://") === 0)){
  45. return parse_url($http, PHP_URL_HOST);
  46. }else{
  47. return trim($http);
  48. }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment