Skip to content

Commit e3ce602

Browse files
committed
Small fixes
1 parent 3b19ac9 commit e3ce602

File tree

5 files changed

+25
-15
lines changed

5 files changed

+25
-15
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,4 +112,4 @@ pipenv run deltascan -a import -i raw_nmap_results.xml
112112
Run mkdocs server:
113113
```bash
114114
pipenv run mkdocs serve
115-
```
115+
```

deltascan/cli/cli_output.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,14 @@ def _display_scan_results(self):
9797
_counter = 1
9898
if self.suppress is True:
9999
_sup_table = Table(show_header=True)
100-
_sup_table.add_column("Index", style=colors["col_1"], no_wrap=True, width=10)
100+
_sup_table.add_column("Index", style=colors["col_1"], no_wrap=False, width=10)
101101
_sup_table.add_column("Uid", style=colors["col_2"], no_wrap=False)
102-
_sup_table.add_column("Given Host/Subnet", style=colors["col_3"], no_wrap=True)
102+
_sup_table.add_column("Given Host/Subnet", style=colors["col_3"], no_wrap=False)
103103
_sup_table.add_column("Scanned Host", style=colors["col_1"], no_wrap=False, width=20)
104-
_sup_table.add_column("Status", style=colors["col_3"], no_wrap=True)
104+
_sup_table.add_column("Status", style=colors["col_3"], no_wrap=False)
105105
_sup_table.add_column(
106106
"Profile", style=colors["col_4"], no_wrap=False, width=20)
107-
_sup_table.add_column("Date", style=colors["col_5"], no_wrap=True)
107+
_sup_table.add_column("Date", style=colors["col_5"], no_wrap=False)
108108
_sup_table.add_column("Args", style=colors["col_5"], no_wrap=False, width=30)
109109

110110
for scan in self.data:
@@ -125,11 +125,11 @@ def _display_scan_results(self):
125125
f"Scan uid: [/][rosy_brown]" \
126126
f"{scan['uuid']}[/]"
127127

128-
table.add_column("Port", style=colors["col_1"], no_wrap=True)
128+
table.add_column("Port", style=colors["col_1"], no_wrap=False)
129129
table.add_column(
130130
"Protocol",
131-
style=colors["col_2"], no_wrap=True)
132-
table.add_column("State", style=colors["col_3"], no_wrap=True)
131+
style=colors["col_2"], no_wrap=False)
132+
table.add_column("State", style=colors["col_3"], no_wrap=False)
133133
table.add_column("Service", style=colors["col_4"])
134134
table.add_column("Service Fingerprint", style=colors["col_5"])
135135
table.add_column("Service product", style=colors["col_6"])

deltascan/cli/cmd.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def __norm_value(v):
128128
elif conf_key == "tdate":
129129
self._app.tdate = __norm_value(conf_value)
130130
elif conf_key == "suppress":
131-
self._app.suppress = bool(__norm_value(conf_value))
131+
self._app.suppress = False if __norm_value(conf_value).lower() == "false" else True
132132
elif conf_key == "host":
133133
self._app.host = __norm_value(conf_value)
134134
elif conf_key == "profile":
@@ -310,9 +310,9 @@ def run():
310310
parser.add_argument(
311311
"-c", "--conf-file",
312312
help="path to configuration file", required=False)
313-
parser.add_argument(
314-
"-v", "--verbose", default=False, action='store_true',
315-
help="verbose output", required=False)
313+
# parser.add_argument(
314+
# "-v", "--verbose", default=False, action='store_true',
315+
# help="verbose output", required=False)
316316
parser.add_argument(
317317
"-s", "--suppress", default=False, action='store_true',
318318
help="suppress output", required=False)
@@ -373,7 +373,7 @@ def run():
373373
"action": clargs.action,
374374
"profile": clargs.profile,
375375
"conf_file": clargs.conf_file,
376-
"verbose": clargs.verbose,
376+
"verbose": None,
377377
"suppress": clargs.suppress,
378378
"n_scans": clargs.n_scans,
379379
"n_diffs": clargs.n_diffs,

deltascan/core/deltascan.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,16 @@ def _remove_finished_scan_from_list(self):
228228
del self._scans_to_wait[_n]
229229

230230
def _get_profile(self, _profile):
231+
"""
232+
Retrieves the profile and its arguments based on the given profile name.
233+
234+
Args:
235+
_profile (str): The name of the profile to retrieve.
236+
237+
Returns:
238+
tuple: A tuple containing the profile name and its arguments.
239+
If the profile is not found in the database or file, returns (None, None).
240+
"""
231241
try:
232242
profile = self.store.get_profile(_profile)
233243
profile_arguments = profile["arguments"]
@@ -321,7 +331,7 @@ def diffs(self, uuids=None):
321331
"""
322332
try:
323333
if datetime_validation(self._config.fdate) is False:
324-
if self._config.is_interactive is True:
334+
if self._config.is_interactive:
325335
print("Invalid date format. Using default date range.")
326336
else:
327337
raise DScanInputValidationException("Invalid date format")

deltascan/core/importer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def _import_xml(self):
9696
DScanImportDataError: If the XML data fails to parse.
9797
"""
9898
try:
99-
_r = self.load_results_from_file(self._full_name)
99+
_r = self.load_results_from_file()
100100
_parsed = Parser.extract_port_scan_dict_results(_r)
101101
_host = _r ._nmaprun["args"].split(" ")[-1]
102102

0 commit comments

Comments
 (0)