Exploit database

GH-b2682eea148b61d664fff913b24cc4d4

lw5959/xring-cve-2026-98260

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-98260

60 sources

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

Repository files22
lw5959/xring-cve-2026-98260Revision 8b404774be19

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

apk/app/java/o3/xring/cve98260/Io.java

Java · 3,498 bytes
package o3.xring.cve98260;

import android.os.ParcelFileDescriptor;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;

/** adb 流抽象:明文 socket 或 native TLS,二者对上层透明。 */
public interface Io {

    void write(byte[] b, int off, int len) throws IOException;

    void readFully(byte[] b, int off, int len) throws IOException;

    void close();

    /** 明文 TCP。 */
    final class SocketIo implements Io {
        private final Socket socket;
        private final InputStream in;
        private final OutputStream out;

        public SocketIo(Socket socket) throws IOException {
            this.socket = socket;
            this.in = socket.getInputStream();
            this.out = socket.getOutputStream();
        }

        @Override
        public void write(byte[] b, int off, int len) throws IOException {
            out.write(b, off, len);
            out.flush();
        }

        @Override
        public void readFully(byte[] b, int off, int len) throws IOException {
            int got = 0;
            while (got < len) {
                int r = in.read(b, off + got, len - got);
                if (r < 0) {
                    throw new IOException("EOF (读 " + got + "/" + len + ")");
                }
                got += r;
            }
        }

        @Override
        public void close() {
            try {
                socket.close();
            } catch (Throwable ignored) {
            }
        }
    }

    /** native TLS(fd 由 JNI 侧持有并读写)。 */
    final class TlsIo implements Io {
        private long handle;

        public TlsIo(long handle) {
            this.handle = handle;
        }

        @Override
        public synchronized void write(byte[] b, int off, int len) throws IOException {
            if (handle == 0) {
                throw new IOException("TLS 已关闭");
            }
            int sent = 0;
            while (sent < len) {
                int r = OcNative.tlsWrite(handle, b, off + sent, len - sent);
                if (r <= 0) {
                    throw new IOException("tlsWrite 失败 r=" + r);
                }
                sent += r;
            }
        }

        @Override
        public synchronized void readFully(byte[] b, int off, int len) throws IOException {
            if (handle == 0) {
                throw new IOException("TLS 已关闭");
            }
            int got = 0;
            while (got < len) {
                int r = OcNative.tlsRead(handle, b, off + got, len - got);
                if (r == -2) {
                    throw new IOException("tlsRead 超时");
                }
                if (r <= 0) {
                    throw new IOException("tlsRead 失败 r=" + r);
                }
                got += r;
            }
        }

        @Override
        public synchronized void close() {
            if (handle != 0) {
                long h = handle;
                handle = 0;                 // ★先置 0:其它线程再调用会抛"已关闭",不会踩已释放的 SSL
                OcNative.tlsClose(h);
            }
        }
    }

    /** 取 socket 的 fd(公开 API,不需要隐藏反射)。 */
    final class Fd {
        private Fd() {
        }

        public static int of(Socket s) {
            ParcelFileDescriptor pfd = ParcelFileDescriptor.fromSocket(s);
            return pfd.getFd();
        }
    }
}