Malicious Code in cmd

Source: Internet
Author: User

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...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.