Advertisement
r13y5h4

sc4n3r-sbD0m41n

Aug 7th, 2013
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.27 KB | None | 0 0
  1. <?php
  2. ini_set("output_buffering", "Off");
  3. set_time_limit(0);
  4. //:dead
  5. if(isset($_POST['submit'])){
  6. if(!empty($_POST['domain'])){
  7. $domain = trim($_POST['domain']);
  8. }else $domain = null;
  9.  
  10. }else $domain = null;
  11. ?>
  12. <html>
  13. <head>
  14. <title>Bing Subd0main Scanner</title>
  15. </head>
  16. <body>
  17. <form action="<?php $_SERVER['PHP_SELF']; ?>" method=POST>
  18. <label for="subdomain">Masukkan domain</label>&nbsp<input type="text" value="<?php echo $domain; ?>" name="domain" style="width:200px" placeholder="e.g. http://gay.com or gay.com"><input type="submit" name="submit" value="Scan"><br>
  19. <textarea placeholder="subd0main akan ditampilkan di sini" rows="20" cols="35" readonly>
  20. <?php
  21. if(isset($domain) && !empty($domain)){
  22. scan($domain);
  23. }
  24. function curl($url){
  25. $ch = curl_init();
  26. curl_setopt($ch, CURLOPT_URL, $url);
  27. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  28. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  29. $exec = curl_exec($ch);
  30. curl_close($ch);
  31. return $exec;
  32. }
  33. function scan($url){
  34. $i=1;
  35. $jum=0;
  36. $reg = '@^(https?\://)?(www\.)?([a-z0-9]([a-z0-9]|(\-[a-z0-9]))*\.)+[a-z]+$@i';
  37. if(preg_match($reg, $url)){
  38. while(1){
  39. $curl = curl("http://www.bing.com/search?q=domain:".$url."&first=".$i);
  40. $data = preg_match_all('#\<div class\="sb_meta"\>\<cite\>(.*?)\</cite\>#is', $curl, $m) ? $m[1] : null;
  41. if($data==null){
  42. $count=0;
  43. goto a;
  44. }
  45. foreach($data as $dat){
  46. $dat_ = preg_match("|/|i", $dat) ? strstr($dat, "/", 1) : $dat ;
  47. $urls[$i][] = $dat_;
  48. }
  49. $count = count($urls[$i]);
  50. $urls_ = array_unique($urls[$i]);
  51. sort($urls_);
  52. foreach($urls_ as $url_){
  53. echo $url_."\n";
  54. ob_flush();flush();
  55. $jum++;
  56. }
  57. $i=$i+10;
  58. a:
  59. if($count<10 || $data==null){
  60. echo "\nJumlah subd0main terdeteksi: ".$jum;
  61. ob_flush();flush();
  62. exit;
  63. }
  64. }
  65. }else{
  66. echo "URL tidak valid";
  67. ob_flush();flush();
  68. exit;
  69. }
  70. }
  71. ?>
  72. </textarea>
  73. </form>
  74. </body>
  75. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement