Advertisement
alsakib945

Database Emails Extractor

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