Skip to content

Instantly share code, notes, and snippets.

@Cewlt
Created April 3, 2015 10:25
Show Gist options
  • Save Cewlt/42a7a719fe8d2894b925 to your computer and use it in GitHub Desktop.
Save Cewlt/42a7a719fe8d2894b925 to your computer and use it in GitHub Desktop.
check the possible combinations of passwords
import itertools
import paramiko
def main():
regex = raw_input("Please enter what combination of characters to use: \nexample: abcdefghijklmnopqrstuvwxyz123 \n ")
length = raw_input("Okay now enter the length to check for: \n example: abcdefghijklmnopqrstuvwxyz with a length of 4 has 358,800 possible combinations \n so you would type '4' in this case \n")
go(str(regex), int(length))
def go(regex, length):
am = 0
res = itertools.permutations(regex,length)
for i in res:
print ''.join(i)
am+=1
print "amount: " + str(am)
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment