Changeset 721

Show
Ignore:
Timestamp:
12/29/06 08:06:49 (2 years ago)
Author:
common
Message:

nepenthes

  • vuln-sav copied from x2
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • nepenthes/trunk/modules/vuln-sav/x-2.cpp

    r550 r721  
    218218        return CL_ASSIGN; 
    219219*/ 
     220 
    220221        char *message = (char *)malloc(msg->getSize()+1); 
    221222        memset(message,0,msg->getSize()+1); 
     
    261262//      msg->getResponder()->doRespond("deine mutter\n",strlen("deine mutter\n")); 
    262263        return CL_ASSIGN; 
     264 
     265/* 
     266        string command(msg->getMsg(),msg->getSize()); 
     267 
     268        unsigned int offset; 
     269        if (((offset = command.find("list"))) < command.size() ) 
     270        { 
     271                int fd; 
     272 
     273                for (fd=0;fd<64*1024;fd++) 
     274                { 
     275                        int32_t iError = 0; 
     276                        int32_t iSize = sizeof(iError); 
     277 
     278 
     279                        if (getsockopt(fd,SOL_SOCKET, SO_ERROR, &iError,(socklen_t *) &iSize) == 0 ) 
     280                        { 
     281                                if (iError != 0) 
     282                        continue; 
     283 
     284                                struct sockaddr_in addrLocal; 
     285                                iSize = sizeof(addrLocal); 
     286 
     287                                if ( getsockname(fd, (struct sockaddr *) &addrLocal, (socklen_t *) &iSize) != 0 ) 
     288                                        continue; 
     289 
     290                                struct sockaddr_in addrRemote; 
     291                                iSize = sizeof(addrRemote); 
     292                                if ( getpeername(fd, (struct sockaddr *) &addrRemote, (socklen_t *) &iSize) != 0 ) 
     293                                        continue; 
     294 
     295 
     296                                string localhost,remotehost; 
     297 
     298                                localhost = inet_ntoa(*(struct in_addr *)&((sockaddr_in)addrLocal).sin_addr); 
     299                                remotehost = inet_ntoa(*(struct in_addr *)&((sockaddr_in)addrRemote).sin_addr); 
     300 
     301                                logInfo("%i %-15s -> %-15s\n",fd,localhost.c_str(),remotehost.c_str()); 
     302 
     303                                close(fd); 
     304            } 
     305                } 
     306        } 
     307 
     308        return CL_ASSIGN; 
     309*/       
    263310} 
    264311