cursed Posted January 24, 2007 Share Posted January 24, 2007 Error:Warning: fgets(): supplied argument is not a valid stream resource in /user/public_html/decode/unlock.php(49) : eval()'d code on line 1Warning: fgets(): supplied argument is not a valid stream resource in /user/public_html/decode/unlock.php(49) : eval()'d code on line 1Warning: fgets(): supplied argument is not a valid stream resource in /user/public_html/decode/unlock.php(49) : eval()'d code on line 1Code:[code=php:0]<?php$input = file_get_contents( $filename = 'index.php');if (ereg("[$]([^=]+)=[_][_]FILE[_][_][;]". "[$]([^=]+)=[_][_]LINE[_][_][;]". "[$]([^=]+)[=]([0-9]+)[;]". "eval.*(base64_decode.['][^']*['].)", $input, $x)) {// first pass$ifilename = $x[1];$ilinenum= $x[2];$ioffset= $x[3];$offset= $x[4];$decoder= $x[5];// get the decoder$decoder = eval("return $decoder;");// decipher the decoderereg("[$]([^=]+)[=].*[$]([^=]+)=.base64",$decoder,$x);$ihandle = $x[1];$iout= $x[2];$decoder = str_replace($iout,'output',$decoder);$decoder = str_replace($ihandle,'handle',$decoder);$decoder = str_replace($ilinenum ,'line',$decoder);$decoder = str_replace($ifilename,'filename',$decoder);// the decoder is our slave!$decoder = str_replace('eval($output);','return $output;',$decoder);$decoder = '$line=2;'.$decoder;// sandbox$next= eval($decoder);// remove expiration time$next = ereg_replace("^if[^;]+;",'',$next);// some more decipheringereg('^[$]([^=]+)=',$next,$x);$next = str_replace($ihandle,'handle',$next);$next = str_replace($ifilename,'filename',$next);$next = str_replace($x[1],'output',$next);$next = str_replace($ioffset,'offset',$next);// the decoder is our slave, again!$next = str_replace('eval($output)','return $output',$next);// final pass$code = eval($next);// finishecho '<','?php',$code,'?','>',"\n";} else die("Failed. No base64_decode anymore.\n");?>[/code]what am i doing wrong? Link to comment https://forums.phpfreaks.com/topic/35460-solved-evald-code-error/ Share on other sites More sharing options...
Jessica Posted January 24, 2007 Share Posted January 24, 2007 $input = file_get_contents( $filename = 'index.php');$filename='index.php' evaluates to true. So you're doing$input = file_get_contents(TRUE);Change it to:$input = file_get_contents('index.php');or define $filename before the function call. Link to comment https://forums.phpfreaks.com/topic/35460-solved-evald-code-error/#findComment-167787 Share on other sites More sharing options...
cursed Posted January 25, 2007 Author Share Posted January 25, 2007 hmm.. same error.I tried $input = file_get_contents('index.php'); but no dice. Link to comment https://forums.phpfreaks.com/topic/35460-solved-evald-code-error/#findComment-168599 Share on other sites More sharing options...
cursed Posted January 27, 2007 Author Share Posted January 27, 2007 bump? Link to comment https://forums.phpfreaks.com/topic/35460-solved-evald-code-error/#findComment-170610 Share on other sites More sharing options...
Jessica Posted January 27, 2007 Share Posted January 27, 2007 You're not even using fgets in this code. Is this even the right file? Link to comment https://forums.phpfreaks.com/topic/35460-solved-evald-code-error/#findComment-170647 Share on other sites More sharing options...
cursed Posted January 27, 2007 Author Share Posted January 27, 2007 strange.. now it works with a different host. Link to comment https://forums.phpfreaks.com/topic/35460-solved-evald-code-error/#findComment-170702 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.