cdfteller

Subdomain Checker

Nov 6th, 2020
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.81 KB | None | 0 0
  1. <?php
  2. /*
  3. | Subdomain Checker BY SecurityTrails.COM
  4. |  
  5. |   Web based
  6. |   ?domain=&api=
  7. |   Gunakan dengan bijak
  8. |
  9. |
  10. |
  11. |   ^_^ Thanks you all
  12. |  
  13.  
  14. By SangPujaan
  15. */
  16.  
  17.  
  18.  
  19.  
  20. $domain = $_GET['domain'];
  21. $apikey = $_GET['api'];
  22.  
  23. $ch = curl_init();
  24.  
  25. curl_setopt($ch, CURLOPT_URL, 'https://api.securitytrails.com/v1/domain/'.$domain.'/subdomains?children_only=false');
  26. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  27. curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
  28.  
  29.  
  30. $headers = array();
  31. $headers[] = 'Apikey: '.$apikey; //Api key : ymV8m8oh4ZyKLC81SOBgDyVLGUjlVyVb
  32. $headers[] = 'Accept: application/json';
  33. curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  34.  
  35. $result = curl_exec($ch);
  36.  
  37. preg_match_all('/"(.+)",/', $result, $x);
  38.  
  39. for ($i = 0; $i < sizeof($x[1]); $i++) {
  40.     echo $x[1][$i].".".$domain."<br>";
  41. }
  42.    
  43. ?>
Add Comment
Please, Sign In to add comment