wtorek, 27 stycznia 2015

WeChall.net Write Up - Can you read me

http://www.wechall.net/challenge/can_you_readme/index.php


aptitude install tesseract-ocr tesseract-ocr-eng


cat wechall.php

<?php
$cookie='WC=your_cookie';
$url1='http://www.wechall.net/challenge/can_you_readme/gimme.php';
$ch = curl_init($url1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_COOKIE, $cookie);
$content = curl_exec($ch);
curl_close($ch);
file_put_contents('cos.png', $content);
system("tesseract /tmp/cos.png /tmp/cos -psm 7");
$sol = trim(file_get_contents('/tmp/cos.txt'));
echo $sol;

$url1="http://www.wechall.net/challenge/can_you_readme/index.php?solution=$sol&cmd=Answer";
$ch = curl_init($url1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_COOKIE, $cookie);
$content = curl_exec($ch);
curl_close($ch);
echo $content;
?>


php wechall.net