-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9852fbb
commit dd042a9
Showing
9 changed files
with
83 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from das.parsers import IAddPortscanOutput | ||
|
||
|
||
class AddPortscanOutput(IAddPortscanOutput): | ||
"""Child class for processing generic scan output.""" | ||
|
||
def parse(self): | ||
""" | ||
Generic scan raw output parser. | ||
:return: a pair of values (portscan raw output filename, number of hosts added to DB) | ||
:rtype: tuple | ||
""" | ||
items, hosts = [], set() | ||
for line in self.portscan_raw: | ||
try: | ||
ip, port = line.split(':') | ||
except Exception: | ||
pass | ||
else: | ||
items.append({'ip': ip, 'port': int(port), 'domains': []}) | ||
hosts.add(ip) | ||
|
||
self.db.insert_multiple(items) | ||
|
||
return (self.portscan_out, len(hosts)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "divideandscan" | ||
version = "1.0.1" | ||
version = "1.0.2" | ||
description = "Divide full port scan results and use it for targeted Nmap runs" | ||
authors = ["Sam Freeside <[email protected]>"] | ||
license = "BSD-2-Clause" | ||
|