实时响应命令示例

适用于:

希望体验 Defender for Endpoint? 注册免费试用版

了解实时响应中使用的常见命令,并查看有关如何使用这些命令的示例。

根据你拥有的角色,可以运行基本或高级实时响应命令。 有关基本命令和高级命令的详细信息,请参阅 使用实时响应调查设备上的实体

analyze

# Analyze the file malware.txt
analyze file c:\Users\user\Desktop\malware.txt
# Analyze the process by PID
analyze process 1234

connections

# List active connections in json format using parameter name
connections -output json
# List active connections in json format without parameter name
connections json

dir

# List files and sub-folders in the current folder (by default it will show relative paths [-relative_path])
dir
# List files and sub-folders in the current folder, with their full path
dir -full_path
# List files and sub-folders in a specific folder
dir C:\Users\user\Desktop\
# List files and subfolders in the current folder in json format
dir -output json

fileinfo

# Display information about a file
fileinfo C:\Windows\notepad.exe

findfile

# Find file by name
findfile test.txt

getfile

# Download a file from a machine
getfile c:\Users\user\Desktop\work.txt
# Download a file from a machine, automatically run prerequisite commands
getfile c:\Users\user\Desktop\work.txt -auto

注意

无法使用此命令从实时响应中下载以下文件类型:

PowerShell支持这些文件类型。

如果在实时响应中使用此命令时遇到问题,请使用 PowerShell 作为替代方法。

library

# List files in the library
library
# Delete a file from the library
library delete script.ps1

processes

# Show all processes
processes
# Get process by pid
processes 123
# Get process by pid with argument name
processes -pid 123
# Get process by name
processes -name notepad.exe

putfile

# Upload file from library
putfile get-process-by-name.ps1
# Upload file from library, overwrite file if it exists
putfile get-process-by-name.ps1 -overwrite
# Upload file from library, keep it on the machine after a restart
putfile get-process-by-name.ps1 -keep

registry

# Show information about the values in a registry key
registry HKEY_CURRENT_USER\Console
# Show information about a specific registry value (the double backslash \\ indicates a registry value versus key)
registry HKEY_CURRENT_USER\Console\\ScreenBufferSize

remediate

# Remediate file in specific path
remediate file c:\Users\user\Desktop\malware.exe
# Remediate process with specific PID
remediate process 7960
# See list of all remediated entities
remediate list

run

# Run PowerShell script from the library without arguments
run script.ps1
# Run PowerShell script from the library with arguments
run get-process-by-name.ps1 -parameters "-processName Registry"

注意

对于长时间运行的命令(如“run”或“getfile”),可能需要在命令末尾使用“&”符号在后台执行该操作。 使用“fg”基本命令后,这样就可以继续调查计算机并返回到后台 命令

将参数传递给实时响应脚本时,请勿包含以下禁止字符:“;”、“&”、“|”、“!”“$”。

scheduledtask

# Get all scheduled tasks
scheduledtasks
# Get specific scheduled task by location and name
scheduledtasks Microsoft\Windows\Subscription\LicenseAcquisition
# Get specific scheduled task by location and name with spacing
scheduledtasks "Microsoft\Configuration Manager\Configuration Manager Health Evaluation"

undo

# Restore remediated registry
undo registry HKEY_CURRENT_USER\Console\ScreenBufferSize
# Restore remediated scheduledtask
undo scheduledtask Microsoft\Windows\Subscription\LicenseAcquisition
# Restore remediated file
undo file c:\Users\user\Desktop\malware.exe

提示

想要了解更多信息? Engage技术社区中的 Microsoft 安全社区:Microsoft Defender for Endpoint技术社区