Skip to content

Commit

Permalink
aix2john.py: use positional argument for input file + cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
exploide committed Jan 6, 2025
1 parent 561858f commit e52e7c9
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions run/aix2john.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@


import argparse
import binascii
import sys
import re

Expand Down Expand Up @@ -62,26 +61,17 @@ def process_file(filename, is_standard):

if __name__ == "__main__":

if len(sys.argv) < 2:
sys.stderr.write("Usage: %s [-s] -f <AIX passwd file (/etc/security/passwd)>\n" % sys.argv[0])
sys.exit(1)

parser = argparse.ArgumentParser()
parser.add_argument('-s', action="store_true",
default=False,
dest="is_standard",
help='Use this option if "lpa_options = std_hash=true" is activated'
)
)

parser.add_argument('-f', dest="filename",
default=False,
help='Specify the AIX shadow file filename to read (usually /etc/security/passwd)'
)
parser.add_argument("filename",
help='The AIX shadow file to read (usually /etc/security/passwd)'
)

args = parser.parse_args()

if args.filename:
process_file(args.filename, args.is_standard)
else:
print("Please specify a filename (-f)")
sys.exit(1)
process_file(args.filename, args.is_standard)

0 comments on commit e52e7c9

Please sign in to comment.