Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ##################################################################
- # SETTINGS START
- ##################################################################
- // NOTE: all rows except last must have comma "," at the end of line
- $LOGIN_INFORMATION = array(
- 'passpass',
- 'dpasswordis-hack101'
- );
- define('USE_USERNAME', false);
- define('LOGOUT_URL', 'http://www.google.com');
- define('TIMEOUT_MINUTES', 120);
- // This parameter is only useful when TIMEOUT_MINUTES is not zero
- // true - timeout time from last activity, false - timeout time from login
- define('TIMEOUT_CHECK_ACTIVITY', true);
- ##################################################################
- # SETTINGS END
- ##################################################################
- ///////////////////////////////////////////////////////
- // do not change code below
- ///////////////////////////////////////////////////////
- // show usage example
- if(isset($_GET['help'])) {
- die('Include following code into every page you would like to protect, at the very beginning (first line):<br><?php include("' . str_replace('\\','\\\\',__FILE__) . '"); ?>');
- }
- // timeout in seconds
- $timeout = (TIMEOUT_MINUTES == 0 ? 0 : time() + TIMEOUT_MINUTES * 60);
- // logout?
- if(isset($_GET['logout'])) {
- setcookie("verify", '', $timeout, '/'); // clear password;
- header("Location: $PHP_SELF");
- exit();
- }
- if(!function_exists('showLoginPasswordProtect')) {
- // show login form
- function showLoginPasswordProtect($error_msg) {
- ?>
- <html>
- <head>
- <title>Please enter password to access this page</title>
- <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
- <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
- </head>
- <body>
- <style>
- input { border: 1px solid black; }
- </style>
- <div style="width:500px; margin-left:auto; margin-right:auto; text-align:center">
- <form method="post">
- <h3> Please enter password to access this page</h3>
- <font color="red"><?php echo $error_msg; ?></font><br />
- <?php if (USE_USERNAME) echo 'Login:<br /><input type="input" name="access_login" /><br />Password:<br />'; ?>
- <input type="password" name="access_password" /><p></p><input type="submit" name="Submit" value="Submit" />
- </form>
- </div>
- </body>
- </html>
- <?php
- // stop at this point
- die();
- }
- }
- // user provided password
- if (isset($_POST['access_password'])) {
- $login = isset($_POST['access_login']) ? $_POST['access_login'] : '';
- $pass = $_POST['access_password'];
- if (!USE_USERNAME && !in_array($pass, $LOGIN_INFORMATION)
- || (USE_USERNAME && ( !array_key_exists($login, $LOGIN_INFORMATION) || $LOGIN_INFORMATION[$login] != $pass ) )
- ) {
- showLoginPasswordProtect("Incorrect password.");
- }
- else {
- // set cookie if password was validated
- setcookie("verify", md5($login.'%'.$pass), $timeout, '/');
- // Some programs (like Form1 Bilder) check $_POST array to see if parameters passed
- // So need to clear password protector variables
- unset($_POST['access_login']);
- unset($_POST['access_password']);
- unset($_POST['Submit']);
- }
- }
- else {
- // check if password cookie is set
- if (!isset($_COOKIE['verify'])) {
- showLoginPasswordProtect("");
- }
- // check if cookie is good
- $found = false;
- foreach($LOGIN_INFORMATION as $key=>$val) {
- $lp = (USE_USERNAME ? $key : '') .'%'.$val;
- if ($_COOKIE['verify'] == md5($lp)) {
- $found = true;
- // prolong timeout
- if (TIMEOUT_CHECK_ACTIVITY) {
- setcookie("verify", md5($lp), $timeout, '/');
- }
- break;
- }
- }
- if (!$found) {
- showLoginPasswordProtect("");
- }
- }
- ?>
- <?php
- @$action=$_POST['action'];
- @$from=$_POST['from'];
- @$realname=$_POST['realname'];
- @$replyto=$_POST['replyto'];
- @$subject=$_POST['subject'];
- @$message=$_POST['message'];
- @$emaillist=$_POST['emaillist'];
- @$file_name=$_FILES['file']['name'];
- @$contenttype=$_POST['contenttype'];
- @$file=$_FILES['file']['tmp_name'];
- @$amount=$_POST['amount'];
- set_time_limit(intval($_POST['timelimit']));
- if ($_SERVER["HTTP_X_FORWARDED_FOR"]){
- $ip = $_SERVER["HTTP_X_FORWARDED_FOR"];
- }else{
- $ip = $_SERVER["REMOTE_ADDR"];
- }
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html>
- <head>
- <title>CodedCoder's Blaster</title>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <style type="text/css">
- <!--
- .style1 {
- font-family: Geneva, Arial, Helvetica, sans-serif;
- font-size: 12px;
- }
- .style2 {
- font-size: 10px;
- font-family: Geneva, Arial, Helvetica, sans-serif;
- }
- .Times-New-Roman-16px00468Cb {font:bold 16px Times New Roman, serif; color:#00468C}
- .Times-New-Roman-24px00468Cb {font:bold 24px Times New Roman, serif; color:#000000}
- .Times-New-Roman-32px00468Cb {font:bold 32px Times New Roman, serif; color:#000000}
- .style3 {color: #000000}
- -->
- </style>
- </head>
- <body bgcolor="#C0C0C0" text="#000000">
- <p>
- <font color="#00468C"><b>CodedCoder's Blaster</b></font></p>
- <p> </p>
- <?php
- If ($action=="mysql"){
- //Grab email addresses from MySQL
- include "./mysql.info.php";
- if (!$sqlhost || !$sqllogin || !$sqlpass || !$sqldb || !$sqlquery){
- print "Please configure mysql.info.php with your MySQL information. All settings in this config file are required.";
- exit;
- }
- $db = mysql_connect($sqlhost, $sqllogin, $sqlpass) or die("Connection to MySQL Failed.");
- mysql_select_db($sqldb, $db) or die("Could not select database $sqldb");
- $result = mysql_query($sqlquery) or die("Query Failed: $sqlquery");
- $numrows = mysql_num_rows($result);
- for($x=0; $x<$numrows; $x++){
- $result_row = mysql_fetch_row($result);
- $oneemail = $result_row[0];
- $emaillist .= $oneemail."\n";
- }
- }
- if ($action=="send"){ $message = urlencode($message);
- $message = ereg_replace("%5C%22", "%22", $message);
- $message = urldecode($message);
- $message = stripslashes($message);
- $subject = stripslashes($subject);
- }
- ?>
- <form name="form1" method="post" action="" enctype="multipart/form-data"><br />
- <table width="142" border="0">
- <tr>
- <td width="81">
- <div align="right">
- <font size="-3" face="Verdana, Arial, Helvetica, sans-serif">Your Email:</font>
- </div>
- </td>
- <td width="219">
- <font size="-3" face="Verdana, Arial, Helvetica, sans-serif">
- <input type="text" name="from" value="<?php print $from; ?>" size="30" />
- </font>
- </td>
- <td width="212">
- <div align="right">
- <font size="-3" face="Verdana, Arial, Helvetica, sans-serif">Your Name:</font>
- </div>
- </td>
- <td width="278">
- <font size="-3" face="Verdana, Arial, Helvetica, sans-serif">
- <input type="text" name="realname" value="<?php print $realname; ?>" size="30" />
- </font>
- </td>
- </tr>
- <tr>
- <td width="81">
- <div align="right">
- <font size="-3" face="Verdana, Arial, Helvetica, sans-serif">Reply-To:</font>
- </div>
- </td>
- <td width="219">
- <font size="-3" face="Verdana, Arial, Helvetica, sans-serif">
- <input type="text" name="replyto" value="<?php print $replyto; ?>" size="30" />
- </font>
- </td>
- <td width="212">
- <div align="right">
- <font size="-3" face="Verdana, Arial, Helvetica, sans-serif">Attach File:</font>
- </div>
- </td>
- <td width="278">
- <font size="-3" face="Verdana, Arial, Helvetica, sans-serif">
- <input type="file" name="file" size="24" />
- </font>
- </td>
- </tr>
- <tr>
- <td width="81">
- <div align="right">
- <font size="-3" face="Verdana, Arial, Helvetica, sans-serif">Subject:</font>
- </div>
- </td>
- <td colspan="3" width="703">
- <font size="-3" face="Verdana, Arial, Helvetica, sans-serif">
- <input type="text" name="subject" value="<? print $subject; ?>" size="90" />
- </font>
- </td>
- </tr>
- <tr valign="top">
- <td colspan="3" width="520">
- <font face="Verdana, Arial, Helvetica, sans-serif" size="-3">Message Box :</font>
- </td>
- <td width="278">
- <font face="Verdana, Arial, Helvetica, sans-serif" size="-3">Email Target :</font>
- </td>
- </tr>
- <tr valign="top">
- <td colspan="3" width="520">
- <font size="-3" face="Verdana, Arial, Helvetica, sans-serif">
- <textarea name="message" cols="56" rows="10"><?php print $message; ?></textarea><br />
- <input type="radio" name="contenttype" value="plain" /> Plain
- <input type="radio" name="contenttype" value="html" checked /> HTML
- <input type="hidden" name="action" value="send" /><br />
- Number to send: <input type="text" name="amount" value="1" size="10" /><br />
- Maximum script execution time(in seconds, 0 for no timelimit)<input type="text" name="timelimit" value="0" size="10" />
- <input type="submit" value="Send eMails" />
- </font>
- </td>
- <td width="278">
- <font size="-3" face="Verdana, Arial, Helvetica, sans-serif">
- <textarea name="emaillist" cols="32" rows="10"><?php print $emaillist; ?></textarea>
- </font><font size="2"><font color="#008000"> </font><a href="<?php echo $_SERVER['PHP_SELF'] ?>?logout=1"><font color="#008000">
- Logout</font></a></font>
- <p> </p>
- <p><font size="2">
- </font>
- </td>
- </tr>
- </table>
- </form>
- <?php
- if ($action=="send"){
- if (!$from && !$subject && !$message && !$emaillist){
- print "Please complete all fields before sending your message.";
- exit;
- }
- $allemails = split("\n", $emaillist);
- $numemails = count($allemails);
- $filter = "maillist";
- $float = "mailist info <full@info.com>";
- //Open the file attachment if any, and base64_encode it for email transport
- If ($file_name){
- if (!file_exists($file)){
- die("The file you are trying to upload couldn't be copied to the server");
- }
- $content = fread(fopen($file,"r"),filesize($file));
- $content = chunk_split(base64_encode($content));
- $uid = strtoupper(md5(uniqid(time())));
- $name = basename($file);
- }
- for($xx=0; $xx<$amount; $xx++){
- for($x=0; $x<$numemails; $x++){
- $to = $allemails[$x];
- if ($to){
- $to = ereg_replace(" ", "", $to);
- $message = ereg_replace("&email&", $to, $message);
- $subject = ereg_replace("&email&", $to, $subject);
- $nrmail=$x+1;
- print "Blasting mail $nrmail of $numemails to $to.......";
- flush();
- $header = "From: $realname <$from>\r\nReply-To: $replyto\r\n";
- $header .= "MIME-Version: 1.0\r\n";
- If ($file_name) $header .= "Content-Type: multipart/mixed; boundary=$uid\r\n";
- If ($file_name) $header .= "--$uid\r\n";
- $header .= "Content-Type: text/$contenttype\r\n";
- $header .= "Content-Transfer-Encoding: 8bit\r\n\r\n";
- $header .= "$message\r\n";
- If ($file_name) $header .= "--$uid\r\n";
- If ($file_name) $header .= "Content-Type: $file_type; name=\"$file_name\"\r\n";
- If ($file_name) $header .= "Content-Transfer-Encoding: base64\r\n";
- If ($file_name) $header .= "Content-Disposition: attachment; filename=\"$file_name\"\r\n\r\n";
- If ($file_name) $header .= "$content\r\n";
- If ($file_name) $header .= "--$uid--";
- mail($to, $subject, "", $header);
- print "Sent<br>";
- flush();
- }
- }
- }
- }
- ?>
- <p>
- <font size="2"> </font>
- </p>
- <p class="style2">
- </p>
- <p class="style2">
-
- Copyright Major Hammer inc. (2009)</p>
- <p class="style2">
-
- <font color="#00468C"><b> <font size="2"><a href="mailto:codedcoder@live.com">Β©OdedΒ©Oder™</a></font></b></font></p>
- <p class="style2">
- </p>
- <p class="style1"> </p>
- </body>
- </html>
Add Comment
Please, Sign In to add comment