Advertisement
Guest User

Untitled

a guest
May 8th, 2013
480
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.08 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Cloudflare IP Resolver</title>
  5.  
  6.  
  7. <style type="text/css">
  8.  
  9. body
  10. {
  11. color: #F60;
  12. text-shadow: 2px 1px #333;
  13. background-color: #000;
  14. font-family: Arial, Helvetica, sans-serif;
  15. }
  16.  
  17. input
  18. {
  19. font-family: Arial, Helvetica, sans-serif;
  20. }
  21.  
  22. .Button
  23. {
  24. padding: 5px 10px;
  25. background: #333;
  26. border: solid #101010 2px;
  27. color: #F60;
  28. cursor: pointer;
  29. font-weight: bold;
  30. border-radius: 5px;
  31. -moz-border-radius: 5px;
  32. -webkit-border-radius: 5px;
  33. text-shadow: 1px 1px #000;
  34. }
  35.  
  36. .Input
  37. {
  38. border: solid #101010 1px;
  39. color: white;
  40. font-weight: bold;
  41. padding: 3px;
  42. background-color: #252525;
  43. }
  44. </style>
  45. </head>
  46. <body>
  47. <div align="center">
  48. <pre>
  49. _________ .__ .___ _____.__ __________ .__
  50. \_ ___ \| | ____ __ __ __| _// ____\ | _____ _______ ____ \______ \ ____ __________ | |___ __ ___________
  51. / \ \/| | / _ \| | \/ __ |\ __\| | \__ \\_ __ \_/ __ \ | _// __ \ / ___/ _ \| |\ \/ // __ \_ __ \
  52. \ \___| |_( <_> ) | / /_/ | | | | |__/ __ \| | \/\ ___/ | | \ ___/ \___ ( <_> ) |_\ /\ ___/| | \/
  53. \______ /____/\____/|____/\____ | |__| |____(____ /__| \___ > |____|_ /\___ >____ >____/|____/\_/ \___ >__|
  54. \/ \/ \/ \/ \/ \/ \/ \/
  55. Coded By The Alchemist www.HackCommunity.com
  56. </pre>
  57. <form method="POST" action="">
  58. Enter URL :
  59. <input type="text" name="url" class="Input" value="<?php if(isset($_POST['url'])){ echo htmlentities($_POST['url']); } else { echo 'http://example.com';}?>" />
  60. <input type="submit" name="submit" class="Button" value="Resolve" />
  61. </form>
  62. </div>
  63. <div align="left">
  64. <?php
  65.  
  66. //Cloudflare Resolver coded by The Alchemist
  67. //www.hackcommunity.com
  68. //hosted 4 u by www.inforge.net
  69.  
  70. class Cloudflareresolve
  71. {
  72. private $arr = array( 'mail.',
  73. 'direct.',
  74. 'direct-connect.',
  75. 'cpanel.',
  76. 'ftp.',
  77. 'forum.',
  78. 'blog.',
  79. 'm.',
  80. 'dev.',
  81. 'webmail.',
  82. 'record.',
  83. 'ssl.',
  84. 'dns.',
  85. 'help.',
  86. 'www.');
  87.  
  88. private function is_valid($url)
  89. {
  90. if(filter_var($url, FILTER_VALIDATE_URL))
  91. return true;
  92. return false;
  93. }
  94.  
  95. private function is_ip($url)
  96. {
  97. if(filter_var($url, FILTER_VALIDATE_IP))
  98. return true;
  99. return false;
  100. }
  101.  
  102. private function detect_cloudflare($url)
  103. {
  104. $headers = @get_headers($url);
  105. if(strstr($headers[1],"cloudflare"))
  106. return true;
  107. return false;
  108. }
  109.  
  110. private function getip($url)
  111. {
  112. return gethostbyname($url);
  113. }
  114.  
  115. public function resolve($url)
  116. {
  117. if(!$this->is_valid($url))
  118. {
  119. echo '<span style="color: #F60;">The entered URL is not a vaild URL</span>';
  120. exit();
  121. }
  122. if(!$this->detect_cloudflare($url))
  123. {
  124. $urll = parse_url($url);
  125. $url = $urll['host'];
  126. $ip = $this->getip($url);
  127. echo '<span style="color: #F60;">No cloudflare detected<br /><br />';
  128. echo 'IP of '.htmlentities($url).' is ';
  129. if($this->is_ip($ip))
  130. {
  131. echo $ip.'</span>';
  132. }
  133. else
  134. {
  135. echo 'N/A</span>';
  136. }
  137. exit();
  138. }
  139. echo '<span style="color: #F60;">Cloudflare detected! Trying to resolve<br /><br /></span>';
  140. $url_p = parse_url($url);
  141. $url_h = $url_p['host'];
  142. if(strstr($url_h,'www.'))
  143. {
  144. $temp = explode('www.',$url_h);
  145. $url_h = $temp[1];
  146. }
  147. foreach($this->arr as $val)
  148. {
  149. $check_url = $val.$url_h;
  150. echo '<span style="color: #F60;">IP for : '.htmlentities($check_url).' is : ';
  151. $ip = $this->getip($check_url);
  152. if($this->is_ip($ip))
  153. {
  154. echo $ip;
  155. }
  156. else
  157. {
  158. echo 'N/A';
  159. }
  160. echo '<br /></span>';
  161. }
  162. }
  163. }
  164.  
  165. if(isset($_POST['url'],$_POST['submit']))
  166. {
  167. $obj = new Cloudflareresolve();
  168. $obj->resolve($_POST['url']);
  169. }
  170. ?>
  171. </div>
  172. </body>
  173. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement