Docsity

Scripts to Destroy Files in Temp Directories on Windows and Linux - Prof. Lab, Lab Reports of Security Analysis

Toggle sidebar
bg1
Window
-Write scripts (as a kind of malware) to destroy everything in D:/temp directory on Windows
OS. (Batch script)
Code:
@echo off
if exist "D:\temp" echo (
"YES"
del D:\temp /Q
(for /d %%f in ("D:\temp\*") do rmdir /Q /S "%%f")
)else (echo "No"
mkdir "D:\temp"
)
Pause
Result:
Before not already run:
After program run
pf3
pf4
pf5

Partial preview of the text

Download Scripts to Destroy Files in Temp Directories on Windows and Linux - Prof. Lab and more Lab Reports Security Analysis in PDF only on Docsity!

 Window

  • Write scripts (as a kind of malware) to destroy everything in D:/temp directory on Windows OS. (Batch script) Code: @echo off if exist "D:\temp" echo ( "YES" del D:\temp /Q (for /d %%f in ("D:\temp*") do rmdir /Q /S "%%f") )else (echo "No" mkdir "D:\temp" ) Pause Result: Before not already run: After program run

These scripts will run for every 1 minute. Input Output

These scripts will run for every 1 minute. You must type : sudo vi /etc/crontab (to open file)

Output