PalmaSolutions

112.php

May 5th, 2018
573
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 8.49 KB | None | 0 0
  1. <?php
  2. Error_Reporting(E_ALL & ~E_NOTICE);
  3. @$action=$_POST['action'];
  4. @$namesender=$_POST['namesender'];
  5. @$from=$_POST['from'];
  6. @$subject=$_POST['subject'];
  7. @$text=$_POST['text'];
  8. @$to=$_POST['to'];
  9. @$contenttype=$_POST['contenttype'];
  10. @$priority=$_POST['priority'];
  11. @$notification=$_POST['notification'];
  12. @$emaillist=$_POST['emaillist'];
  13. @$file=$_FILES['file']['tmp_name'];
  14. @$attach=$_FILES['attach_file']['tmp_name'];
  15. @$attach_name=$_FILES['attach_file']['name'];
  16. ?>
  17. <!DOCTYPE html>
  18. <html>
  19. <head>
  20.     <title>FakeSender by POCT [FuckAV.ru]</title>
  21.     <style type="text/css">
  22.         * { font: 12px arial, verdana, sans-serif; }
  23.     </style>
  24.     <meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
  25. </head>
  26. <body>
  27. <hr noshade size="5" width="75%">
  28.     <div align="center">
  29.     <font color=red>FakeSender by POCT</font><br>
  30.     Special for <a href="http://fuckav.ru" target="_blank">FuckAV.ru</a>
  31.     </div>
  32. <hr noshade size="5" width="75%"><br>
  33. <form name="form" method="post" enctype="multipart/form-data">
  34.   <table border="0" align="center">
  35.     <tr>
  36.         <td align="right">��� �����������:</td>
  37.         <td><input type="text" name="namesender" value="��� �����������" style='width: 270px;' /></td>
  38.     </tr>
  39.     <tr>
  40.         <td align="right">����� �����������:</td>
  41.         <td><input type="text" name="from" value="[email protected]" style='width: 270px;' /></td>
  42.         <td colspan="2"><input type="text" name="subject" value="���� ������" style='width: 520px;' /></td>
  43.     </tr>
  44.     <tr>
  45.         <td align="right">���������� ����:</td>
  46.         <td><input type="file" name="attach_file" /></td>
  47.         <td><input type="checkbox" name="priority" value="priority1"/>������ ������?</td>
  48.         <td><input type="checkbox" name="notification" value="notification1"/>����������� � ��������� (������ mail.ru)</td>
  49.     </tr>
  50.     <tr valign="top">
  51.         <td align="right">����:<br />(������ �������)</td>
  52.         <td><textarea name="emaillist" rows="10" style='width: 268px;' />[email protected]</textarea></td>   
  53.         <td colspan="2">
  54.             <textarea name="text" rows="10" style='width: 518px;' />����� ���������� ����� ���������, ������� ����� ��������� � ������, ���� ���������� ����� ������ � ���� &quot;������� �����&quot;</textarea><br />
  55.             <input type="radio" name="contenttype" value="words" /> ������� ����� (��. �����)<br />
  56.             <input type="radio" name="contenttype" value="file" checked="checked" /> ���� � ���� ����� html (POCT.html) - �� ���������
  57.             <input type="hidden" name="action" value="send" /><br /><br />
  58.             <input type="submit" value="��������� ������" />
  59.         </td>    
  60.     </tr>
  61.   </table>
  62. </form>
  63. <hr noshade size="5" width="75%">
  64. <?php
  65. // �������� ������
  66. if ($priority=="priority1"){
  67.     $priority="X-Priority: 1"; // ������ ������
  68. }
  69. else{
  70.     $priority="X-Priority: "; // �������� ������
  71. }
  72.  
  73. if ($action=="send"){               // ���� ����� ������ ������ "��������� ������"
  74.     $filename = "POCT.html";            // �������� �����-�����
  75.     if ($contenttype=="file"){                  // ���� ����� ������� � "�����", ��...
  76.         if(file_exists($filename)){         // ���������� �� ����� ����?
  77.             $file=fopen($filename,"r");
  78.             $text=fread($file, filesize($filename));            // ���������� text ����� ��������� ����� �� ��������� �����
  79.             fclose($file);
  80.         }
  81.         else{
  82.             echo "<br /> <font color='Red'>Error: ����� $filename ���! ������, ������� ���. </font><br />";
  83.             break;
  84.         }
  85.     }  
  86.    
  87.     if ($attach_name){
  88.         if (!file_exists($attach)){
  89.             die("����, ������� �� ��������� ���������, �� ����� ���� �������� �� ������");
  90.         }
  91.         $content = fread(fopen($attach,"r"),filesize($attach));
  92.         $content = chunk_split(base64_encode($content));
  93.         $uid = strtoupper(md5(uniqid(time())));
  94.         $uid = "----$uid";
  95.         $orig_name = $attach_name;
  96.         $attach_name = '=?KOI8-R?B?'.base64_encode(convert_cyr_string($attach_name, "w","k")).'?=';
  97.     }
  98.  
  99.     $file_extension = strtolower(substr(strrchr($orig_name,"."),1)); // ���������� �������-��� ����� �� ����������
  100.     switch( $file_extension ) {
  101.         case "pdf": $ctype="application/pdf"; break;
  102.         case "exe": $ctype="application/octet-stream"; break;
  103.         case "zip": $ctype="application/zip"; break;
  104.         case "rar": $ctype="application/rar"; break;
  105.         case "doc": $ctype="application/msword"; break;
  106.         case "xls": $ctype="application/vnd.ms-excel"; break;
  107.         case "ppt": $ctype="application/vnd.ms-powerpoint"; break;
  108.         case "gif": $ctype="image/gif"; break;
  109.         case "png": $ctype="image/png"; break;
  110.         case "jpeg":
  111.         case "jpg": $ctype="image/jpg"; break;
  112.         case "mp3": $ctype="audio/mpeg"; break;
  113.         case "mpeg":
  114.         case "mpg":
  115.         case "mpe": $ctype="video/mpeg"; break;
  116.         case "mov": $ctype="video/quicktime"; break;
  117.         case "avi": $ctype="video/x-msvideo"; break;
  118.         case "php": $ctype="application/octet-stream"; break;
  119.         case "htm":
  120.         case "html": $ctype="text/html"; break;
  121.         case "txt": $ctype="text/plain"; break;
  122.         default: $ctype="application/force-download";
  123.     }
  124.    
  125.     $text = convert_cyr_string($text, 'w', 'k');
  126.     $text = chunk_split(base64_encode($text));
  127.     $subject = '=?KOI8-R?B?'.base64_encode(convert_cyr_string($subject, "w","k")).'?=';
  128.     $namesender = '=?KOI8-R?B?'.base64_encode(convert_cyr_string($namesender, "w","k")).'?=';
  129.     $from = "$namesender <$from>";
  130.    
  131.     $all_emails = split("\n", $emaillist);      //�������� ���� ������ ������� ����� �������
  132.     $num_emails = count($all_emails);           //���������� ������� � ���� ������
  133.  
  134.     for($x=0; $x<$num_emails; $x++){                // �������� ����� "�� ������ ������ ������" � ����� "+1" "�� ����� ������"
  135.         //$all_emails[$x] = ereg_replace(" ", "", $all_emails[$x]);         // ������� �������� ������� - ����� 100%
  136.         $to = $all_emails[$x];          //���� "����" ����� �������� ��������� � ������������ �� �������
  137.         $header = "From: $from\n";
  138.         $header .= "$priority\r\n";         // ������ ������ ��� ���   
  139.         if ($notification=="notification1"){
  140.             $header .= "Disposition-Notification-To: $from\r\n"; // ����� � ���������
  141.         }
  142.         $header .= "X-Mailer: mPOP Web-Mail 2.19\r\n";
  143.         $header .= "MIME-Version: 1.0\r\n";
  144.         if ($attach_name) $header .= "Content-Type: multipart/mixed; boundary=\"$uid\"\r\n\r\n\r\n";
  145.         if ($attach_name) $header .= "--$uid\r\n";
  146.         $header .= "Content-Type: text/html; charset=koi8-r\r\n";
  147.         $header .= "Content-Transfer-Encoding: base64\r\n\r\n";
  148.         $header .= "$text\r\n";
  149.         if ($attach_name) $header .= "--$uid\r\n";
  150.         if ($attach_name) $header .= "Content-Type: $ctype; name=\"$attach_name\"\r\n";
  151.         if ($attach_name) $header .= "Content-Disposition: attachment\r\n";
  152.         if ($attach_name) $header .= "Content-Transfer-Encoding: base64\r\n\r\n";
  153.         if ($attach_name) $header .= "$content\r\n";
  154.         if ($attach_name) $header .= "--$uid--";       
  155.         if(mail($to, $subject, $message, $header))
  156.             echo "<br /><div align='center'><font color='Lime'>Ok. ������ ���������� �� e-mail $to</font></div>";
  157.         else
  158.             echo "<br /><div align='center'><font color='Red'>Error: ������ �� ���� ���������� $to </font></div>";
  159.     }
  160. }
  161. ?>
  162. </body>
  163. </html>
Advertisement
Add Comment
Please, Sign In to add comment