Recently, inspired by Stephen JY, I started to study CMD and Windows powershell. Suddenly I found it very easy to write a cmd malicious script... If this script is called a. cmd
1 StartA.CMD
2 StartA.CMD
That's all. This process will automatically replicate, expand, and run in Geometric Order... Of course, it is better to add resource-consuming commands.
To test the destructive power of this script on your machine, you must add some restrictions... Or, how to controlCodeIt is more important than writing Destructive code, just as nuclear power plants are more meaningful to human development than nuclear bombs. To achieve this, you can:
1 @ Set / A num = % 1 + 1
2 @ If / I % num % Leq 5 Start A . CMD % Num %
3 @ If / I % num % Leq 5 Start A . CMD % Num %
4 @ Ping WWW . Baidu . Com
5 @ Exit
In this way, when a. CMD runs for the first time, it will call itself twice and take 2 as the parameter. In the future, when a. CMD is called, the parameter is added with 1 and a new process is created with this parameter. When the parameter reaches a given value of N (5 in this example), it will automatically end. In this way, the number of CMD processes running at the same time can be controlled within (2 ^ n-1.
What is the effect of malicious code with Ping load? When N is set to 6, we can see that such code mainly loads the CPU heavily by frequent new processes, but it does not affect the network, disk, and memory.
The figure above is obtained through the reliability and performance monitor, which can also be used as a way to evaluate the Code's destructive power. Facilitate future debugging.
During the experiment, I had no idea how to ping the Baidu...
It's nice to have cnblogs support for code coloring... even batchfile and powershell...