Skip to content

Commit

Permalink
Fix list comprehensions
Browse files Browse the repository at this point in the history
  • Loading branch information
snovvcrash committed Aug 22, 2023
1 parent dd042a9 commit 44ea473
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</p>

<p align="center">
<a href="https://github.com/snovvcrash/DivideAndScan/blob/main/pyproject.toml#L3"><img src="https://img.shields.io/badge/version-1.0.2-success" alt="version" /></a>
<a href="https://github.com/snovvcrash/DivideAndScan/blob/main/pyproject.toml#L3"><img src="https://img.shields.io/badge/version-1.0.3-success" alt="version" /></a>
<a href="https://github.com/snovvcrash/DivideAndScan/search?l=python"><img src="https://img.shields.io/badge/python-3.9-blue?logo=python&logoColor=white" alt="python" /></a>
<a href="https://www.codacy.com/gh/snovvcrash/DivideAndScan/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=snovvcrash/DivideAndScan&amp;utm_campaign=Badge_Grade"><img src="https://app.codacy.com/project/badge/Grade/35f0bdfece9846d7aab3888b01642813" alt="codacy" /></a>
<a href="https://github.com/snovvcrash/DivideAndScan/actions/workflows/publish-to-pypi.yml"><img src="https://github.com/snovvcrash/DivideAndScan/actions/workflows/publish-to-pypi.yml/badge.svg" alt="pypi" /></a>
Expand Down
2 changes: 1 addition & 1 deletion das/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__author__ = '@snovvcrash'
__site__ = 'https://github.com/snovvcrash/DivideAndScan'
__version__ = '1.0.2'
__version__ = '1.0.3'

import time
import shlex
Expand Down
6 changes: 3 additions & 3 deletions das/scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ def __init__(self, db_path, hosts, ports, limit=None, raw_output=False):
P = (Path.home() / '.das' / f'nmap_{self.db_name}').glob('*.*')
hosts = [ip.stem for ip in P]
#result = self.db.search(~(self.Host.ip.one_of(hosts)))
result = [item[ip] for item in self.db.all() for ip in hosts if item[ip] not in hosts]
result = [item for item in self.db.all() if item['ip'] not in hosts]
else:
hosts = hosts.split(',')
hosts = [IPNetwork(h) for h in hosts]
hosts = [str(ip) for ip_obj in hosts for ip in ip_obj]
#result = self.db.search(self.Host.ip.one_of(hosts))
result = [item[ip] for item in self.db.all() for ip in hosts]
result = [item for item in self.db.all() if item['ip'] in hosts]

self.ip_ports_dict, self.ip_domains_dict = defaultdict(set), {}
for item in result:
Expand All @@ -80,7 +80,7 @@ def __init__(self, db_path, hosts, ports, limit=None, raw_output=False):
else:
ports = [int(p) for p in ports.split(',')]
#result = self.db.search(self.Host.port.one_of(ports))
result = [item[port] for item in self.db.all() for port in ports]
result = [item for item in self.db.all() if item['port'] in ports]

self.port_ip_dict = defaultdict(set)
for item in result:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "divideandscan"
version = "1.0.2"
version = "1.0.3"
description = "Divide full port scan results and use it for targeted Nmap runs"
authors = ["Sam Freeside <[email protected]>"]
license = "BSD-2-Clause"
Expand Down

0 comments on commit 44ea473

Please sign in to comment.