#58598 - 2001-08-27 11:35 AM
Re: Encrypt KiXtart scripts?
|
Jeroen
Starting to like KiXtart
Registered: 2001-08-16
Posts: 180
Loc: Netherlands
|
Hi,I've tried it, but all the commands are still easy to read.. I probably have to license the program before other functions can be used, and that's not an option.. Isn't there a (freeware/free) way to convert it to an executable or something like that?
_________________________
Regards, Jeroen.
There are two ways to write error-free programs. Only the third one works.
|
|
Top
|
|
|
|
#58600 - 2001-08-27 11:45 AM
Re: Encrypt KiXtart scripts?
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11634
Loc: Space
|
Jeroen, This program is released as freeware by MCA What can be done is that this program can strip out all comments, blank lines, and place ALL the commands on one single line. If you have a small script then yes it is probably still understandable. However if you have any kind of real length to a script it is very hard to tell what or how things are done when you have a line with a 1,000 characters all on one line. KiXtart is an interpreted language and as such can not be "compiled" The KiXtart engine reads all the lines and then interprets the commands to perform. To my knowledge there is no way to "encrypt or compile" the code and still be useable. Some have tried things like ARJ or LHX etc to encrypt and decrypt on the fly. Not sure how well these solutions have worked out for them though. Try searching the board for Encrypt and ARJ, etc... You may find more information on this topic.
|
|
Top
|
|
|
|
#58601 - 2001-08-27 11:50 AM
Re: Encrypt KiXtart scripts?
|
Anonymous
Anonymous
Unregistered
|
There is an other script language witch is able to encrypt scripts. It's called AutoIT but unfortunately it has only few commands. We use these both script languages together and it works very goodYou can get Autoit at http://www.hiddensoft.com/autoit
|
|
Top
|
|
|
|
#58605 - 2001-08-27 10:31 PM
Re: Encrypt KiXtart scripts?
|
Jeroen
Starting to like KiXtart
Registered: 2001-08-16
Posts: 180
Loc: Netherlands
|
To give you an idea;The company I work for has a lot of engineers employed. It seems some of them have nothing else to do but check out the latest on the Netlogon shares, as soon as they detect a change in the logon script, or in how their computer reacts to certain commands etc. Some time ago, we had to use the local administrator password in a script. We made it as difficult as (then) possible for the users to find it, even put in in unreadable form, but a couple of days later, one of the (honest) technical users gave us a call, and told us the password. After this, we made a 180 degrees turn, and we will never put anything like that in any script again, unless we're absolutely sure that users are unable to find it. (read it/crack it). We have learned our lesson. To still perform a similar function, we made a .BAT file containing a command with the password needed for this command. (say for example, a NET USE command, providing username and password). What we did, was convert the BAT file to EXE, and encrypt this EXE to a new EXE using a password and an encrypting util. This file cannot be read as easily. Of course; all passwords can be cracked, but if they can crack this file within reasonable time, they will be employed by IT. (haha!). I've unleached crack programs on this file, but the time they would need to crack it, is very satisfactory !! (More than a year). Since the passwords for these functions are changed more often, this is an unlikely event. What I'm looking for, is a way to prevent that users can read scripts that easily, thus preventing that when we write a script, for example disabling the File and Printer sharing button, they won't create a regpatch enabeling it again for themselves. Even if the encryption is simple, and the client decrypts the file, the users most likely won't go through the trouble of trying.. Even if they do, we still won't place password or thing like that in there, so...
_________________________
Regards, Jeroen.
There are two ways to write error-free programs. Only the third one works.
|
|
Top
|
|
|
|
#58607 - 2001-10-15 06:52 AM
Re: Encrypt KiXtart scripts?
|
MCA
KiX Supporter
   
Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
|
Dear,An interesting discussion which you can find many times on the board. A little reaction about "how to make your script secure" and our suggestion "how to implement it by kixtart". We are using not only codec to make our script secure. We are using
- kixstrip: to remove additional comment and unwanted spaces and combine
statements to one line. One long unstructured line is hard to read.
- codec: to encrypt/decrypt any type of file. by using dynamic encryption
method no encryption result looks the same. by a CRC check mechanism any possible modification to that file will ignore decryption.
- bat2exec: to convert your BAT file to an EXE file. mostly such file
can contain passwords, special programs or special pathnames. the result is readable by users, but the secure21.zip package can encrypt the result to something unreadable.
- secure21.zip package: using to encrypt in 1-way your EXE files.
An example how to use a set of above programs you can read topic http://kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=1&t=002750 The result of kixstrip for
code:
IF setconsole("hide") ENDIF ; ; NT/95 create description list of KiXtart errors - Kixtart 4.00 ; ; (c) scripting@wanadoo.nl - 2001 ; ; vs 1.00 - program ; ; 1.00 (20010715) original version ; FUNCTION SetError($error_number) EXIT $error_number ENDFUNCTION ; $tmp_directory=ExpandEnvironmentVars("%tmp%") IF (substr($tmp_directory,len($tmp_directory),1) <> "\") $tmp_directory=$tmp_directory+"\" ENDIF ; $info_file=$tmp_directory+"kix-code.txt" IF RedirectOutput($info_file,1) ENDIF ? "KiXtart "+@kix+" - Summary Error Codes" ? FOR $i=0 TO 9999 SetError($i) IF (len(@serror) <> 0) AND (Instr(@serror,"Error retrieving error information for") = 0) AND (Instr(@serror,", 13D)") = 0) $result=@serror $pos=Instr($result,CHR(13)+CHR(10)) WHILE ($pos <> 0) IF ($pos <> 0) $result=substr($result,1,$pos-1)+" "+substr($result,$pos+2,len($result)-$pos-1) ENDIF $pos=Instr($result,CHR(13)+CHR(10)) LOOP IF (Substr($result,len($result),1) = CHR(10)) OR (Substr($result,len($result),1) = CHR(13)) ? Substr(" ",1,7-len("@error"))+"@error "+Substr($result,1,len($result)-1) ELSE ? Substr(" ",1,7-len("@error"))+"@error "+$result ENDIF ENDIF NEXT IF RedirectOutput("") ENDIF ? "Informative KIX: create an actual description list of KiXtart "+@kix+" errors." ? " file created '"+LCASE($info_file)+"'." EXIT
isn't easily to read, when we also convert the variable name to mnemonic name. Result is one long line of 967 characters.
code:
if setconsole("hide") endif function SetError($x1) exit $x1 endfunction $x2=ExpandEnvironmentVars("%tmp%") if (substr($x2,len($x2),1)<>"\") $x2=$x2+"\" endif $x3=$x2+"kix-code.txt" if RedirectOutput($x3,1) endif ? "KiXtart "+@kix+" - Summary Error Codes" ? for $x4=0 to 9999 SetError($x4) if (len(@serror)<>0) AND (Instr(@serror,"Error retrieving error information for")=0) AND (Instr(@serror,", 13D)")=0) $x5=@serror $x6=Instr($x5,CHR(13)+CHR(10)) while ($x6<>0) if ($x6<>0) $x5=substr($x5,1,$x6-1)+" "+substr($x5,$x6+2,len($x5)-$x6-1) endif $x6=Instr($x5,CHR(13)+CHR(10)) loop if (Substr($x5,len($x5),1)=CHR(10)) OR (Substr($x5,len($x5),1)=CHR(13)) ? Substr(" ",1,7-len("@error"))+"@error "+Substr($x5,1,len($x5)-1) else ? Substr(" ",1,7-len("@error"))+"@error "+$x5 endif endif next if RedirectOutput("") endif ? "Informative KIX: create an actual description list of KiXtart "+@kix+" errors." ? " file created '"+LCASE($x3)+"'." exit
How interesting is such code for analyzing by even kixtart programmers?Biggest problem is for kixtart (= kix32.exe): it need an input file. Our suggestion is: 1. create additional program which make a 1-way encryption. 2. extend kix32.exe to handle a normal and a 1-way encrypted input file. This method is must easier for implementation. The piping of scripts to kix32.exe will be a better solution. No temporary readable file must be created. Greetings. btw: some reactions on reactions to this topic.
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 2175 anonymous users online.
|
|
|