Security Defense: Add a lock to cmd

Source: Internet
Author: User
Tags echo date echo message

Security Defense: Add a lock to cmd

First, create a new notepad, copy the following code, save it as cmd. bat, and save it in the root directory of drive D.

The Code is as follows:

@ Echo off

Title CMD---- dedicated to ノ

SETLOCAL

Set pwd = 0

Set times = 3

Echo red/Black Alliance

Echo ① too many threads have been written

Echo ║ ║

Echo ┃ ┃

Echo ║ ║

Echo ① too many threads have been written

Echo today is % date % current time % time :~ 0, 5%

Color 0a

Echo ####################################### ######################> d: hacker.txt

Echo operation: Activate password verification> d: hacker.txt

Echo status: Waiting for verification ...... > D: hacker.txt

Echo.> d: hacker.txt

Echo [enter your logon Password]

: Password

Set/p pwd = enter your password:

Set/A times = % times %-1

If % pwd %== 123 goto pass

Echo★Sorry, the password is incorrect.★Enter again! You still have % times % chances. Please cherish them!

Echo.

If % times % = 0 goto close

Echo status: password verification failed time entered by the user: % time %> d: hacker.txt

Goto password

: Close

Echo status: the user entered the password three times incorrectly★Program lock★Time: % time %> d: hacker.txt

Title

Echo --------------------------------------------------------------------------------

Echo★The program has been locked because you failed to verify the password three times. You can disable it.★

Echo --------------------------------------------------------------------------------

Echo [Messages]

: Message

Echo ________________________________________________________________________________

Set/p msg = enter a message:

Echo.> d: hacker.txt

Echo ####################################### ######################> d: hacker.txt

Echo date: % date % time: % time %> d: hacker.txt

Echo message:> d: hacker.txt

Echo % msg %> d: hacker.txt

Echo.> d: message.txt

Echo ...... OK ......

Echo★Your message has been recorded. Please close the window or continue leaving the message★

Echo operation: user message time: % time %> d: hacker.txt

Goto message

: Pass

Echo status:★The password is correct. welcome to use it! Time: % time %> d: hacker.txt

ENDLOCAL

Explanation:
If % pwd % = 123 goto pass here 123 is the default password, which can be modified by yourself.

Then copy cmd. bat to the WINDOWS directory.

Add registry information (double-click Import. reg, and the code is as follows)

Cancel registry information (double-click: cancel. reg)

Bytes ------------------------------------------------------------------------------------

Import Registry: (copy the following code to a text document and save it as: import. reg)

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINESOFTWAREMicrosoftCommand Processor]

"AutoRun" = "cmd. bat"

Cancel: (copy the following code to a text document and save it as: cancel. reg)

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINESOFTWAREMicrosoftCommand Processor]

"AutoRun" =-

Cmd color:

Background color: 0 = Black, 1 = blue, 2 = green, 3 = light green, 4 = red, 5 = purple, 6 = yellow, 7 = white, 8 = gray, 9 = light blue

Font color: A = light green, B = light green, C = light red, D = light purple, E = light yellow, F = light white

 

Related Article

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.