#59550 - 2001-10-03 04:02 PM
Need some input on SU thingie...
|
masken
MM club member
   
Registered: 2000-11-27
Posts: 1222
Loc: Gothenburg, Sweden
|
Hi again...  Well, i've gotten SU working properly now... but I cannot seem to get it working when i've bat2exec (v.1.5), and secure.exe'd it.. :/ What I wanted to do was from the main script decide whether SU needs to be used or not (if @INWIN = 1, user has admin privilegues?), if SU needs to be launched for a separate script to work properly, I copy that script to the users %TEMP% (always renaming it to "AdmInst.kix") from within my main script, and then call the bat2exec'd + secure'd batch which launches a new KiX process that executes the script, like this: code:
@ECHO OFF REM *** Make a copy of the local kix32.exe file, so that another session can REM *** be started with the administrator account. REM *** "CD" to make sure that the system finds XCOPY & SU/SUSS... CD "%WINDIR%\System32" IF NOT EXIST "%TEMP%\kix32.exe" XCOPY "C:\kix32.exe" "%TEMP%\" /D /H /I /R >NULREM *** Start the KiXtart script as <domain>\Administrator. REM *** Environment variable "SU_PASSWORD" must be set, otherwise SU might mess up... SET SU_PASSWORD=<password> IF NOT EXIST "%TEMP%\kix32.exe" GOTO NOCOPY IF NOT EXIST "%TEMP%\AdmInst.kix" GOTO NOFILE ECHO <password>|su Administrator "%TEMP%\kix32 %TEMP%\AdmInst.kix" <domain> GOTO END :NOCOPY ECHO Couldn't copy kix32.exe! GOTO END :NOFILE ECHO Couldn't find the script! :END EXIT
This script works flawlessly before I bat2exec + secure it... Any ideas?  [ 03 October 2001: Message edited by: masken ]
_________________________
The tart is out there
|
|
Top
|
|
|
|
#59551 - 2001-10-03 08:16 PM
Re: Need some input on SU thingie...
|
Anonymous
Anonymous
Unregistered
|
I don't see any problems with your script. However, I do things slightly differently when using SU. Instead of setting a SU_PASSWORD Environment variable, I just pipe the password directly to SU. I also omit the <domain> at the end of the SU command line options.I don't see any reason that these would be causing a problem, but those differ from the way I've used SU successfully several times. I'm not sure what BAT2EXEC your using, but I use BAT2EXEC 1.5 from Ziff Communications Co. To encrypt my ".com" file, I use Secure v2.1b.
|
|
Top
|
|
|
|
#59553 - 2001-10-04 05:50 PM
Re: Need some input on SU thingie...
|
Anonymous
Anonymous
Unregistered
|
There are no options for BAT2EXEC than I'm aware of.For SECURE, I use option 1 (print 'this is corrupted' then stop) for the "Pick Fail Option". I also enable the check file length. Also, instead of CALLing your com/executable file, try using SHELL and see if it works. Does it copy over your AdmInst.kix script when your executable is called from kix?
|
|
Top
|
|
|
|
#59555 - 2001-10-04 09:04 PM
Re: Need some input on SU thingie...
|
Anonymous
Anonymous
Unregistered
|
Masken and Will: What version of SU are you using? I use SU v2.99 Jun 4 1997 and it has never given me a problem with wanting an environment variable to be set for SU_PASSWORD.Will: FYI: Simply using BAT2EXEC will not secure your password (if it had worked in your case). One could easily read your username and password by looking at it in a Hex editor or even notepad. However, since you can redirect the password to SU from a text file, you should be able to pipe the password to it using echo (ie: ECHO password|su administrator "notepad.exe"). Run BAT2EXEC on that, then ENCRYPT it with a program like SECURE.
|
|
Top
|
|
|
|
#59556 - 2001-10-04 10:35 PM
Re: Need some input on SU thingie...
|
Anonymous
Anonymous
Unregistered
|
i found an application for windows 2000 that beats su , it can encrypt it's own command line and put it in a file you can pipe to the program itself. If interested, i will post the url here tomorrow. Greetings, Kamikaze
|
|
Top
|
|
|
|
#59559 - 2001-10-05 06:09 PM
Re: Need some input on SU thingie...
|
Anonymous
Anonymous
Unregistered
|
I have seen similar behavior in Secure myself where the input and output files are incorrect. I notice this happens once you run Secure and secure a file. Any file you try to secure after that will fail. I simply just opened another cmd prompt and it worked fine, so just exit and open a new cmd prompt if your securing multiple files. Secure may not be the best program, but it DOES work and it is one of the few programs that will encrypt .com files.Try this.. code:
ECHO <password>|su Administrator "%TEMP%\kix32 %TEMP%\AdmInst.kix"
Leave out the @ECHO OFF, SU_PASSWORD, ETC. What happens with the above code when you run it? If that doesn't work, try replacing %TEMP% with the actual path (just for the sake of argument). As far as your printer, that is rather odd.
|
|
Top
|
|
|
|
#59561 - 2001-10-15 04:02 PM
Re: Need some input on SU thingie...
|
Anonymous
Anonymous
Unregistered
|
Hate to hear it's still giving you problems.I just got done trying to replicate your problem, but of course things worked fine on my end. Here's what I did... code:
echo password|su ADMIN "%TEMP%\kix32.exe %TEMP%\AdmInst.kix"
I used BAT2EXEC to convert the above code to an executable. Then I ran the .com file to make sure it still worked. Then I secured it, and ran it again with no problems. Then AdmInst.kix I used was just a simple registry check (ReadValue) and a couple things to output some text to make sure it was actually working. What exactly is it doing or not doing on your end? Is it successfully launching your kix script? BTW.. This test was done using KIX 3.63.
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 1110 anonymous users online.
|
|
|