tellapplication"Photos" log"Start..." -- 创建一个新相册,如果相册已存在则使用现有相册 ifnot (exists album "iPhone 6S Screenshot") then make new album named "iPhone 6S Screenshot" endif set targetAlbum to album "iPhone 6S Screenshot" -- 定义目标分辨率 set targetWidth to750 set targetHeight to1334 -- 初始化图片列表 set imageList to {} -- 获取所有照片 set allPhotos toevery media item -- 循环检查每张照片的分辨率 repeatwith aPhoto in allPhotos if width of aPhoto is targetWidth and height of aPhoto is targetHeight then -- 打印照片的信息,例如文件名 log"Matching photo: " & filename of aPhoto & ", Date: " & dateof aPhoto -- 将符合分辨率的照片添加到列表 setendof imageList to aPhoto endif endrepeat -- 如果列表不为空,将照片添加到相册 if (countof imageList) > 0then -- 打印符合条件的照片数量 log"Number of matching photos: " & (countof imageList) add imageList to targetAlbum else log"No matching photos found." endif endtell
CVE-2023-21537 是一个 Windows 消息队列(MSMQ)驱动程序 mqac.sys 中的漏洞。该漏洞于 2023 年 1 月披露,并已被微软修复。漏洞并没有公开的 PoC 程序,漏洞发现者只通过文章 Racing bugs in Windows kernel 透露了部分信息。笔者在其基础上深入分析了相关代码,成功地复现了此漏洞。本文就是对漏洞研究的总结。
漏洞复现环境搭建
由于此漏洞已经在较新的系统中被修复,复现漏洞需要在旧版本的系统中进行。笔者在 Hyper-V 虚拟机中安装了 Windows 10 21H1 版本,内部版本号为 19043.928。此外,由于消息队列是 Windows 的可选功能,需要在控制面板中手动启用。方法是:打开控制面板,选择「程序」,点击「启用或关闭 Windows 功能」,并开启「Microsoft 消息队列(MSMQ)服务器」。如下图所示。
内网穿透是一种反向代理技术,允许你从任何位置访问一台处于复杂网络环境中的机器。它的应用场景有很多,例如,你在家中使用树莓派作为 Home Assistant 家庭中枢,但家庭网络的网关没有公网 IP,那么在离开家时就无法控制家中的智能设备。而在配置内网穿透后,就可以随时随地通过代理服务器的公网 IP 连接到树莓派,从而访问 Home Assistant 的服务。