Código PHP:
<?php
header('Content-Type: text/html; charset=UTF-8');
set_time_limit(0);
ini_set('memory_limit', '1512M');
error_reporting(0);
//inici sesio
function con_ses(){
$_SESSION['c0']++;
echo $_SESSION['c0'];
}
session_start();
$scri0="<script>
window['W']=window;W['D']=document;
W['idiv']=document.createElement('div');W['s']='';
for(k in window){if(s.indexOf(','+k+',')>0){}else{s=(s=='')?k:s+','+k;}};
for(k in idiv.style){if(s.indexOf(','+k+',')>0){}else{s=s+','+k;}};
for(k in idiv){if(s.indexOf(','+k+',')>0){}else{s=s+','+k;}};
W['NU']=function(){};
W['AJ']=function(){var r=false;try {r=new XMLHttpRequest();}catch(e){try{r=new ActiveXObject('Msxml2.XMLHTTP');}catch(e){try{r=new ActiveXObject('Microsoft.XMLHTTP');}catch(e){r=false;}}}return r;}
W['Aj']=function(){var a=arguments;var h=AJ();var r=new W['Date']().getTime();var v=(a[1]=='')?null:a[1];
var z=(a[4]==0)?false:true;
var t=(a[2]==0)?'GET':'POST';var p=(a[2]==0)?a[0]+'?r='+r+'&'+v:a[0];h.open(t,p,z);h.setRequestHeader('Content-type','application/x-www-form-urlencoded');h.send(v);h.onreadystatechange=function(){if(h.readyState==4&&h.status==200){var j=h.responseText;h.responseText='';a[3](j);}else{}}}
";
if(!$_SESSION['c0']){///////////////////////////////////////////////////////////1
$_SESSION['c0']=0;
con_ses();
echo $scri0."
Aj(location.href,'aaa='+s,1,W['NU'],0);
W.location.assign(location.href);
</script>
";
}else if($_SESSION['c0']==1){///////////////////////////////////////////////////2
$_SESSION['windowcodes']=$_POST['aaa'];con_ses();
}else if($_SESSION['c0']==2){///////////////////////////////////////////////////3
$A=explode(',',$_SESSION['windowcodes']);
echo "<html><head></head><body id='ibody'></body>".$scri0.//apartir d'aqui aixo es zona de comprobacio el que vol dir es que realment anira a fora apartir d'aqui
"
W['z']=s.split(',');W['x']='';
x='";
for($f=0;$f<count($A);$f++){
echo "".$f." -> '+z[".$f."]+' -> ".$A[$f]."<br>";
}
echo "';
document.getElementById('ibody').innerHTML=x+'<br><br>';
Aj(location.href,'bbb=',1,W['NU'],1);
</script></html>";
con_ses();
echo '<br>';
}else{
con_ses();
echo '<br>'.$_SESSION['windowcodes'];
}
?>