|
杨上当
初级用户
 
积分 186
发帖 17
注册 2003-4-12
状态 离线
|
『楼 主』:
我知道怎样给批处理文件的运行设置密码了![分享]
使用 LLM 解释/回答一下
在批处理文件中加上:
@echo off
choice /c:(密码)/n
即可!比如你写上"choice /c:a/n",那么,你在运行该批处理文件时就会被要求输入密码,你输入a就能让它继续运行下去,否则你就等着吧!
要注意,此处的密码位数只能是一位,如果你把1234作为密码,那么只要任意输入1或2或3或4都算作是正确密码。如何提高密码的保密性呢?你可以使用ASCII码,方法是在按住ALT键时再按小键盘上的的数字键,如”空格“就是在按住ALT键时再按255产生的。
想想看,这么简单的方法就能为批处理文件的运行设置密码,何乐而不为?!
Add in the batch file:
@echo off
choice /c:(password)/n
That's it! For example, if you write "choice /c:a/n", then when you run this batch file, you will be asked for the password. If you enter a, it will continue to run, otherwise you'll just wait!
Note that the password here can only be one digit. If you set 1234 as the password, then entering any of 1, 2, 3, or 4 is considered a correct password. How to improve the confidentiality of the password? You can use ASCII codes. For example, "space" is generated by pressing the number key 255 on the numeric keypad while holding down the ALT key.
Think about it, such a simple method can set a password for the operation of the batch file. Why not do it?!
|

偶是新手,恳请各路大侠多多指正! |
|
2003-4-16 00:00 |
|
|
Wengier
系统支持
             “新DOS时代”站长
积分 27736
发帖 10521
注册 2002-10-9
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
这样设密码的话自然可以被轻易破解,只需按Ctrl+Break键就行了.要真正设密码的话,还是用一些批处理增强工具吧.
In this way to set the password can be easily cracked, just press the Ctrl+Break key. If you really want to set a password, still use some batch processing enhancement tools.
|

Wengier - 新DOS时代
欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/
E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)
 |
|
2003-4-16 00:00 |
|
|
杨上当
初级用户
 
积分 186
发帖 17
注册 2003-4-12
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
这回我可不赞同版主的说法了!
用choice /c:(密码)/n的语法设置密码,目的就是为了阻止他人运行该批处理文件,而版主您说只要按Ctrl+Break键即可轻易破解,试问:难道您按了之后可以继续运行该批处理文件吗?非也!按Ctrl+Break键和按Ctrl+C键的作用一样,是中止运行,而不是跳过密码这一关去继续运行!这就是说,版主您的方法并没有破解我在批处理文件中所设置的密码,你在不输入正确密码的情况下是无法运行我的批处理文件的!
哈哈!看来第一回合我赢定啦!
This time I don't agree with the moderator's statement!
The syntax of using choice /c: (password)/n is set to prevent others from running this batch file. But you, moderator, said that pressing Ctrl+Break key can easily crack it. Let's ask: Can you continue to run this batch file after pressing it? No! Pressing Ctrl+Break key has the same function as pressing Ctrl+C key, which is to stop the operation, not to skip the password and continue running! This means that your method didn't crack the password I set in the batch file, and you can't run my batch file without entering the correct password!
Haha! It seems I won the first round!
|

偶是新手,恳请各路大侠多多指正! |
|
2003-4-16 00:00 |
|
|
Wengier
系统支持
             “新DOS时代”站长
积分 27736
发帖 10521
注册 2002-10-9
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
哦,是说继续运行吗,那也很简单.运行到CHOICE命令后发现有密码时,先用Ctrl+C中止批处理文件,再用MORE或TYPE命令查看批处理文件中的那条CHOICE命令即可,因为密码是公开的(只看一眼就知道了,因为没有加密),所以轻易就知道密码了;或者干脆打开批处理文件进行编辑,将CHOICE命令那几行删除即可.
批处理设密码主要是开机时设(尤其是在AUTOEXEC.BAT中),这样可以防止用户非法使用电脑,而不能被用户中断以返回DOS进行各种操作,这样似乎就失去了加密的意义.
Oh, you mean to continue running? That's also very simple. When running to the CHOICE command and finding a password, first use Ctrl+C to stop the batch file, then use the MORE or TYPE command to view that CHOICE command in the batch file. Because the password is public (you can know it at a glance because there's no encryption), so you can easily know the password; or simply open the batch file for editing and delete those lines of the CHOICE command.
The password set in the batch file is mainly set at startup (especially in AUTOEXEC.BAT), so as to prevent users from using the computer illegally, but if it can be interrupted by users to return to DOS for various operations, then it seems to lose the meaning of encryption.
|

Wengier - 新DOS时代
欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/
E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)
 |
|
2003-4-16 00:00 |
|
|
杨上当
初级用户
 
积分 186
发帖 17
注册 2003-4-12
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
也许是我没有把我的实际目的表述清楚吧。
我的本意是在用我自编的批处理文件锁定了计算机后(通过修改注册表禁止所有程序的运行,当然也可以不禁止某些指定的程序。详见我前几天的帖子《利用批处理文件一键锁定计算机》),有什么办法能对解锁用的批处理文件加密。我个人认为我的目的已经达到了,就是在解锁文件中加入choice语句,因为在我锁定计算机后是不能运行文字处理软件的。
如果你说到DOS下去对该BAT文件进行编辑修改,那么我把它放到很深的中文目录下,就是你们这些DOS高手恐怕也一时难以下手吧?
其实,谁都明白,电脑不可能绝对的安全。而且如果锁定得越严密,解锁时就越不方便,我只是想在“锁定的严密“与”解锁的方便“之间求得一个平衡。现在,通过各位高手的指教我的目的已基本达到了,我单位就没有任何一个电脑高手能给我的电脑解锁,而我却能在一秒钟内上锁和解锁(稍微夸张了几秒钟,呵呵……),所以这个问题就先放一放,等我有其他心得或问题的时候再讨论吧!
谢谢各位!
Maybe I didn't make my actual purpose clear enough.
My original intention was that after locking the computer with my self-written batch file (by modifying the registry to prohibit the operation of all programs, of course, some specified programs can also not be prohibited. For details, see my previous post "One-click Lock Computer Using Batch File"), is there any way to encrypt the batch file for unlocking. I personally think my purpose has been achieved, that is, adding a choice statement in the unlocking file, because after I lock the computer, I can't run word processing software.
If you talk about going to DOS to edit and modify this BAT file, then I put it in a very deep Chinese directory, even for you DOS experts, it may be difficult to start for a while?
In fact, everyone understands that the computer can't be absolutely safe. And if the lock is more strict, it will be more inconvenient to unlock. I just want to find a balance between "strict lock" and "convenient unlock". Now, through the guidance of all the experts, my purpose has been basically achieved. There is no computer expert in my unit who can unlock my computer, but I can lock and unlock it in one second (a little exaggerated for a few seconds, hehe...), so this problem will be put aside first. I will discuss it when I have other insights or problems!
Thank you all!
|

偶是新手,恳请各路大侠多多指正! |
|
2003-4-17 00:00 |
|
|
Silence
初级用户
 
积分 151
发帖 15
注册 2003-4-16
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
以下是引用杨上当在2003-4-17 20:52:58的发言:
如果你说到DOS下去对该BAT文件进行编辑修改,那么我把它放到很深的中文目录下,就是你们这些DOS高手恐怕也一时难以下手吧?
呵呵,放到再深的中文目录中也好办,用bat加密实在是没有什么安全性。
Below is the quote from Yang Shangdang on 2003-4-17 20:52:58:
If you say to go down to DOS to edit and modify this BAT file, then I put it in a very deep Chinese directory, even for you DOS experts, it may be difficult to start for a while, right?
Hehe, no matter how deep it is placed in a Chinese directory, it's easy to handle. The security of bat encryption is really not high.
|
|
2003-4-18 00:00 |
|
|
nre
银牌会员
     nre
积分 1210
发帖 361
注册 2002-12-28
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
以下是引用杨上当在2003-4-17 20:52:58的发言:
也许是我没有把我的实际目的表述清楚吧。
我的本意是在用我自编的批处理文件锁定了计算机后(通过修改注册表禁止所有程序的运行,当然也可以不禁止某些指定的程序。详见我前几天的帖子《利用批处理文件一键锁定计算机》),有什么办法能对解锁用的批处理文件加密。我个人认为我的目的已经达到了,就是在解锁文件中加入choice语句,因为在我锁定计算机后是不能运行文字处理软件的。
如果你说到DOS下去对该BAT文件进行编辑修改,那么我把它放到很深的中文目录下,就是你们这些DOS高手恐怕也一时难以下手吧?
其实,谁都明白,电脑不可能绝对的安全。而且如果锁定得越严密,解锁时就越不方便,我只是想在“锁定的严密“与”解锁的方便“之间求得一个平衡。现在,通过各位高手的指教我的目的已基本达到了,我单位就没有任何一个电脑高手能给我的电脑解锁,而我却能在一秒钟内上锁和解锁(稍微夸张了几秒钟,呵呵……),所以这个问题就先放一放,等我有其他心得或问题的时候再讨论吧!
谢谢各位!
问题不是出在是否禁止了某些指定的程序,而是用户是可以随便通过Ctrl+C中断批处理的。人家中断了你的AUTOEXEC。BAT也就完全破坏了你的加解秘机制。也就没什么后话了
The following is a quote from Yang Shangdang on 2003-4-17 20:52:58:
Maybe I didn't express my actual purpose clearly enough.
My original intention was that after using the batch file I wrote to lock the computer (by modifying the registry to prohibit the operation of all programs, of course, some specified programs can also not be prohibited. Please refer to my previous post a few days ago "Using Batch Files to One-click Lock the Computer"), is there any way to encrypt the batch file used for unlocking. I personally think my purpose has been achieved, that is, adding a choice statement in the unlocking file, because after I lock the computer, I can't run the word processing software.
If you say to go to DOS to edit and modify this BAT file, then I put it in a very deep Chinese directory, even you DOS experts may not be able to start working for a while?
In fact, everyone understands that the computer can't be absolutely safe. And if the lock is tighter, it will be more inconvenient to unlock. I just want to find a balance between "tight lock" and "convenient unlock". Now, through the guidance of all the experts, my purpose has basically been achieved. No one in my unit can unlock my computer, but I can lock and unlock it in one second (a little exaggerated for a few seconds, hehe...), so this problem will be put aside first. I will discuss it when I have other experiences or problems!
Thank you everyone!
The problem is not whether some specified programs are prohibited, but that the user can arbitrarily interrupt the batch process through Ctrl+C. If someone interrupts your AUTOEXEC.BAT, it will completely destroy your encryption and decryption mechanism, and there will be no more talk about it
|

Teamwork ! |
|
2003-4-19 00:00 |
|
|
杨上当
初级用户
 
积分 186
发帖 17
注册 2003-4-12
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
以下是引用nre在2003-4-19 0:11:16的发言:
问题不是出在是否禁止了某些指定的程序,而是用户是可以随便通过Ctrl+C中断批处理的。人家中断了你的AUTOEXEC。BAT也就完全破坏了你的加解秘机制。也就没什么后话了
这位仁兄可能还没看过我的拙作《利用批处理文件一键锁定计算机》:http://www2.zzu.edu.cn/ie/newdos/dispbbs.asp?boardID=12&ID=1814
我不是通过修改Autoexec.bat来锁计算机的丫。
The following is the speech of nre on 2003-4-19 0:11:16:
The problem is not whether certain specified programs are prohibited, but that users can arbitrarily interrupt the batch processing through Ctrl+C. Once people interrupt your AUTOEXEC.BAT, your encryption and decryption mechanism is completely destroyed, and there is nothing to talk about later
This gentleman may not have read my humble work "Using Batch Files to One-click Lock the Computer": http://www2.zzu.edu.cn/ie/newdos/dispbbs.asp?boardID=12&ID=1814
I don't lock the computer by modifying Autoexec.bat.
|

偶是新手,恳请各路大侠多多指正! |
|
2003-4-19 00:00 |
|
|
WUYAN520
初级用户
 
积分 28
发帖 15
注册 2010-6-24
状态 离线
|
|
2010-7-8 21:10 |
|
|
fxdf
新手上路

积分 12
发帖 6
注册 2010-7-1
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
学习了,不知道将bat转成exe文件,密码功能是否好使
Learned, I don't know if the password function works when converting a bat to an exe file
|
|
2010-7-8 22:12 |
|
|
HkPs
新手上路

积分 2
发帖 1
注册 2010-7-12
状态 离线
|
|
2010-7-14 16:02 |
|
|
a7147125
新手上路

积分 19
发帖 10
注册 2009-7-7
状态 离线
|
|
2010-7-19 23:05 |
|
|
panyanyany
初级用户
 
积分 22
发帖 12
注册 2010-7-24
状态 离线
|
|
2010-7-26 14:14 |
|
|
vergr
新手上路

积分 3
发帖 2
注册 2010-7-7
状态 离线
|
『第 14 楼』:
使用 LLM 解释/回答一下
此处的密码位数只能是一位
那理论上不是试5次就试出来的机率好大?
The number of password digits here can only be one. Then theoretically, isn't the probability of trying it out in 5 attempts quite high?
|
|
2010-8-20 10:38 |
|
|
jfcjb
新手上路

积分 4
发帖 19
注册 2010-8-25
状态 离线
|
|
2010-8-27 16:47 |
|