...

View Full Version : Help with orientation of objects



HG3
09-08-2011, 06:42 PM
I'm new to PHP and wanted help to improve this code which incidentally is not mine.

<?php

echo "<h2>Decode Eval</h2>";
echo "<form action='' method='post'>";
echo "<b>C&oacute;digo</b>: <p><textarea name=cod cols=100 rows=20></textarea></p>";
echo "<input type='submit' value=' Decode '>";
echo "<hr><br />";

//Kodlama By s4l1h


if($_POST['cod']){
$ac=$_POST['cod'];
$ac=preg_replace("/<\?php|\?>/", "", $ac);
$ac=preg_replace("/<\?|\?>/", "", $ac);

$desen="|eval\((.*)\((.*)\(\'(.*)\'\)\)\)\;|siU"; // eval(gzinflate(base64_decode('FZ3HjuvQlUV...')));
$desen2="|eval\((.*)\((.*)\((.*)\(\'(.*)\'\)\)\)\)\;|siU"; //eval(gzinflate(str_rot13(base64_decode('FZ3HjuvQlUV...'))));
$desen3="|eval\((.*)\(\'(.*)\'\)\)\;|siU"; // eval(base64_decode('aWYoJGF...'));

$x=1;

while(preg_match($desen,$ac,$cik) OR (preg_match($desen2,$ac,$cik)) OR (preg_match($desen3,$ac,$cik))){
eval(str_replace('eval','$ac=',$ac));
$x++;
}
echo "<font color='red'>$x Desencryptografado(s)</font><br>";
$sonuc=('<?php

'.
$ac
.'');
}
echo "<h1>Resultado</h1>";
echo "<textarea cols=100 rows=20>$sonuc</textarea><br>";
echo "<h1>C&oacute;digo</h1>";
highlight_string($sonuc);


it does not decode using METHOD POSTas above.

more if I do it yes, it works

$ac=@file_get_contents("script/coded.txt")
can anyone help me?

Fou-Lu
09-08-2011, 08:12 PM
First and foremost, you'll need to use htmlspecialchars if you want to be able to see the results within a text area. Having the <?php tags instantly turns this into an HTML tag where depending on what's in the body string wise determines if you'll ever see anything in the text area or not.
This also has nothing to do with objects. At all.
On a side note, something sure feels unsavoury about this as well.

HG3
11-08-2011, 09:24 PM
First and foremost, you'll need to use htmlspecialchars if you want to be able to see the results within a text area. Having the <?php tags instantly turns this into an HTML tag where depending on what's in the body string wise determines if you'll ever see anything in the text area or not.
This also has nothing to do with objects. At all.
On a side note, something sure feels unsavoury about this as well.

infelismento not know how to make do you said, if have someone who can help me I am very grateful



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum