Log in

View Full Version : Looping Batch File that Leads to a Crash?


The Ninja
May 4th, 2011, 06:23 PM
If you created a batch file that when opened it opens itself it would keep opening itself. Further, if you created a batch file that opens itself 10 times in a matter of probably seconds it would lead to a crash, correct? Now a computer savvy person would simply right click and close all, but what if rather than the file opening itself it opened a second file that in turn opened the original file. Thus it would be nearly impossible to right click close. From here the computer savvy person would find where the file is and delete it, thus stopping the chain. But what if the file constantly changed between two locations it wouldn't stay there long enough to delete it. So from here the person would quickly create another batch file to delete the file as soon as it spawns. This is where I run out of ideas to keep the chain going. This is where my question comes in. Is it possible to make a batch file that functions inside the recycling bin so that it can then move itself out of the recycling bin? Is it possible for the other batch file to restore it? Even if I fix that problem though the person would probably just restart there computer. So is it possible to start a batch file on boot? After that though they would probably just restart in safe mode and run system restore and I don't know what to do from there.

anonymous53
May 4th, 2011, 06:36 PM
If you created a batch file that when opened it opens itself it would keep opening itself. Further, if you created a batch file that opens itself 10 times in a matter of probably seconds it would lead to a crash, correct? Now a computer savvy person would simply right click and close all, but what if rather than the file opening itself it opened a second file that in turn opened the original file. Thus it would be nearly impossible to right click close. From here the computer savvy person would find where the file is and delete it, thus stopping the chain. But what if the file constantly changed between two locations it wouldn't stay there long enough to delete it. So from here the person would quickly create another batch file to delete the file as soon as it spawns. This is where I run out of ideas to keep the chain going. This is where my question comes in. Is it possible to make a batch file that functions inside the recycling bin so that it can then move itself out of the recycling bin? Is it possible for the other batch file to restore it? Even if I fix that problem though the person would probably just restart there computer. So is it possible to start a batch file on boot? After that though they would probably just restart in safe mode and run system restore and I don't know what to do from there.


This seems like you're trying to be very malicious.
There are ways, but I will answer one of your questions. To place a file to boot from startup go through the registry
HKLM > Software> Microsoft >windows > run

TheMatrix
May 5th, 2011, 12:50 AM
if i may be so bold as to enquire:
what are you trying to do?

EDIT: Oooh.....a script!!

malicious.bat:

@ECHO OFF
copy malicious.bat malicious2.bat
start malicious2.bat

and
malicious2.bat:

@ECHO OFF
start malicious.bat
REM starts a vicious cycle


Oh, how fun!:evil2:

darkwoon
May 7th, 2011, 03:29 AM
If you created a batch file that when opened it opens itself it would keep opening itself. Further, if you created a batch file that opens itself 10 times in a matter of probably seconds it would lead to a crash, correct?
Probably not. It actually depends on the operating system. Most modern OS can properly handle issues like memory or stack exhaustion.

Now a computer savvy person would simply right click and close all, but what if rather than the file opening itself it opened a second file that in turn opened the original file. Thus it would be nearly impossible to right click close. From here the computer savvy person would find where the file is and delete it, thus stopping the chain. But what if the file constantly changed between two locations it wouldn't stay there long enough to delete it. So from here the person would quickly create another batch file to delete the file as soon as it spawns. This is where I run out of ideas to keep the chain going.
What malware usually do is to register themselves as a service/daemon, and spawn from there. They also include startup checks to restore the service if it was removed/disabled.

Is it possible to make a batch file that functions inside the recycling bin so that it can then move itself out of the recycling bin?
Yes, though that wouldn't be the strategy you'd want to follow.

Is it possible for the other batch file to restore it?
Yes, you can restore a file from the recycle bin programatically.

Even if I fix that problem though the person would probably just restart there computer. So is it possible to start a batch file on boot?
Yes, but that would be of limited effect - as you said yourself, the administrator would simply solve the issue in safe mode.

After that though they would probably just restart in safe mode and run system restore and I don't know what to do from there.
At this point, it would involve virally infecting programs not touched by system restore, and wait for the user to launch it.

Note that all those strategies are known for a very long time, and are nowadays mostly easily solvable. You'll need much more advanced techniques than this to successfully beat a decently skilled administrator.

TheMatrix
May 8th, 2011, 12:40 AM
^^^ couldn't have said it better myself