Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is %0|%0 and how does it work?

If you run a .bat or .cmd file with %0|%0 inside, your computer starts to use a lot of memory and after several minutes, is restarted. Why does this code block your Windows? And what does this code programmatically do? Could it be considered a "bug"?

like image 675
Doon Avatar asked Nov 18 '12 00:11

Doon


People also ask

What does & };: do on your system?

The :(){ :|:& };: is nothing but a bash function. This function get executed recursively. It is often used by sysadmin to test user process limitations on server. Linux process limits can be configured via /etc/security/limits.

Does fork bomb work on Windows?

All Unix, Linux, or Unix-like operating systems are potentially vulnerable to a fork bomb attack, including Ubuntu, Debian, Red Hat, or AIX. Windows operating systems are not vulnerable to a traditional fork bomb attack, as they are unable to fork other processes.


1 Answers

This is the Windows version of a fork bomb.

%0 is the name of the currently executing batch file. A batch file that contains just this line:

%0|%0 

Is going to recursively execute itself forever, quickly creating many processes and slowing the system down.

This is not a bug in windows, it is just a very stupid thing to do in a batch file.

like image 169
Jonathon Reinhart Avatar answered Sep 21 '22 16:09

Jonathon Reinhart