Changeset 1677
- Timestamp:
- 07/31/08 21:18:45 (2 months ago)
- Files:
-
- honeytrap/trunk/ChangeLog (modified) (1 diff)
- honeytrap/trunk/etc/honeytrap.conf.dist (modified) (8 diffs)
- honeytrap/trunk/src/honeytrap.h (modified) (2 diffs)
- honeytrap/trunk/src/readconf.c (modified) (6 diffs)
- honeytrap/trunk/src/sock.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
honeytrap/trunk/ChangeLog
r1633 r1677 1 1 Version 1.0.1 2 - 'bind_address' configuration option added for binding dynamic servers 3 to a specific IP address to make it possible to run several honeytrap 4 instances in parallel on a single machine 2 5 - Code cleanup: asprintf() 3 6 - Error handling for failed malloc()'s where it was missing honeytrap/trunk/etc/honeytrap.conf.dist
r1425 r1677 1 1 /* 2 * honeytrap 1.0 configuration file template -- please adjust2 * honeytrap 1.0.1 configuration file template -- please adjust 3 3 * (c) Tillmann Werner <tillmann.werner@gmx.de> 4 4 */ 5 5 6 / * log to this file */6 // log to this file 7 7 logfile = "/opt/honeytrap/honeytrap.log" 8 8 9 / * PID file */9 // store process ID in this file 10 10 pidfile = "/var/run/honeytrap.pid" 11 11 … … 14 14 response_dir = "/opt/honeytrap/etc/honeytrap/responses" 15 15 16 / * replace rfc1918 ip addresses with attacking ip address */16 // replace rfc1918 IP addresses with attacking IP address 17 17 replace_private_ips = "no" 18 18 19 /* default port mode -- valid values are "ignore", "normal" and "mirror"20 portconf_default = "normal"21 22 19 /* put network interface into promiscuous mode 23 * (only availabel when compiled with --with- pcap-mon) */20 * (only availabel when compiled with --with-stream-mon=pcap) */ 24 21 //promisc = "on" 25 22 … … 32 29 read_limit = "20971520" 33 30 34 / * include a file */31 // include a file 35 32 //include = "ports.conf" 36 33 … … 39 36 40 37 /* where to look for plugins 41 need to be set before loading plugins */38 needs to be set before loading plugins */ 42 39 plugin_dir = "/opt/honeytrap/etc/honeytrap/plugins" 43 40 44 41 45 / * include a plugin via plugin-[ModuleName] = "" */42 // include a plugin via plugin-[ModuleName] = "" 46 43 47 44 plugin-ftpDownload = "" … … 51 48 52 49 53 / * store attacks on disk */50 // store attacks on disk 54 51 plugin-SaveFile = { 55 52 attacks_dir = "/opt/honeytrap/attacks" … … 58 55 59 56 60 /* scan downloaded samples with ClamAV engine */ 57 // scan downloaded samples with ClamAV engine 58 /* 61 59 plugin-ClamAV = { 62 60 temp_dir = "/tmp" 63 61 clamdb_path = "/var/lib/clamav" 64 62 } 63 */ 65 64 66 65 67 /* calculate locality sensitive hashes */ 66 // calculate locality sensitive hashes 67 /* 68 68 plugin-SpamSum = { 69 69 md5sum_sigfile = "/opt/honeytrap/md5sum.sigs" 70 70 spamsum_sigfile = "/opt/honeytrap/spamsum.sigs" 71 71 } 72 */ 72 73 73 74 74 / * store attacks in PostgeSQL database */75 // store attacks in PostgeSQL database 75 76 /* 76 77 plugin-SavePostgres = { … … 84 85 85 86 86 / * invoke wget to download files via http */87 // invoke an external program (f.e. wget) to download files via http 87 88 /* 88 89 plugin-httpDownload = { … … 106 107 // explicit port configuration 107 108 portconf = { 108 / * ignore these ports */109 // ignore connection requests on these ports 109 110 ignore = { 110 111 protocol = "tcp" honeytrap/trunk/src/honeytrap.h
r1489 r1677 1 1 /* honeytrap.h 2 * Copyright (C) 2005-200 7Tillmann Werner <tillmann.werner@gmx.de>2 * Copyright (C) 2005-2008 Tillmann Werner <tillmann.werner@gmx.de> 3 3 * 4 4 * This file is free software; as a special exception the author gives … … 105 105 // global variables regarding configuration 106 106 107 char *pidfile_name; 108 char *logfile_name; 109 char *dev; 110 char *response_dir; 111 char *plugin_dir; 112 u_char daemonize; 113 u_char promisc_mode; 114 u_char replace_private_ips; 115 uid_t u_id; 116 gid_t g_id; 117 int32_t conn_timeout; 118 int32_t read_timeout; 119 int32_t m_read_timeout; 120 int32_t read_limit; 107 char *pidfile_name; 108 char *logfile_name; 109 char *dev; 110 char *response_dir; 111 char *plugin_dir; 112 u_char daemonize; 113 u_char promisc_mode; 114 u_char replace_private_ips; 115 uid_t u_id; 116 gid_t g_id; 117 int32_t conn_timeout; 118 int32_t read_timeout; 119 int32_t m_read_timeout; 120 int32_t read_limit; 121 struct in_addr bind_address; 121 122 122 123 /* explicit port configurations */ honeytrap/trunk/src/readconf.c
r1355 r1677 1 1 /* readconf.c 2 * Copyright (C) 2006-200 7Tillmann Werner <tillmann.werner@gmx.de>2 * Copyright (C) 2006-2008 Tillmann Werner <tillmann.werner@gmx.de> 3 3 * 4 4 * This file is free software; as a special exception the author gives … … 55 55 "plugin_dir", 56 56 "read_limit", 57 "bind_address", 57 58 "replace_private_ips", 58 59 #ifdef USE_PCAP_MON … … 138 139 config_tree = NULL; 139 140 141 bind_address.s_addr = INADDR_ANY; 142 140 143 /* build tree of allowed configuration keywords */ 141 144 for (i=0; i<sizeof(config_keywords)/sizeof(char *); i++) { … … 470 473 else if (OPT_IS("response_dir")) OPT_SET(" Loading default responses from %s.\n", response_dir) 471 474 else if (OPT_IS("plugin_dir")) OPT_SET(" Loading plugins from %s.\n", plugin_dir) 475 else if (OPT_IS("bind_address")) { 476 if (inet_aton(value, &bind_address) == 0) { 477 fprintf(stderr, " Error - Unable to convert IP address: %s.\n", strerror(errno)); 478 exit(EXIT_FAILURE); 479 } 480 DEBUG_FPRINTF(stdout, " Binding dynamic servers to %s.\n", inet_ntoa(bind_address)); 481 } 472 482 else if (OPT_IS("user")) { 473 483 if ((pwd_entry = getpwnam(value)) == NULL) { … … 478 488 u_id = pwd_entry->pw_uid; 479 489 user = value; 480 DEBUG_FPRINTF(stdout, " Setting user to %s \n", user);490 DEBUG_FPRINTF(stdout, " Setting user to %ss\n", user); 481 491 } else if (OPT_IS("group")) { 482 492 if ((grp_entry = getgrnam(value)) == NULL) { … … 487 497 g_id = grp_entry->gr_gid; 488 498 group = value; 489 DEBUG_FPRINTF(stdout, " Setting group to %s \n", group);499 DEBUG_FPRINTF(stdout, " Setting group to %s.\n", group); 490 500 } else if (OPT_IS("portconf")) { 491 501 if (process_conftree(node, node->first_leaf, process_confopt_portconf, NULL) == NULL) return(NULL); honeytrap/trunk/src/sock.c
r1600 r1677 1 1 /* sock.c 2 * Copyright (C) 2005-200 7Tillmann Werner <tillmann.werner@gmx.de>2 * Copyright (C) 2005-2008 Tillmann Werner <tillmann.werner@gmx.de> 3 3 * 4 4 * This file is free software; as a special exception the author gives … … 58 58 bzero((char *) server_addr, sizeof(struct sockaddr_in)); 59 59 server_addr->sin_family = AF_INET; 60 server_addr->sin_addr.s_addr = htonl(INADDR_ANY);60 server_addr->sin_addr.s_addr = bind_address.s_addr; 61 61 server_addr->sin_port = port; 62 62 if ((bind(fd, (struct sockaddr *) server_addr, sizeof(struct sockaddr_in))) != 0) {
