Skip to content

Commit

Permalink
print config v1 - rc1
Browse files Browse the repository at this point in the history
  • Loading branch information
oam7575 committed Nov 23, 2024
1 parent 5d1d76d commit b786e74
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/ssh_audit/ssh_audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ def process_commandline(out: OutputBuffer, args: List[str]) -> 'AuditConf': # p
parser.add_argument("--threads", action="store", dest="threads", metavar="N", type=int, default=32, help="number of threads to use when scanning multiple targets (-T/--targets) (default: %(default)s)")

# Print Suggested Configurations from : https://www.ssh-audit.com/hardening_guides.html
parser.add_argument("--print-config", action="append", metavar="OS Ver Client/Server", dest="print_configuration", type=str, default=None, help="print suggested server or client configurations. Configurations must be quote encapsulated. Usage Example : \"Ubuntu 2404 Server\"")
parser.add_argument("--print-config", nargs="?", action="append", metavar="OS Ver Client/Server", dest="print_configuration", type=str, default=None, help="print suggested server or client configurations. Configurations must be quote encapsulated. Usage Example : \"Ubuntu 2404 Server\"")

# The mandatory target option. Or rather, mandatory when -L, -T, --lookup or --print-config are not used.
parser.add_argument("host", nargs="?", action="store", type=str, default="", help="target hostname or IPv4/IPv6 address")
Expand All @@ -833,7 +833,13 @@ def process_commandline(out: OutputBuffer, args: List[str]) -> 'AuditConf': # p
argument = parser.parse_args(args=args)

if argument.print_configuration is not None:
print_conf = (getattr(argument, 'print_configuration'))[0].split(" ")
print_conf = (getattr(argument, 'print_configuration'))[0]
if print_conf is None:
print_conf = "OS Version Server"
print_conf = print_conf.split(" ")
else:
print_conf = (getattr(argument, 'print_configuration'))[0].split(" ")

os_type = print_conf[0]
os_ver = print_conf[1]
clientserver = print_conf[2]
Expand Down

0 comments on commit b786e74

Please sign in to comment.