Changeset 1360

Show
Ignore:
Timestamp:
08/24/07 21:28:24 (1 year ago)
Author:
till
Message:

- log addressed target in a grep'able way

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • honeytrap/trunk/ChangeLog

    r1356 r1360  
    1111- Improved connection request handling in the nfq stream monitor 
    1212- Reconfiguration on SIGHUP fixed 
     13- Log addressed destination 
    1314Version 0.7.0 
    1415- Plugins can be prioritized 
  • honeytrap/trunk/src/dynsrv.c

    r1356 r1360  
    195195                                if (FD_ISSET(sigpipe[0], &rfds) && (check_sigpipe() == -1)) exit(EXIT_FAILURE); 
    196196                                if (FD_ISSET(listen_fd, &rfds)) { 
    197                                        logmsg(LOG_NOISY, 1
    198                                                "   %s  Connection request from %s.\n", portstr, inet_ntoa(ip_r)); 
     197                                logmsg(LOG_INFO, 1, "   %s  Handling %s connection request from %s:%d to %s:%d.\n"
     198                                        portstr, PROTO(proto), inet_ntoa(ip_r), ntohs(port_r), inet_ntoa(ip_l), ntohs(port_l)); 
    199199 
    200200                                        /* initialize attack record */ 
  • honeytrap/trunk/src/ipqmon.c

    r1355 r1360  
    128128 
    129129                                        /* Got a connection request, start dynamic server and pass packet processing back to the kernel */ 
     130                                        logmsg(LOG_NOISY, 1, "%s:%d requesting %s connection on %s:%d.\n", 
     131                                                inet_ntoa(ip->ip_src), sport, PROTO(ip->ip_p), inet_ntoa(ip->ip_dst), dport); 
    130132                                        switch (port_mode) { 
    131133                                        case PORTCONF_NONE: 
     
    169171                                        if (process == 0) break; 
    170172 
    171                                         logmsg(LOG_NOISY, 1, "%s:%d/%s requesting connection on port %d/%s.\n", 
    172                                                 inet_ntoa(ip->ip_src), sport, PROTO(ip->ip_p), dport, PROTO(ip->ip_p)); 
    173173                                        start_dynamic_server(ip->ip_src, htons(sport), ip->ip_dst, htons(dport), ip->ip_p); 
    174174                                        break; 
  • honeytrap/trunk/src/modules/htm_ftpDownload.c

    r1356 r1360  
    260260                        /* Do FTP transaction */ 
    261261                        return(get_ftp_resource(user, pass, (struct in_addr *) &lhost, 
    262                                                (struct in_addr *) host->h_addr_list[0], atoi(port), file, attack)); 
     262                                (struct in_addr *) host->h_addr_list[0], atoi(port), file, attack)); 
    263263                } 
    264264        } 
     
    361361                case ENETUNREACH: 
    362362                case ETIMEDOUT: 
     363                case EHOSTUNREACH: 
    363364                        if (rhost != (struct in_addr *) &attack->a_conn.r_addr) { 
    364365                                rhost = (struct in_addr *) &attack->a_conn.r_addr; 
  • honeytrap/trunk/src/nfqmon.c

    r1355 r1360  
    3939        struct udp_header *udp; 
    4040        struct tcp_header *tcp; 
    41         char *payload
     41        char *payload, *srcip, *dstip
    4242        uint16_t sport, dport; 
    4343        u_int8_t port_mode; 
     
    8484        } 
    8585 
     86        logmsg(LOG_NOISY, 1, "%s:%d requesting %s connection on %s:%d.\n", 
     87                inet_ntoa(ip->ip_src), sport, PROTO(ip->ip_p), inet_ntoa(ip->ip_dst), dport); 
    8688        switch (port_mode) { 
    8789        case PORTCONF_NONE: 
     
    123125        } 
    124126 
    125         logmsg(LOG_NOISY, 1, "%s:%d/%s requesting connection on port %d/%s.\n", 
    126                 inet_ntoa(ip->ip_src), sport, PROTO(ip->ip_p), dport, PROTO(ip->ip_p)); 
     127        if ((srcip = strdup(inet_ntoa(ip->ip_src))) == NULL) { 
     128                logmsg(LOG_ERR, 1, "Error - Unable to allocate memory: %m.\n"); 
     129                exit(EXIT_FAILURE); 
     130        } 
     131        if ((dstip = strdup(inet_ntoa(ip->ip_dst))) == NULL) { 
     132                logmsg(LOG_ERR, 1, "Error - Unable to allocate memory: %m.\n"); 
     133                exit(EXIT_FAILURE); 
     134        } 
    127135        start_dynamic_server(ip->ip_src, htons(sport), ip->ip_dst, htons(dport), ip->ip_p); 
    128136         
  • honeytrap/trunk/src/pcapmon.c

    r1355 r1360  
    9393        } 
    9494 
     95        if (ip->ip_p == UDP) logmsg(LOG_NOISY, 1, "%s:%d requesting udp connection on %s:%d.\n", 
     96                        inet_ntoa(ip->ip_src), sport, inet_ntoa(ip->ip_dst), dport); 
     97        else if (ip->ip_p == TCP) logmsg(LOG_NOISY, 1, "%s:%d requesting udp connection on %s:%d.\n", 
     98                        inet_ntoa(ip->ip_dst), dport, inet_ntoa(ip->ip_src), sport); 
    9599        switch (port_mode) { 
    96100        case PORTCONF_NONE: 
     
    116120        } 
    117121 
    118         if (ip->ip_p == UDP) { 
    119                 logmsg(LOG_NOISY, 1, "%s:%d/%s requesting connection on port %d/%s.\n", 
    120                         inet_ntoa(ip->ip_src), sport, PROTO(ip->ip_p), dport, PROTO(ip->ip_p)); 
    121                 start_dynamic_server(ip->ip_src, htons(sport), ip->ip_dst, htons(dport), ip->ip_p); 
    122         } else if (ip->ip_p == TCP) { 
    123                 logmsg(LOG_NOISY, 1, "%s:%d/%s requesting connection on port %d/%s.\n", 
    124                         inet_ntoa(ip->ip_dst), dport, PROTO(ip->ip_p), sport, PROTO(ip->ip_p)); 
    125                 start_dynamic_server(ip->ip_dst, htons(dport), ip->ip_src, htons(sport), ip->ip_p); 
    126         } 
     122        if (ip->ip_p == UDP) start_dynamic_server(ip->ip_src, htons(sport), ip->ip_dst, htons(dport), ip->ip_p); 
     123        else if (ip->ip_p == TCP) start_dynamic_server(ip->ip_dst, htons(dport), ip->ip_src, htons(sport), ip->ip_p); 
     124 
    127125        return; 
    128126}