快速下载:
wget https://raw.githubusercontent.com/mzet-/linux-exploit-suggester/master/linux-exploit-suggester.sh -O les.sh
关于 LES 用法和内部工作原理的详细信息:
https://blog.z-labs.eu/2019/05/10/les-paper.html
LES 的附加资源:
https://github.com/mzet-/les-res
| 名称 | CVE | 是否在 LES 中 | 验证环境 | 参考 |
|---|---|---|---|---|
| CopyFail | CVE-2026-31431 | 尚未 | - | https://copy.fail/ |
| DirtyFrag | CVE-2026-43284 | 尚未 | - | https://www.openwall.com/lists/oss-security/2026/05/07/8 |
| DirtyAH6 | 尚未 | - | https://heyitsas.im/posts/lpe-quartet/ | |
| PPPoEject | 尚未 | - | https://heyitsas.im/posts/lpe-quartet/ | |
| TUNderflow | 尚未 | - | https://heyitsas.im/posts/lpe-quartet/ | |
| DiagSpill | 尚未 | - | https://heyitsas.im/posts/lpe-quartet/ | |
| OVSwrap | 尚未 | - | https://heyitsas.im/posts/ovswrap/ | |
| CIFSwith | 尚未 | - | https://heyitsas.im/posts/cifswitch/ | |
| RefluXFS | 尚未 | - | URL | |
| vsockpwn | CVE-2025-21756 | 尚未 | - | https://hoefler.dev/articles/vsock.html |
| CrackArmor | 多个 | 尚未 | - | URL |
| needrestart | 多个 | 尚未 | - | https://www.qualys.com/2024/11/19/needrestart/needrestart.txt |
| StackRot | CVE-2023-3269 | 尚未 | - | https://www.openwall.com/lists/oss-security/2023/07/28/1 |
LES 工具旨在协助检测给定 Linux 内核/基于 Linux 的机器上的安全缺陷。它提供以下功能:
该工具评估(使用在此处详细讨论的启发式方法)给定 Linux 系统对公开已知的 Linux 权限提升漏洞的暴露情况。工具输出示例:
$ ./linux-exploit-suggester.sh
...
[+] [CVE-2017-16995] eBPF_verifier
Details: https://ricklarabee.blogspot.com/2018/07/ebpf-and-analysis-of-get-rekt-linux.html
Exposure: highly probable
Tags: debian=9.0{kernel:4.9.0-3-amd64},fedora=25|26|27,[ ubuntu=14.04 ]{kernel:4.4.0-89-generic},ubuntu=(16.04|17.04){kernel:4.(8|10).0-(19|28|45)-generic}
Download URL: https://www.exploit-db.com/download/45010
Comments: CONFIG_BPF_SYSCALL needs to be set && kernel.unprivileged_bpf_disabled != 1
[+] [CVE-2017-1000112] NETIF_F_UFO
Details: http://www.openwall.com/lists/oss-security/2017/08/13/1
Exposure: probable
Tags: [ ubuntu=14.04{kernel:4.4.0-*} ],ubuntu=16.04{kernel:4.8.0-*}
Download URL: https://raw.githubusercontent.com/xairy/kernel-exploits/master/CVE-2017-1000112/poc.c
ext-url: https://raw.githubusercontent.com/bcoles/kernel-exploits/cve-2017-1000112/CVE-2017-1000112/poc.c
Comments: CAP_NET_ADMIN cap or CONFIG_USER_NS=y needed. SMEP/KASLR bypass included. Modified version at 'ext-url' adds support for additional distros/kernels
[+] [CVE-2016-8655] chocobo_root
Details: http://www.openwall.com/lists/oss-security/2016/12/06/1
Exposure: probable
Tags: [ ubuntu=(14.04|16.04){kernel:4.4.0-(21|22|24|28|31|34|36|38|42|43|45|47|51)-generic} ]
Download URL: https://www.exploit-db.com/download/40871
Comments: CAP_NET_RAW capability is needed OR CONFIG_USER_NS=y needs to be enabled
...
对于每个漏洞利用,都会计算暴露程度。可能出现以下“暴露程度”状态:
高度可能 - 评估的内核很可能受到影响,并且 PoC 漏洞利用很有可能无需任何重大修改即可直接生效。
可能 - 漏洞利用有可能生效,但很可能需要对 PoC 漏洞利用进行定制以适配你的目标。
可能性较低 - 需要额外的手动分析来验证内核是否受到影响。
不太可能 - 内核受到影响的可能性极低(该漏洞利用不会显示在工具输出中)
LES 可以检查你的 Linux 内核提供的绝大多数安全设置。它不仅验证内核编译时配置(CONFIGs),还验证运行时设置(sysctl),从而更全面地呈现运行中内核的安全态势。此功能旨在作为 Tobias Klein 的 checksec.sh 工具中 --kernel 开关的现代延续。工具输出示例:
$ ./linux-exploit-suggester.sh --checksec
Mainline kernel protection mechanisms:
[ Disabled ] GCC stack protector support (CONFIG_HAVE_STACKPROTECTOR)
https://github.com/mzet-/les-res/blob/master/features/stackprotector-regular.md
[ Disabled ] GCC stack protector STRONG support (CONFIG_STACKPROTECTOR_STRONG)
https://github.com/mzet-/les-res/blob/master/features/stackprotector-strong.md
[ Enabled ] Low address space to protect from user allocation (CONFIG_DEFAULT_MMAP_MIN_ADDR)
https://github.com/mzet-/les-res/blob/master/features/mmap_min_addr.md
[ Disabled ] Restrict unprivileged access to kernel syslog (CONFIG_SECURITY_DMESG_RESTRICT)
https://github.com/mzet-/les-res/blob/master/features/dmesg_restrict.md
[ Enabled ] Randomize the address of the kernel image (KASLR) (CONFIG_RANDOMIZE_BASE)
https://github.com/mzet-/les-res/blob/master/features/kaslr.md
[ Disabled ] Hardened user copy support (CONFIG_HARDENED_USERCOPY)
https://github.com/mzet-/les-res/blob/master/features/hardened_usercopy.md
...
评估 Linux 主机对公开已知漏洞的暴露情况:
$ ./linux-exploit-suggester.sh
显示 Linux 主机上安全功能的状态:
$ ./linux-exploit-suggester.sh --checksec
根据提供的 'uname' 字符串(即 uname -a 命令的输出),评估 Linux 内核针对公开已知漏洞的暴露情况:
$ ./linux-exploit-suggester.sh --uname <uname-string>
更多用法示例,请参见此处。
你现在应该已经了解 LES 是什么以及它能为你做什么。接下来看看你能为 LES 做些什么:
Tags 的形式记录你的发现,例如标签:ubuntu=12.04{kernel:3.(2|5).0-(23|29)-generic},其含义为:经确认,被标记的漏洞利用可在 Ubuntu 12.04 上配合以下内核正确运行:3.2.0-23-generic、3.2.0-29-generic、3.5.0-23-generic 和 3.5.0-29-generic;。添加此标签后,当在 Ubuntu 12.04 上配合所列内核版本之一运行时,LES 将自动高亮并提升该漏洞利用的动态 Rank。这将在渗透测试期间帮助你(以及其他人)快速识别存在严重漏洞的 Linux 机器。ext-url 条目添加到 LES,并修改 Tags 以反映新添加的目标。请参阅这篇文章,了解将特定 PoC 漏洞利用适配到不同内核版本的绝佳示例。FEATURES 数组(如果尚未添加),并在以下地址发布你的分析:https://github.com/mzet-/les-res/blob/master/features/<feature-name>.md。bcoles 对 LES 做出了卓越且频繁的贡献。