亚洲视频二区_亚洲欧洲日本天天堂在线观看_日韩一区二区在线观看_中文字幕不卡一区

公告:魔扣目錄網(wǎng)為廣大站長(zhǎng)提供免費(fèi)收錄網(wǎng)站服務(wù),提交前請(qǐng)做好本站友鏈:【 網(wǎng)站目錄:http://www.430618.com 】, 免友鏈快審服務(wù)(50元/站),

點(diǎn)擊這里在線咨詢(xún)客服
新站提交
  • 網(wǎng)站:51998
  • 待審:31
  • 小程序:12
  • 文章:1030137
  • 會(huì)員:747

簡(jiǎn)介

redis是一種key-value鍵值對(duì)的非關(guān)系型數(shù)據(jù)庫(kù),默認(rèn)運(yùn)行在6379端口

它啟動(dòng)時(shí)不會(huì)像Apache一樣,以一種www-data低權(quán)限身份運(yùn)行。而是以運(yùn)行者的身份,例如用root權(quán)限直接運(yùn)行redis時(shí),redis的權(quán)限就是root權(quán)限

其次它的默認(rèn)配置是無(wú)需密碼的,也就造成了默認(rèn)的未授權(quán)訪問(wèn)

redis還支持本地存儲(chǔ),也就導(dǎo)致了任意文件寫(xiě)入。從而可以寫(xiě)入私鑰,利用私鑰直接ssh登錄服務(wù)器。

漏洞環(huán)境搭建

攻擊機(jī)

操作系統(tǒng):ubuntu 16.04

ip :192.168.85.128

安裝redis

靶機(jī)

操作系統(tǒng): centos 6.5

ip :192.168.85.132

下載編譯redis

修改下配置文件,不然默認(rèn)雖然是無(wú)密碼,但是會(huì)有protected模式,導(dǎo)致無(wú)法從外部主機(jī)連接

bind 127.0.0.1前面加上#號(hào) protected-mode設(shè)為no

啟動(dòng)redis

寫(xiě)入ssh-keygen公鑰

現(xiàn)在下先在本地生成一對(duì)密鑰

這樣就可以在~/.ssh目錄下生成一對(duì)id_rsa、id_rsa.pub

大佬黑客手把手滲透數(shù)據(jù)庫(kù),帶小白進(jìn)入黑客圏

 

然后連接靶機(jī)redis

這樣,我們就把公鑰寫(xiě)入對(duì)方的服務(wù)器了,直接用生成的私鑰連接即可

大佬黑客手把手滲透數(shù)據(jù)庫(kù),帶小白進(jìn)入黑客圏

 

假如報(bào)了如下錯(cuò)誤

運(yùn)行下如下兩句即可

利用計(jì)劃任務(wù)反彈shell

先開(kāi)一個(gè)終端監(jiān)聽(tīng)本地的23333端口

利用之前類(lèi)似的文件寫(xiě)入,寫(xiě)入定時(shí)命令

需要等待一會(huì),一般一分鐘之內(nèi)吧,nc就能收到反彈回來(lái)的shell了

大佬黑客手把手滲透數(shù)據(jù)庫(kù),帶小白進(jìn)入黑客圏

 

寫(xiě)入webshell

當(dāng)redis權(quán)限較低,上面兩種方法都行不通的時(shí)候,可以嘗試往web服務(wù)中寫(xiě)入一句話,獲取webshell

這樣,就能在根目錄下生成shell.php。訪問(wèn)一下

結(jié)合SSRF

之前能看到,默認(rèn)情況下雖然是沒(méi)有密碼,但是會(huì)開(kāi)啟protected保護(hù)模式

在這情況下,我們嘗試連接一下對(duì)方redis

kingkk@ubuntu:~/test/redis$ redis-cli -h 192.168.85.132192.168.85.132:6379> infoDENIED Redis is running in protected mode because protected mode is enabled, no bind address was specified, no authentication password is requested to clients. In this mode connections are only accepted from the loopback interface. If you want to connect from external computers to Redis you may adopt one of the following solutions: 1) Just disable protected mode sending the command 'CONFIG SET protected-mode no' from the loopback interface by connecting to Redis from the same host the server is running, however MAKE SURE Redis is not publicly accessible from internet if you do so. Use CONFIG REWRITE to make this change permanent. 2) Alternatively you can just disable the protected mode by editing the Redis configuration file, and setting the protected mode option to 'no', and then restarting the server. 3) If you started the server manually just for testing, restart it with the '--protected-mode no' option. 4) Setup a bind address or an authentication password. NOTE: You only need to do one of the above things in order for the server to start accepting connections from the outside.

可以看到保護(hù)模式拒絕了redis的遠(yuǎn)程連接,所以經(jīng)常redis都是配合著ssrf這個(gè)可以偽造身份的攻擊方式一起進(jìn)行攻擊

分享到:
標(biāo)簽:滲透 數(shù)據(jù)庫(kù)
用戶無(wú)頭像

網(wǎng)友整理

注冊(cè)時(shí)間:

網(wǎng)站:5 個(gè)   小程序:0 個(gè)  文章:12 篇

  • 51998

    網(wǎng)站

  • 12

    小程序

  • 1030137

    文章

  • 747

    會(huì)員

趕快注冊(cè)賬號(hào),推廣您的網(wǎng)站吧!
最新入駐小程序

數(shù)獨(dú)大挑戰(zhàn)2018-06-03

數(shù)獨(dú)一種數(shù)學(xué)游戲,玩家需要根據(jù)9

答題星2018-06-03

您可以通過(guò)答題星輕松地創(chuàng)建試卷

全階人生考試2018-06-03

各種考試題,題庫(kù),初中,高中,大學(xué)四六

運(yùn)動(dòng)步數(shù)有氧達(dá)人2018-06-03

記錄運(yùn)動(dòng)步數(shù),積累氧氣值。還可偷

每日養(yǎng)生app2018-06-03

每日養(yǎng)生,天天健康

體育訓(xùn)練成績(jī)?cè)u(píng)定2018-06-03

通用課目體育訓(xùn)練成績(jī)?cè)u(píng)定