Cats - RuCTF 2012 Quals
Cats [stegano] / 400
, png, . , "zTXt". , , zlib. : chank1 (14599 ), chank2 (38 ), chank3 (14599 ).
gzuncompress . ...
, , , . , png , , .
, . , . , . .
"bit deeper" , .. . .
. : TosyaMarussiaBessyLuke.
. ! - .
, png, . , "zTXt". , , zlib. : chank1 (14599 ), chank2 (38 ), chank3 (14599 ).
gzuncompress . ...
$s=file_get_contents('chank2');
echo gzuncompress(substr($s,3));
Fourth and last cat is Luke
, , , . , png , , .
<?$img=imagecreatefrombmp('cats.bmp');
$cnt=0;
$bits=array('red'=>'','green'=>'','blue'=>'');
$text=$bits;
for($i=0;$i<600;$i++){
for($r=0;$r<450;$r++){
if($cnt>0 && $cnt%8==0){
foreach($bits as $key => $val){
$text[$key].=chr(base_convert($val,2,10));
$bits[$key]='';
}
}
$idx=imagecolorat($img, $r, $i);
$clr=imagecolorsforindex($img,$idx);
foreach($bits as $key => $val){
$cbits=base_convert($clr[$key],10,2);
$bits[$key].=substr($cbits,-1);
}
$cnt++;
}
break;
}
var_dump($text);
array(3) {
["red"]=>
string(56) "Second cat is Marussia8QX_%OFS@˻>"
["green"]=>
string(56) "Good, but look a bit deeper... \M^Yb{"
["blue"]=>
string(56) "мǢ+O?Ɨz`CuΨ~*7T|B#Pe"
}
, . , . , . .
"bit deeper" , .. . .
Hello, third kitten is Bessy
. : TosyaMarussiaBessyLuke.