From 805107852417a8d12b65909e3ffa43ed976a2752 Mon Sep 17 00:00:00 2001 From: Joe Testa Date: Thu, 16 Jul 2020 10:19:36 -0400 Subject: [PATCH] When a list of targets is provided (-T), skip empty lines. --- ssh-audit.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ssh-audit.py b/ssh-audit.py index 4f53542..b5c9349 100755 --- a/ssh-audit.py +++ b/ssh-audit.py @@ -573,8 +573,8 @@ class AuditConf: with open(aconf.target_file, 'r') as f: aconf.target_list = f.readlines() - # Strip out whitespace from each line in target file. - aconf.target_list = [target.strip() for target in aconf.target_list] + # Strip out whitespace from each line in target file, and skip empty lines. + aconf.target_list = [target.strip() for target in aconf.target_list if target not in ("", "\n")] # If a policy file was provided, validate it. if (aconf.policy_file is not None) and (aconf.make_policy is False):