Jun 18, 2016 09:15 AM
(This post was last modified: Jun 18, 2016 09:17 AM by l3k0w.)
I tried using crunch and hydra for generating passwords and brute-forcing. But hydra's limit is 50,000,000 lines per file and my file was exceeding that limit. So I thought it will be a good idea if I try and create program that splits the file into separate files.
So I came up with this. I know it's not something complicated, but maybe it can help someone 🙂
Q: What are you guys using for splitting a file/generating passwords? Does crunch has a command for splitting?
So I came up with this. I know it's not something complicated, but maybe it can help someone 🙂
Code
def main():
fr_name = input("Enter the name of the file to read from: ")
num_passwords = int(input("Enter the number of passwords per file: "))
n = 0
k = 1
fw = open("1.lst", "w")
with open(fr_name) as fr:
for line in fr:
if(n == num_passwords):
n = 0
k = k + 1
if(not fw.closed):
fw.close()
fw = open(str(k) + ".lst", "w")
#end
fw.write(line)
n = n + 1
#end
#end
fw.close()
print("The passwords were split into " + str(k) + " separate files.")
#end
if __name__ == "__main__":
main()Q: What are you guys using for splitting a file/generating passwords? Does crunch has a command for splitting?


