批处理自动找木马文件路径

背景:如果主机不多,应急有通报的木马病毒样本可能存在的路径,一个个翻就太累。

直接整成一个文档,如果存在那个可以着重主机了。当然木马查杀记录也不能忘记看下。

  1. 双击打开 cmd.bat

  2. 输入list.bat

  3. 文件存在输出路径到ok.txt

list.txt 放入可能木马的路径如:

bash 复制代码
C:\Microsoft\iXXX3XXX.dat
C:\Microsoft\XXXXX.xml
C:\Microsoft\xxxxxxxx.exe
C:\ProgramData\dhgb1wY\edge.jpg
C:\ProgramData\dhgb1wY\edge.xml
C:\ProgramData\dhgb1wY\hcdLZxu0.dat
C:\ProgramData\dhgb1wY\hcdLZxu0.exe
C:\ProgramData\Microsoft\iXXX3XXX.exe
C:\ProgramData\Microsoft\Program
C:\ProgramData\Microsoft\Program\xxxxxx.jpg
C:\ProgramData\Microsoft\XXXXX.xml
C:\ProgramData\Microsoft\xxxxxxxx.dat
C:\ProgramData\xxx.rar
C:\ProgramData\xxxx\xxx.exe
C:\ProgramData\xxxx\xxx.rar
C:\Users\Administrator\AppData\Local\Microsoft\Windows\INetCache\IE\5L4CE25C
C:\Users\Administrator\AppData\Local\Microsoft\Windows\INetCache\IE\5L4CE25C\3[1]
C:\Users\Administrator\AppData\Local\Microsoft\Windows\INetCache\IE\HMJ5SQMT
C:\Users\Administrator\AppData\Local\Microsoft\Windows\INetCache\IE\HMJ5SQMT\2[1]
C:\Users\Administrator\AppData\Local\Microsoft\Windows\INetCache\IE\HSG8MQ3I\4[1]
C:\Users\Administrator\AppData\Local\Microsoft\Windows\INetCache\IE\OKVYXXBW
C:\Users\Administrator\AppData\Local\Microsoft\Windows\INetCache\IE\OKVYXXBW\1[1]
C:\Users\Administrator\AppData\Local\Temp\_ir_tu2_temp_0\_TUProjDT.dat
C:\Users\Administrator\AppData\Local\Temp\_ir_tu2_temp_0\IRIMG1.JPG
C:\Users\Administrator\AppData\Local\Temp\_ir_tu2_temp_0\IRIMG2.JPG
C:\Users\Administrator\AppData\Local\Temp\_ir_tu2_temp_0\IRIMG3.JPG
C:\Users\Administrator\AppData\Local\Temp\Xshell 6 Update Log.txt
C:\xx.exe
c:\xxxx.ini

list.bat

bash 复制代码
@echo off  
setlocal enabledelayedexpansion  
  
REM 定义输入和输出文件  
set "inputFile=list.txt"  
set "outputFile=ok.txt"  
  
REM 检查输入文件是否存在  
if not exist "%inputFile%" (  
    echo 输入文件 %inputFile% 不存在。  
    exit /b 1  
)  
  
REM 如果输出文件存在,则先删除它  
if exist "%outputFile%" del "%outputFile%"  
  
REM 逐行读取输入文件,检查文件是否存在,并将存在的文件路径输出到输出文件  
for /f "delims=" %%a in (%inputFile%) do (  
    if exist "%%a" (  
        echo %%a>> "%outputFile%"  
    )  
)  
  
echo  %outputFile%
endlocal
相关推荐
柒@宝儿姐32 分钟前
若依 B 端从浏览器访问升级为 Windows 安装包交付流程
前端·javascript·vue.js·windows
肖恭伟40 分钟前
MinerU 新手完整配置教程:Windows 下将 PDF 转为带图片的 Markdown
windows·pdf
PieroPc21 小时前
Windows 驱动备份与恢复工具 CMD .bat
windows
波罗丁牌21 小时前
逆变与协变详解
windows·microsoft
映翰通朱工1 天前
Windows 上位机 + EC3320:USB 转 CAN 通信实测(从接线到 SSH 收包)
windows·stm32·ssh
我是Superman丶1 天前
【2026亲测】Wireshark安装教程 Windows系统|下载安装、Npcap配置及首次抓包
windows·测试工具·wireshark
贾天佑忆月 迷失的昵1 天前
Direct3D Draw函数 异步调用原理解析
服务器·windows·性能优化
sg_knight1 天前
Codex CLI 安装全攻略:macOS / Linux / Windows(WSL2)三端实战
linux·windows·macos·openai·ai编程·coding·codex
趣味科技2 天前
记录修复EAGET忆捷移动硬盘损坏
windows·数据分析·硬件工程
我命由我123452 天前
Java 开发 - List subList 方法
java·windows·操作系统·list·intellij-idea·idea·intellij idea