I have an assigment, where i have two files namely, "user.txt", "pwd.txt" now I want to basically iterate over each value of these files, i.e "John" with all values in "pwd.txt", and then another value from "user.txt" with all values of "pwd.txt".
Here I want to implement threading.
here is my code,
import threading
f1 = open("user.txt", "r")
f2 = open("pwd.txt", "r")
threads = []
def brute():
for letter in f1.readlines():
print "[+]First Value: {}".format(letter)
for second_letter in f2.readlines():
print "[+]Second Value: {}".format(second_letter)
threads.append(threading.Thread(target=runner, args=(letter,second_letter,)))
for thread in threads:
thread.start()
for thread in threads:
thread.join()
def runner(word1,word2):
print("[+]I am just a worker class: {0}:{1}".format(word1,word2))
output is coming as
[+]First Value: john
[+]Second Value: test1234
[+]Second Value: socool!
[+]Second Value: abcde1234
[+]Second Value: password1
[+]Second Value: Passw0rd
[+]Second Value: adminRocks
[+]First Value: dean
[+]First Value: harry
[+]First Value: sam
[+]First Value: joseph
[+]First Value: rick
[+]I am just a worker class: john:test1234
[+]I am just a worker class: john:socool!
[+]I am just a worker class: john:abcde1234
[+]I am just a worker class: john:password1
[+]I am just a worker class: john:Passw0rd
[+]I am just a worker class: john:adminRocks
[Finished in 0.3s]
I am not sure how to print all the user values here with all the passwords in the password file. Any help much appreciated.