Changeset 1361
- Timestamp:
- 08/24/07 21:42:59 (1 year ago)
- Files:
-
- honeytrap/trunk/src/dynsrv.c (modified) (2 diffs)
- honeytrap/trunk/src/ipqmon.c (modified) (2 diffs)
- honeytrap/trunk/src/nfqmon.c (modified) (2 diffs)
- honeytrap/trunk/src/pcapmon.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
honeytrap/trunk/src/dynsrv.c
r1360 r1361 116 116 port_mode = port_flags_udp[htons(port_l)]->mode; 117 117 } 118 119 ip_l_str = strdup(inet_ntoa(ip_l));120 ip_r_str = strdup(inet_ntoa(ip_r));121 118 122 119 #ifndef USE_IPQ_MON … … 195 192 if (FD_ISSET(sigpipe[0], &rfds) && (check_sigpipe() == -1)) exit(EXIT_FAILURE); 196 193 if (FD_ISSET(listen_fd, &rfds)) { 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)); 194 if ((ip_l_str = strdup(inet_ntoa(ip_l))) == NULL) { 195 logmsg(LOG_ERR, 1, "Error - Unable to allocate memory: %m.\n"); 196 exit(EXIT_FAILURE); 197 } 198 if ((ip_r_str = strdup(inet_ntoa(ip_r))) == NULL) { 199 logmsg(LOG_ERR, 1, "Error - Unable to allocate memory: %m.\n"); 200 exit(EXIT_FAILURE); 201 } 202 logmsg(LOG_INFO, 1, " %s Handling %s connection request from %s:%d to %s:%d.\n", 203 portstr, PROTO(proto), ip_r_str, ntohs(port_r), ip_l_str, ntohs(port_l)); 204 free(ip_r_str); 205 free(ip_l_str); 199 206 200 207 /* initialize attack record */ honeytrap/trunk/src/ipqmon.c
r1360 r1361 42 42 fd_set rfds; 43 43 struct timeval mainloop_timeout; 44 char *srcip, *dstip; 44 45 unsigned char buf[BUFSIZE]; 45 46 struct ip_header *ip; … … 128 129 129 130 /* Got a connection request, start dynamic server and pass packet processing back to the kernel */ 131 if ((srcip = strdup(inet_ntoa(ip->ip_src))) == NULL) { 132 logmsg(LOG_ERR, 1, "Error - Unable to allocate memory: %m.\n"); 133 exit(EXIT_FAILURE); 134 } 135 if ((dstip = strdup(inet_ntoa(ip->ip_dst))) == NULL) { 136 logmsg(LOG_ERR, 1, "Error - Unable to allocate memory: %m.\n"); 137 exit(EXIT_FAILURE); 138 } 130 139 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); 140 srcip, sport, PROTO(ip->ip_p), dstip, dport); 141 free(srcip); 142 free(dstip); 143 132 144 switch (port_mode) { 133 145 case PORTCONF_NONE: honeytrap/trunk/src/nfqmon.c
r1360 r1361 84 84 } 85 85 86 if ((srcip = strdup(inet_ntoa(ip->ip_src))) == NULL) { 87 logmsg(LOG_ERR, 1, "Error - Unable to allocate memory: %m.\n"); 88 exit(EXIT_FAILURE); 89 } 90 if ((dstip = strdup(inet_ntoa(ip->ip_dst))) == NULL) { 91 logmsg(LOG_ERR, 1, "Error - Unable to allocate memory: %m.\n"); 92 exit(EXIT_FAILURE); 93 } 86 94 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); 95 srcip, sport, PROTO(ip->ip_p), dstip, dport); 96 free(srcip); 97 free(dstip); 98 88 99 switch (port_mode) { 89 100 case PORTCONF_NONE: … … 125 136 } 126 137 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 }135 138 start_dynamic_server(ip->ip_src, htons(sport), ip->ip_dst, htons(dport), ip->ip_p); 136 139 honeytrap/trunk/src/pcapmon.c
r1360 r1361 71 71 uint16_t sport, dport; 72 72 u_int8_t port_mode; 73 char *srcip, *dstip; 73 74 74 75 sport = 0; … … 93 94 } 94 95 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); 96 if ((srcip = strdup(inet_ntoa(ip->ip_src))) == NULL) { 97 logmsg(LOG_ERR, 1, "Error - Unable to allocate memory: %m.\n"); 98 exit(EXIT_FAILURE); 99 } 100 if ((dstip = strdup(inet_ntoa(ip->ip_dst))) == NULL) { 101 logmsg(LOG_ERR, 1, "Error - Unable to allocate memory: %m.\n"); 102 exit(EXIT_FAILURE); 103 } 104 if (ip->ip_p == UDP) 105 logmsg(LOG_NOISY, 1, "%s:%d requesting udp connection on %s:%d.\n", 106 srcip, sport, dstip, dport); 107 else if (ip->ip_p == TCP) 108 logmsg(LOG_NOISY, 1, "%s:%d requesting tcp connection on %s:%d.\n", 109 dstip, dport, srcip, sport); 110 free(srcip); 111 free(dstip); 112 99 113 switch (port_mode) { 100 114 case PORTCONF_NONE:
