ToKeiChun

Database Email Extractor [MySQLi]

Sep 18th, 2020 (edited)
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.40 KB | None | 0 0
  1. <?php
  2. ###############################################################
  3. #                   MASS AUTO GRAB MAILER
  4. #       Coded by : Akazh ID
  5. #       Facebook : https://facebook.com/justakazh
  6. #       Github   : https://github.com/justakazh
  7. #       *NB: Want to recode? dont forget to copyright!
  8. ################################################################       
  9. ?>
  10. <!DOCTYPE html>
  11. <html>
  12. <head>
  13.     <title>MASS MAIL GRABBER FROM DATABASE</title>
  14.     <link href='http://nobsec.blogspot.com/favicon.ico' rel='icon' type='image/x-icon'/>
  15. </head>
  16. <style type="text/css">
  17.     body{
  18.         background-color: #333;
  19.         font-family: arial, sans-serif;
  20.         color: #eaeaea;
  21.     }
  22.     input{
  23.         margin-bottom: 10px;
  24.         padding: 10px;
  25.     }
  26.     a{
  27.         color: #fff;
  28.     }
  29.     a:hover{
  30.         color:lime;
  31.     }
  32. </style>
  33. <body>
  34. <center>
  35.     <h1>MASS MAIL GRABBER FROM DATABASE</h1>
  36.     <h3>Coded By: <a href="https://facebook.com/justakazh">Akazh ID</a></h3>
  37. <form action="" method="POST">
  38.     <input type="text" name="host" value="localhost" placeholder="HOST"><br>
  39.     <input type="text" name="user" value="" placeholder="username"><br>
  40.     <input type="text" name="pass" value=""placeholder="password"><br>
  41.     <input type="text" name="db" value="" placeholder="db_name (Optional)"><br>
  42.     <button name="grab"type="submit" class="btn btn-sm btn-danger">Grab</button>
  43. </form>
  44.  
  45. <?php
  46. if (isset($_POST["grab"])) {
  47.     $host = $_POST['host'];
  48.     $user = $_POST['user'];
  49.     $pass = $_POST['pass'];
  50.     $db = $_POST['db'];
  51.  
  52.     $conn = mysqli_connect($host, $user, $pass) or die("gagal  konek");
  53.     $q1 = mysqli_query($conn, "SHOW DATABASES");
  54.     echo "<br>Result:<br><textarea style='width:300px;height:250px;'>";
  55.     while ($database = mysqli_fetch_array($q1)) {
  56.         $q2 = mysqli_query($conn, "SHOW TABLES FROM ".$database['Database']);
  57.         while ($table  = mysqli_fetch_array($q2)) {
  58.             $q3 = mysqli_query($conn, "SHOW COLUMNS FROM ".$database['Database'].".".$table["Tables_in_".$database['Database']]." IN ". $database['Database']);
  59.             while ($columns = mysqli_fetch_array($q3)) {
  60.                 if(preg_match("/email/", $columns['Field'])){
  61.  
  62.                     $final_query = mysqli_query($conn, "SELECT ".$columns["Field"]." FROM ".$database['Database'].".".$table['Tables_in_'.$database['Database']]);
  63.                     while ($email = mysqli_fetch_array($final_query)) {
  64.                         if (strstr($email[$columns['Field']], "@")) {
  65.                             echo $email[$columns['Field']]."\n";
  66.                         }
  67.                     }
  68.  
  69.                 }
  70.             }
  71.         }
  72.     }
  73.     echo "</textarea>";
  74.  
  75. }
  76. ?>
  77. </center>
  78.  
  79. </body>
  80. </html>
Add Comment
Please, Sign In to add comment