From 04d5acc3aa2bc8d1c617377cbc8e70c0c56ea31c Mon Sep 17 00:00:00 2001 From: a6avind Date: Fri, 27 Mar 2020 12:31:29 +0530 Subject: [PATCH] Added a password prompt if no password is provided as an argument --- core/Args.py | 6 +++++- spraykatz.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core/Args.py b/core/Args.py index 19342c3..d99206d 100644 --- a/core/Args.py +++ b/core/Args.py @@ -8,6 +8,7 @@ from core.Colors import * from core.Logs import * from core.Utils import * +import getpass class SpraykatzParser(argparse.ArgumentParser): def error(self, message): @@ -18,6 +19,9 @@ def error(self, message): def parseArgs(parser): args = parser.parse_args() + if not args.password: + args.password=getpass.getpass(prompt='Password: ', stream=None) + if os.path.isfile(args.targets): args.targets = [line.rstrip('\n') for line in open(args.targets)] else: @@ -32,7 +36,7 @@ def menu(): parser = SpraykatzParser(prog="spraykatz.py", description="A tool to spray love around the world!", epilog="=> Do not use this on production environments!") mandatoryArgs = parser.add_argument_group('Mandatory Arguments') mandatoryArgs.add_argument("-u", "--username", help="User to spray with. He must have admin rights on targeted systems in order to gain remote code execution.", required=True) - mandatoryArgs.add_argument("-p", "--password", help="User's password or NTLM hash in the LM:NT format.", required=True) + mandatoryArgs.add_argument("-p", "--password", help="User's password or NTLM hash in the LM:NT format.") mandatoryArgs.add_argument("-t", "--targets", help="IP addresses and/or IP address ranges. You can submit them via a file of targets (one target per line), or inline (separated by commas).", required=True) optionalArgs = parser.add_argument_group('Optional Arguments') diff --git a/spraykatz.py b/spraykatz.py index d3bf57b..56dc3ca 100755 --- a/spraykatz.py +++ b/spraykatz.py @@ -27,8 +27,8 @@ def printBanner(): if __name__ == '__main__': - printBanner() args = parseArgs(menu()) + printBanner() initSpraykatz() # Fire!