Changeset 736

Show
Ignore:
Timestamp:
01/12/07 11:01:02 (2 years ago)
Author:
common
Message:

nepenthes

  • module-honeytrap, proper port for pcap mode
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • nepenthes/trunk/modules/module-honeytrap/TrapSocket.cpp

    r691 r736  
    783783        printIPpacket(data,size); 
    784784 
     785        uint16_t port; 
     786 
     787        if ( tcp->th_flags & TH_SYN && !(tcp->th_flags & TH_ACK) ) 
     788                port = ntohs(tcp->th_dport); // inline mode 
     789        else 
     790                port = ntohs(tcp->th_sport); // pcap mode 
     791 
    785792        if (1)// isPortListening(ntohs(tcp->th_dport),*(uint32_t *)&(ip->ip_dst)) == false ) 
    786793        { 
    787                 logInfo("Connection to unbound port %i requested, binding port\n",ntohs(tcp->th_dport)); 
    788  
    789                 Socket *sock = g_Nepenthes->getSocketMgr()->bindTCPSocket(INADDR_ANY,ntohs(tcp->th_dport),60,60); 
     794                logInfo("Connection to unbound port %i requested, binding port\n",port); 
     795 
     796                Socket *sock = g_Nepenthes->getSocketMgr()->bindTCPSocket(INADDR_ANY,port,60,60); 
    790797                if ( sock != NULL && (sock->getDialogst()->size() == 0 && sock->getFactories()->size() == 0) ) 
    791798                {