Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a password prompt if no password is provided as an argument #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion core/Args.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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:
Expand All @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion spraykatz.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ def printBanner():


if __name__ == '__main__':
printBanner()
args = parseArgs(menu())
printBanner()
initSpraykatz()

# Fire!
Expand Down