更新完善功能
This commit is contained in:
1 parent
4e6d6e5307
commit
e08a87a4c2
8 files changed
+330
-95
No files matched your search
+25
-13
@@ -1,12 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* func/ip.php —— IP 地址处理
|
||||
* 提取输入文本中的全部 IPv4,按 /24 段聚合输出纯文本结果:
|
||||
* IP段 发现数量(段内去重IP数) IP段性质
|
||||
* 1.2.3.0/24 8 公网
|
||||
* 1.2.3.4
|
||||
* 提取输入文本 / 上传文本文件中的全部 IPv4,按 /24 段聚合输出纯文本结果:
|
||||
* IP段 发现数量(段内去重IP数) IP段性质 出现次数
|
||||
* 1.2.3.0/24 8 公网 56
|
||||
* 1.2.3.4 出现次数
|
||||
*
|
||||
* 出现次数:具体 IP 为其在原文中的出现总次数;段行出现次数为段内全部 IP 次数之和。
|
||||
* 段默认按出现次数从高到低排列,命中「重点匹配 IP」的段优先置顶。
|
||||
* 段性质区分:内网(含保留)/ CDN / 公网;IPv6 暂不参与。
|
||||
* 支持上传常见文本格式文件(txt / json / log / md / csv / conf / ini)自动载入,
|
||||
* 支持将结果导出为 UTF-8 TXT 文件。
|
||||
*/
|
||||
$P = '../';
|
||||
require_once dirname(__DIR__) . '/includes/layout.php';
|
||||
@@ -19,13 +23,18 @@ func_bar('IP 地址处理');
|
||||
<div class="wrap page-body">
|
||||
<div class="panel-card">
|
||||
<h2>使用说明</h2>
|
||||
<p class="tip">粘贴任意日志 / 文本,系统提取其中全部 <strong>IPv4</strong>(IPv6 暂不参与),
|
||||
按 <strong>/24 段</strong>聚合为文本结果:每段一行 <code>IP段 / 发现数量 / IP段性质</code>,
|
||||
其中「发现数量」为该段内<strong>去重后的 IP 个数</strong>;段行下方缩进列出该段具体 IP,段与段之间空一行分隔。
|
||||
段性质按 <strong>内网(含保留)/ CDN / 公网</strong> 区分。
|
||||
若在下方「重点匹配 IP」中填写了需要关注的 IP,命中其所在的 /24 段会<strong>优先置顶</strong>,并在预览结果中用<strong>红色</strong>标出该 IP(复制得到的纯文本不含颜色)。</p>
|
||||
<label class="fl" for="ipInput">待分析文本</label>
|
||||
<p class="tip">粘贴任意日志 / 文本,或直接<b>上传文本文件</b>(txt / json / log / md / csv / conf / ini,≤ 20MB),
|
||||
系统提取其中全部 <strong>IPv4</strong>(IPv6 暂不参与),按 <strong>/24 段</strong>聚合:
|
||||
每段一行 <code>IP段 / 发现数量 / IP段性质 / 出现次数</code>——发现数量为该段内<strong>去重后的 IP 个数</strong>,
|
||||
出现次数为该段内全部 IP 在原文中的<strong>出现总次数</strong>;段行下方依次列出该段具体 IP,并标注<b>每个 IP 的出现次数</b>:<code>具体IP / 出现次数</code>,段与段之间空一行分隔。
|
||||
各 /24 段默认按<b>出现次数从高到低排列</b>;段性质按 <strong>内网(含保留)/ CDN / 公网</strong> 区分。
|
||||
若填写「重点匹配 IP」,命中其所在的 /24 段会<strong>优先置顶</strong>,并在预览结果中用<strong>红色</strong>标出该 IP;结果可一键复制或导出为 txt(纯文本不含颜色)。</p>
|
||||
<label class="fl" for="ipInput">待分析文本(可直接粘贴,也可在上方上传文件载入)</label>
|
||||
<textarea id="ipInput" rows="12" placeholder="粘贴防火墙 / nginx / 安全设备日志等包含 IP 的内容…"></textarea>
|
||||
<div class="field-row" style="margin-top:8px;align-items:center;flex-wrap:wrap">
|
||||
<input type="file" id="ipFile" accept=".txt,.json,.log,.md,.csv,.conf,.ini" style="flex:1 1 280px;min-width:220px">
|
||||
<span class="tip" style="align-self:center">选择 txt / json / log 等文本文件,读取后自动填入并分析</span>
|
||||
</div>
|
||||
<label class="fl" for="ipFocus" style="margin-top:12px">重点匹配 IP(可选,多个用空格 / 逗号 / 换行分隔)</label>
|
||||
<input type="text" id="ipFocus" placeholder="如 8.8.8.8 104.16.1.18;命中该 IP 的 /24 段将优先置顶展示,并将对应 IP 标红">
|
||||
<div class="field-row" style="margin-top:10px">
|
||||
@@ -38,13 +47,16 @@ func_bar('IP 地址处理');
|
||||
|
||||
<div id="ipResult" hidden>
|
||||
<div class="panel-card">
|
||||
<div class="field-row" style="align-items:center;justify-content:space-between">
|
||||
<div class="field-row" style="align-items:center;justify-content:space-between;flex-wrap:wrap">
|
||||
<h2 style="margin:0">识别结果</h2>
|
||||
<button type="button" class="btn btn-sm" id="ipCopy">复制结果</button>
|
||||
<span class="ops" style="display:flex;gap:8px">
|
||||
<button type="button" class="btn btn-sm" id="ipExport">⬇ 导出 TXT</button>
|
||||
<button type="button" class="btn btn-sm" id="ipCopy">复制结果</button>
|
||||
</span>
|
||||
</div>
|
||||
<div id="ipPreview" class="ip-pre"></div>
|
||||
<p class="tip" id="ipStat" style="margin:8px 0"></p>
|
||||
<p class="tip">复制结果为纯文本(不含红色标记);含重点 IP 的段已优先置顶展示。若 /24 段内混有不同性质,按数量多者标注“xx为主(混合)”。</p>
|
||||
<p class="tip">段行为 <code>IP段 / 发现数量 / 性质 / 出现次数</code>(出现次数为段内全部 IP 原文出现次数之和);具体 IP 行为 <code>IP / 出现次数</code>。段按出现次数降序排列,含重点 IP 的段置顶;复制或导出的纯文本不含颜色。若 /24 段内混有不同性质,按数量多者标注“xx为主(混合)”。</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user