Skip to content

Commit 52e61fe

Browse files
committed
Merge branch 'R3dy-getpass'
Adding getpass library for passwords
2 parents 20f4acc + 262006e commit 52e61fe

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

credcrack.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
# Version: 1.0
2626
# Date: 2015-08-09
2727

28-
import subprocess, os, argparse, time, datetime, socket, base64, threading, Queue, hashlib, binascii, signal, sys
28+
import subprocess, os, argparse, time, datetime, socket, base64, threading, Queue, hashlib, binascii, signal, sys, getpass
2929
from shlex import split
3030
from shutil import rmtree, copy
3131

@@ -322,18 +322,18 @@ def clean_up(flag, stime):
322322

323323
def main():
324324

325-
example = "Examples: \n\n./credcrack.py -d acme -u bob -p Password123 -f hosts --es\n./credcrack.py -d acme -u bob -p Password123 -f hosts -l 192.168.1.102 -t 20"
325+
example = "Examples: \n\n./credcrack.py -d acme -u bob -f hosts -es\n./credcrack.py -d acme -u bob -f hosts -l 192.168.1.102 -t 20"
326326
parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter, description="CredCrack - A stealthy credential harvester by Jonathan Broche (@g0jhonny)", epilog=example)
327327
required = parser.add_argument_group("Required")
328328
required.add_argument('-d', '--domain', required=True, help='Domain or Workstation')
329329
required.add_argument('-u', '--user', required=True, help='Domain username')
330-
required.add_argument('-p', '--passwd', required=True, help='Domain user password')
331330
parser.add_argument('-f', '--file', help='File containing IPs to harvest creds from. One IP per line.')
332331
parser.add_argument('-r', '--rhost', help='Remote host IP to harvest creds from.')
333332
parser.add_argument('-es', '--enumshares', help='Examine share access on the remote IP(s)', action='store_true')
334333
parser.add_argument('-l', '--lhost', help='Local host IP to launch scans from.')
335334
parser.add_argument('-t', '--threads', help='Number of threads (default: 10)', default=10, type=int)
336335
args = parser.parse_args()
336+
args.passwd = getpass.getpass()
337337

338338
print "\n " + "-" * 69 + "\n " + colors.white + " CredCrack v1.0 by Jonathan Broche (@g0jhonny)\n " + colors.normal + "-" * 69 + "\n "
339339

@@ -342,6 +342,10 @@ def main():
342342
q = Queue.Queue(maxsize=0)
343343

344344
try:
345+
if not args.passwd:
346+
print "{}[!]{} Please provide a password\n".format(colors.red, colors.normal)
347+
return
348+
345349
if args.enumshares:
346350
if args.rhost:
347351
if validate(args.rhost):
@@ -408,4 +412,4 @@ def main():
408412
clean_up(False, stime)
409413

410414
if __name__ == '__main__':
411-
main()
415+
main()

0 commit comments

Comments
 (0)