diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2021-12-28 01:13:47 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2021-12-28 01:13:47 +0300 |
commit | 37ec4be9af18a2174161a809fdfcb113a2bcf780 (patch) | |
tree | 753c2177602091853e5a2ee370b0942f5b1a6dad /lib | |
parent | 91177bcf42f7a599e6f456b3ffdcbe8b8e0c6407 (diff) |
add 'ignore' to the config
Diffstat (limited to 'lib')
-rw-r--r-- | lib/worker.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/worker.py b/lib/worker.py index f8d6c55..8caf905 100644 --- a/lib/worker.py +++ b/lib/worker.py @@ -7,7 +7,7 @@ logger = logging.getLogger(__name__) class Worker(Thread): - def __init__(self, name, host, opened=None, concurrency=None, timeout=None): + def __init__(self, name, host, opened=None, ignore=None, concurrency=None, timeout=None): Thread.__init__(self) assert concurrency is not None @@ -16,6 +16,7 @@ class Worker(Thread): self.name = name self.concurrency = concurrency self.opened = opened + self.ignore = ignore scanner_kw = {} if timeout is not None: @@ -32,7 +33,7 @@ class Worker(Thread): return self.scanner.results def is_expected(self, port): - return (self.opened is not None) and (port in self.opened) + return ((self.opened is not None) and (port in self.opened)) or ((self.ignore is not None) and (port in self.ignore)) def get_host(self): return self.scanner.host |