def check(self):
try:
tn = telnetlib.Telnet(self.target, self.telnet_port, timeout=10)
tn.expect(["Login: ", "login: "], 5)
tn.write(self.username + "\r\n")
tn.expect(["Password: ", "password"], 5)
tn.write(self.password + "\r\n")
tn.write("\r\n")
(i, obj, res) = tn.expect(["Incorrect", "incorrect"], 5)
tn.close()
if i != -1:
return False # target is not vulnerable
else:
if any(map(lambda x: x in res, ["#", "$", ">"])):
return True # target is vulnerable
except Exception:
return False # target is not vulnerable
return False # target is not vulnerable
评论列表
文章目录