当前位置: 首页 > news >正文

ip去重小脚本


奇安信威胁情报中心

长亭漏洞情报库 | 长亭百川云

ip去重脚本.bat

@echo off
set fileA=banned.txt
set fileB=check.txt
set fileC=white_list.txt:: 检查文件是否存在
if not exist "%fileA%" (echo file %fileA% not existspauseexit /b
)if not exist "%fileB%" (echo file %fileB% not existspauseexit /b
)if not exist "%fileC%" (echo file %fileC% not existspauseexit /b
)::会改变行顺序,/y强制覆盖,/f强制删除,/q静默模式不提示确认,2>&1隐藏所有输出
sort %fileA% /unique > tmp.txt
move /y tmp.txt %fileA%
del /f /q "tmp.txt" >nul 2>&1sort %fileB% /unique > tmp.txt
move /y tmp.txt %fileB%
del /f /q "tmp.txt" >nul 2>&1sort %fileC% /unique > tmp.txt
move /y tmp.txt %fileC%
del /f /q "tmp.txt" >nul 2>&1

ip检查脚本.bat

检查check.txt的每一行是否出现在封禁名单或者白名单里

@echo off
setlocal enabledelayedexpansion:: 设置文件路径
set fileA=check.txt
set fileB=white_list.txt
set fileC=banned.txt:: 检查文件是否存在
if not exist "%fileA%" (echo file %fileA% not existspauseexit /b
)
if not exist "%fileB%" (echo file %fileB% not existspauseexit /b
)if not exist "%fileC%" (echo file %fileC% not existspauseexit /b
):: 打开文件(可选)
start /min "" notepad.exe "%fileA%"
start /min "" notepad.exe "%fileB%"
start /min "" notepad.exe "%fileC%":: 比较文件内容
set found=0
for /f "tokens=*" %%a in (%fileA%) do (findstr /x /c:"%%a" "%fileB%" >nul && (set found=1goto :result)findstr /x /c:"%%a" "%fileC%" >nul && (set found=1goto :result)
):result
if !found! equ 1 (echo intersect
) else (echo not intersect
)::关闭记事本
taskkill /f  /im notepad.exe
pause

white_list.txt

223.5.5.5
223.6.6.6
8.8.8.8
114.114.114.114

check.txt

8.8.8.8
114.114.114.114

banned.txt

a-gwas-01.slyip.net
a.gwas.perl.sh
a1.6cs6.club
aaa.28lcp7.dnslog.cn
ahmediye.net
althawry.org
apple-pie.in
arthur.niria.biz
cb1.bwig05.ceye.io
coco.miniast.com
fbi.bot.nu
hot.tenchier.com
iron.tenchier.com
orzdwjtvmein.in
qwe.nnnafewujsey.bond
qwe14.qpon
rim.miniast.com
rx.thegov.win
sq.szmr.org
t.zz3r0.com
unable.download
v.beahh.com
www.iuqerfsodp9ifjaposdfjhgosurijfaewrwergwea.com
z.totonm.com
qq.leehei.xyz
45.230.66.123
106.8.138.19

http://www.dtcms.com/a/309944.html

相关文章:

  • uniapp基础 (一)
  • git pull和git fetch的区别
  • Python爬虫实战:研究OpenCV技术构建图像数据处理系统
  • (转)mybatis和hibernate的 缓存区别?
  • (一)React +Ts(vite创建项目)
  • Flask 路由系统:URL 到 Python 函数的映射
  • 嵌入式学习笔记-MCU阶段-DAY10ESP8266模块
  • 第11届蓝桥杯Python青少组中/高级组选拔赛(STEMA)2020年5月30日真题
  • 嵌入式软件 (SW) 设计文件
  • W3D引擎游戏开发----从入门到精通【10】
  • 永洪科技华西地区客户交流活动成功举办!以AI之力锚定增长确定性
  • 视频生成中如何选择GPU或NPU?
  • UE5多人MOBA+GAS 番外篇:同时造成多种类型伤害,以各种属性值的百分比来应用伤害(版本二)
  • 如何理解推理模型
  • 学习:入门uniapp Vue3组合式API版本(17)
  • 2025网络安全指南
  • PyTorch基础——张量计算
  • 考取锅炉司炉工证需要学习哪些专业知识?
  • Altium Designer 22使用笔记(3)---原理图设计
  • Google play上架/更新频繁被拒是什么原因?
  • RabbitMQ 延时队列插件安装与使用详解(基于 Delayed Message Plugin)
  • C++ sort比较规则需要满足严格弱序
  • Coze Studio概览(五)--工作流管理
  • 人员定位卡人脸智能充电发卡机
  • Spring Boot + MongoDB:从零开始手动配置 MongoConfig 实战
  • 拉横幅识别误检率↓82%:陌讯多模态特征融合算法实战解析
  • Typecho博客数据迁移全指南:从数据库导出到XML导入的完整方案
  • 【04】海康相机C#开发——VS 在编译时,提示“Files的值“+乱码情况解决办法’ ,C#项目打开编译时报错:Files 的值“IGEF‘,
  • Docker状况监控
  • 智能平台的感知进化:AI × 视频通感在群体终端协同中的应用探索