orangetw/My-CTF-Web-Challenges

Hitcon 2015 lalala web400 task 这个writeup奇怪

leveryd opened this issue · 1 comments

返回的数据经过了check_image函数才能保存到磁盘中,那么这个writeup中用file:///index.php读的内容,应该不能保存到磁盘中.

那么是怎么可以读到index.php,或者/etc/nginx/sites-enabled/default文件呢?

        if ( $http_info['http_code'] == 404 ){
            alert('not found');
        } else{
            if ( check_image($data) )
                file_put_contents($DIR . $filename, $data);
        }

Check Image 失敗會將檔案內容放置到錯誤訊息中
lalala.php#L69