commit e0862b8e26496f24e1a219b946c0bc27ec89068b Author: Konstantin Ryabitsev icon@mricon.com Date: Wed May 19 17:19:54 2004 +0000
Removing trojan-list handling routines, as it's a dumb feature.
modules/packets_mod.py | 24 +----------------------- 1 files changed, 1 insertions(+), 23 deletions(-) --- diff --git a/modules/packets_mod.py b/modules/packets_mod.py index cdc6590..b63115e 100644 --- a/modules/packets_mod.py +++ b/modules/packets_mod.py @@ -68,19 +68,13 @@ class packets_mod(InternalModule): self.ipchains_re = rc('\slog:\s\S+\s(\S*).*\sPROTO=(\d+)\s(\S*):\d*\s\S*:(\d+)') self.ipfilter_re = rc('ipmon[\d+]:.*\s(\S+),\d+\s->\s\S+,(\d+)\sPR\s(\S+)') self.etc_services_re = rc('^(\S*)\s+(\S*)') - self.trojan_list_re = rc('^(\S*)\s+(.*)') self.etc_protocols_re = rc('^(\S*)\s+(\S*)')
- svcdict = self._parse_etc_services() + self.svcdict = self._parse_etc_services()
- trojans = opts.get('trojan_list', '') self.systems_collapse = int(opts.get('systems_collapse', '10')) self.ports_collapse = int(opts.get('ports_collapse', '10'))
- self.trojan_warning_wrap = '<font color="red">%s</font>' - if trojans: svcdict = self._parse_trojan_list(trojans, svcdict) - self.svcdict = svcdict - self.protodict = self._parse_etc_protocols()
self.collapsed_ports_rep = '<font color="red">[%d ports]</font>' @@ -124,22 +118,6 @@ class packets_mod(InternalModule): svcdict[pproto] = service return svcdict
- def _parse_trojan_list(self, fileloc, svcdict): - try: fh = open(fileloc, 'r') - except: - self.logger.put(0, 'Could not open %s for reading!' % fileloc) - return svcdict - while 1: - line = fh.readline() - if not line: break - if (self.comment_line_re.search(line) - or self.empty_line_re.search(line)): continue - try: pproto, trojan = self.trojan_list_re.search(line).groups() - except: continue - if pproto not in svcdict: - svcdict[pproto] = self.trojan_warning_wrap % trojan - return svcdict - ## # Line-matching routines #