Environment
IP | HOSTNAME | NOTE |
|---|---|---|
N/A | Win10 | Test host |
Related Script
| Content | Download |
|---|---|
powershell script and bat script | Download |
Clearing Traces
-
During an intrusion, an attacker may create or drop malware on a computer. During one attack by the
aptgroupKimsukyagainst South Korea's defense industry, the group dropped abatscript in a temporary directory to make thesampleand thebatdelete themselves. -
This simulated attack left two files,
sample.exeanddel.bat. We use abatcommandto delete the remaining files.
del "E:\TempProjects\del_self\sample.exe"
del "E:\TempProjects\del_self\del.bat"
- The commands execute successfully and delete the sample.exe and del.bat files.

- The BAT script is as follows:
:del_start
rd /s /q "E:\TempProjects\del_self\sample.exe"
del "E:\TempProjects\del_self\sample.exe"
if exist "E:\TempProjects\del_self\sample.exe" goto del_start
del "E:\TempProjects\del_self\del.bat"
- The PowerShell script is as follows:
$bat_file_path = "E:\TempProjects\del_self\del.bat"
New-Item -Path "E:\TempProjects\del_self\" -Name "sample.txt"
Start-Process -FilePath $bat_file_path