Board index » Visual Studio » runas sending a pwd using a file
|
Orision
|
|
Orision
|
runas sending a pwd using a file
Visual Studio134
Hi i need to use a bat file to run a program as administrator but i dont want to let know the administrator password. i'd likw to create a .bat file: echo off runas /profile /user:administrator\peterpan cmd i did that but it ask me the password, how can i send it by the .bat file??? thanks ...... any other suggestion are appreciate carlo - |
| Jim
Registered User |
Tue Apr 19 17:34:08 CDT 2005
Re:runas sending a pwd using a file
It can't be done with the "runas" command. It is never a good idea to put
passwords in a file. Perhaps if you explain what you are trying to accomplish we can suggest a method that works without a password. -- Jim Vierra msdn.microsoft.com/theshow/Episode048/default.asp">msdn.microsoft.com/theshow/Episode048/default.asp "Carlo" <carletto.mNOSPAM@gmail.com>wrote in message QuoteHi - |
| Carlo
Registered User |
Tue Apr 19 18:04:18 CDT 2005
Re:runas sending a pwd using a file
i send a previous message: this is the old message
******************************************************** hi, yesterday i posted this mail, no answer for now. i see that the problem disappear if i login as administrator with no limitation, because i'm not the administrator of the server i'd like to ear any suggest to the source of the problem any idea??? thanks again carlo i wrote code in VB to connect and use a MSSQL db, it runs well on my develop machine (winXP sp2) when i use it on a Win2003 server i have got a problem.... i wrote: On Error GoTo ErrorHandler ... open and close recordset on the same connection .... connectio.Execute strQuery and it stops the program and doesnt get the error exception , just open a msgBox with: error overflow, 6 WHere is the problem??? why on my machine there isnt any problems??? thanks a lot carlo ******************************************************** this is my problem... i try to solve it launcing my application using runas ... administrator in this way everything runs fine i hope you can help me to solve the real problem or just tell me how to solve the second one thanks a lot carlo "Jim Vierra" <jvierra@msn.com>ha scritto nel messaggio QuoteIt can't be done with the "runas" command. It is never a good idea to put - |
| Jim
Registered User |
Tue Apr 19 18:42:04 CDT 2005
Re:runas sending a pwd using a file
This is a multi-part message in MIME format.
------=_NextPart_000_00E0_01C54517.DCF38B80 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Carlo=20 Not correct in scripting. On Error GoTo ErrorHandler Only use "On Error Resume Next" and Set rs =3D connectio.Execute( strQuery ) And more but you didn't send the whole script. --=20 Jim Vierra msdn.microsoft.com/theshow/Episode048/default.asp">msdn.microsoft.com/theshow/Episode048/default.asp "Carlo" <carletto.mNOSPAM@gmail.com>wrote in message = Quotei send a previous message: this is the old message charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; = charset=3Diso-8859-1"> <META content=3D"MSHTML 6.00.2900.2627" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY> <DIV><FONT face=3DArial size=3D2>Carlo </FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>Not correct in scripting. </FONT><FONT = face=3DArial=20 size=3D2><STRONG>On Error GoTo ErrorHandler</STRONG></FONT></DIV> <DIV><FONT face=3DArial size=3D2><STRONG></STRONG></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>Only use "On Error Resume Next"</DIV> <DIV><BR>and</DIV> <DIV> </DIV> <DIV>Set rs =3D connectio.Execute( strQuery )</DIV> <DIV> </DIV> <DIV>And more but you didn't send the whole script.<BR>-- <BR>Jim=20 Vierra<BR></FONT><A=20 href=3D"msdn.microsoft.com/theshow/Episode048/default.asp"><FONT">msdn.microsoft.com/theshow/Episode048/default.asp"><FONT = face=3DArial=20 size=3D2>msdn.microsoft.com/theshow/Episode048/default.asp</FONT><=">msdn.microsoft.com/theshow/Episode048/default.asp</FONT><= /A></DIV> <DIV><FONT face=3DArial size=3D2>"Carlo" <</FONT><A=20 href=3D"mailto:carletto.mNOSPAM@gmail.com"><FONT face=3DArial=20 size=3D2>carletto.mNOSPAM@gmail.com</FONT></A><FONT face=3DArial = size=3D2>> wrote=20 in message </FONT><A = href=3D"news:uaG2cQTRFHA.2680@TK2MSFTNGP09.phx.gbl"><FONT=20 face=3DArial = size=3D2>news:uaG2cQTRFHA.2680@TK2MSFTNGP09.phx.gbl</FONT></A><FONT=20 face=3DArial size=3D2>...</FONT></DIV><FONT face=3DArial size=3D2>>i = send a previous=20 message: this is the old message<BR>>=20 ********************************************************<BR>> hi, = yesterday i=20 posted this mail, no answer for now.<BR>> i see that the problem = disappear if=20 i login as administrator with no<BR>> limitation, because i'm not the = administrator of the server i'd like to ear<BR>> any suggest to the = source of=20 the problem<BR>> any idea???<BR>> thanks again<BR>> = carlo<BR>>=20 <BR>> i wrote code in VB to connect and use a MSSQL db, it runs well = on my=20 develop<BR>> machine (winXP sp2) when i use it on a Win2003 server i = have got=20 a<BR>> problem....<BR>> i wrote:<BR>> <BR>> On Error GoTo=20 ErrorHandler<BR>> ...<BR>> open and close recordset on the same=20 connection<BR>> ....<BR>> connectio.Execute strQuery<BR>> = <BR>> and=20 it stops the program and doesnt get the error exception , just open = a<BR>>=20 msgBox with:<BR>> <BR>> error overflow, 6<BR>> <BR>> WHere = is the=20 problem???<BR>> why on my machine there isnt any problems???<BR>> = thanks a=20 lot<BR>> carlo<BR>> <BR>>=20 ********************************************************<BR>> = <BR>> this=20 is my problem...<BR>> i try to solve it launcing my application using = runas=20 ... administrator<BR>> in this way everything runs fine<BR>> i = hope you=20 can help me to solve the real problem or just tell me how to <BR>> = solve the=20 second one<BR>> thanks a lot<BR>> carlo<BR>> <BR>> <BR>> = <BR>>=20 "Jim Vierra" <</FONT><A href=3D"mailto:jvierra@msn.com"><FONT = face=3DArial=20 size=3D2>jvierra@msn.com</FONT></A><FONT face=3DArial size=3D2>> ha = scritto nel=20 messaggio <BR>> </FONT><A=20 href=3D"news:%23wbVw$SRFHA.508@TK2MSFTNGP12.phx.gbl"><FONT face=3DArial=20 size=3D2>news:%23wbVw$SRFHA.508@TK2MSFTNGP12.phx.gbl</FONT></A><FONT = face=3DArial=20 size=3D2>...<BR>>> It can't be done with the "runas" command. It = is never a=20 good idea to put <BR>>> passwords in a file.<BR>>> Perhaps = if you=20 explain what you are trying to accomplish we can suggest a <BR>>> = method=20 that works without a password.<BR>>><BR>>> -- <BR>>> = Jim=20 Vierra<BR>>> </FONT><A=20 href=3D"msdn.microsoft.com/theshow/Episode048/default.asp"><FONT">msdn.microsoft.com/theshow/Episode048/default.asp"><FONT = face=3DArial=20 size=3D2>msdn.microsoft.com/theshow/Episode048/default.asp</FONT><=">msdn.microsoft.com/theshow/Episode048/default.asp</FONT><= /A><BR><FONT=20 face=3DArial size=3D2>>> "Carlo" <</FONT><A=20 href=3D"mailto:carletto.mNOSPAM@gmail.com"><FONT face=3DArial=20 size=3D2>carletto.mNOSPAM@gmail.com</FONT></A><FONT face=3DArial = size=3D2>> wrote=20 in message <BR>>> </FONT><A=20 href=3D"news:uDQWJ4SRFHA.688@TK2MSFTNGP10.phx.gbl"><FONT face=3DArial=20 size=3D2>news:uDQWJ4SRFHA.688@TK2MSFTNGP10.phx.gbl</FONT></A><FONT = face=3DArial=20 size=3D2>...<BR>>>> Hi<BR>>>> i need to use a bat file = to run a=20 program as administrator but i dont <BR>>>> want to let know = the=20 administrator password. i'd likw to create a .bat <BR>>>>=20 file:<BR>>>><BR>>>> echo off<BR>>>> runas = /profile=20 /user:administrator\peterpan cmd<BR>>>><BR>>>> i did = that but=20 it ask me the password, how can i send it by the .bat <BR>>>>=20 file???<BR>>>> thanks<BR>>>> ...... any other = suggestion are=20 appreciate<BR>>>> carlo<BR>>>><BR>>><BR>>> = <BR>> <BR>></FONT></BODY></HTML> ------=_NextPart_000_00E0_01C54517.DCF38B80-- - |
| Carlo
Registered User |
Tue Apr 19 19:26:16 CDT 2005
Re:runas sending a pwd using a filei tried but the problem is there the same just the application doesnt crash the problem is that when i execute te query there is an error... this error doesnt exist if i run the app as root can you tell me how can i pass the password using a file??? if you want i can sent the code carlo - |
| Jim
Registered User |
Tue Apr 19 19:46:34 CDT 2005
Re:runas sending a pwd using a file
Can't be done. Your syntax won't work in a script even if you run as an
admin. I don't know why you think it's working unless there are things you are not showing. Send code. -- Jim Vierra msdn.microsoft.com/theshow/Episode048/default.asp">msdn.microsoft.com/theshow/Episode048/default.asp "Carlo" <carletto.mNOSPAM@gmail.com>wrote in message Quote
- |
| Alan
Registered User |
Wed Apr 20 09:05:01 CDT 2005
Re:runas sending a pwd using a file
The must-have for this particular scenario is cpau.exe form joeware
(www.joeware.net/win/free/tools/cpau.htm).">www.joeware.net/win/free/tools/cpau.htm). This tool produces just what you're looking for. The best way to hide the logon/password is to follow the instructions for creating a job file (which will bundle the credentials in a text file of scrambled alphanumeric soup). When working this type of solution into a logon script there are two approaches you can use as to where cpau.exe and the supporting text file will reside. 1. An additional segment in your logon script that creates a folder on the user's machine and then copies the two files to each PC before running your executable (works faster). - or - 2. Storing the two files on a server share and have the logon script point to this location (works a little slower but ensures you only have one job file to fool with in the event you want to make changes). I created a separate account for running the installation so if I needed to disable it or change the password I wouldn't have to worry about its impact on other dependencies. Either way let me know of your outcome. - |
| Jim
Registered User |
Wed Apr 20 13:17:55 CDT 2005
Re:runas sending a pwd using a file
A far safer approach is to delegate the needed resource to the user needing
to run it. This doesn't require elevation of a process in the user session. There is no documentation on the hash used for encrypting the file so be careful. In nearly every case I have seen where an admin has needed to do this it was an issue of delegation. Delegation can be controlled at the resource level so an elevated session is not required. Cute methods for bypassing security are always good targets for hackers and Trojans. -- Jim Vierra "Alan" <Alan.Kincer@med.va.gov>wrote in message QuoteThe must-have for this particular scenario is cpau.exe form joeware - |
| Alan
Registered User |
Wed Apr 20 13:47:57 CDT 2005
Re:runas sending a pwd using a file
How is the install delegated? By application name? Does the end user
perform the install or is it still left in the logon script? - |
| Jim
Registered User |
Thu Apr 21 17:37:07 CDT 2005
Re:runas sending a pwd using a file
If you are trying to install software you should use Group Policy. It will
install at the proper level and with or without the users interaction. -- Jim Vierra "Alan" <Alan.Kincer@med.va.gov>wrote in message QuoteHow is the install delegated? By application name? Does the end user - |
| Alan
Registered User |
Fri Apr 22 07:21:38 CDT 2005
Re:runas sending a pwd using a file
I've done this with Office 2003, Adobe Reader 7, and Java 1.5.1 which
all work well (especially since they come with good support for the requisite .msi build). What I'm curious about is your earlier statement regarding delegation. The logon script include I mentioned earlier is useful for smaller applications or updates that will not take long to install, can be installed in some sort of "silent" mode, and do not come with low-headache .msi support (high-headache approach being the "snapshot" method). If there is a delegation-based approach that does not involve user interaction I would be very interested to learn how this is done. - |
| Jim
Registered User |
Fri Apr 22 10:29:38 CDT 2005
Re:runas sending a pwd using a file
It all depends on what software you are distributing. Some software just
can't be automated. Almost all software based on MSI can be automated. "Silent" is a function of the vendors installation design and out of our control. GP can distribute to users and allow interaction yet still install with admin level privileges. -- Jim Vierra "Alan" <Alan.Kincer@med.va.gov>wrote in message QuoteI've done this with Office 2003, Adobe Reader 7, and Java 1.5.1 which - |
| newsletter2
Registered User |
Sat Apr 23 23:15:46 CDT 2005
Re:runas sending a pwd using a file
"Carlo" <carletto.mNOSPAM@gmail.com>wrote in message news:<uDQWJ4SRFHA.688@TK2MSFTNGP10.phx.gbl>...
QuoteHi take a look to runasspc on www.robotronic.de\runasspc.html a standard user or guest can run a program with admin level privliges. The admin write the information (adminaccount,passwort,programname) in a crypt file. And the user can run the program with the information in this file without knowing the password. The site is in german but the tool is english and very simple to use. Try runasspc -h to see instructions or take a look on the start.bat to see commandline sample to use runasspc bye - |
| Al
Registered User |
Sun Apr 24 11:18:19 CDT 2005
Re:runas sending a pwd using a file"Marc Foster" <newsletter2@robotronic.de>wrote in message Quote"Carlo" <carletto.mNOSPAM@gmail.com>wrote in message CPAU from www.joeware.net/win/free/tools/cpau.htm">www.joeware.net/win/free/tools/cpau.htm RunAs Pro from www.gold-software.com/download2346.html">www.gold-software.com/download2346.html /Al - |
| Al
Registered User |
Sun Apr 24 11:37:44 CDT 2005
Re:runas sending a pwd using a file"Marc Foster" <newsletter2@robotronic.de>wrote in message Quote"Carlo" <carletto.mNOSPAM@gmail.com>wrote in message a google translation), I would like more information on the nature of the encryption used, plus any other features that have been developed to prevent the use of the stored credentials for any purposes other than running the applications they were created for. /Al - |
| Jason
Registered User |
Tue Apr 26 14:14:27 CDT 2005
Re:runas sending a pwd using a file
On 4/24/2005 12:37, Al Dunbar [MS-MVP] wrote:
Quotea google translation), I would like more information on the nature of the <csrc.nist.gov/encryption/aes/rijndael/Rijndael.pdf>">csrc.nist.gov/encryption/aes/rijndael/Rijndael.pdf> ~Jason -- - |
| Jim
Registered User |
Tue Apr 26 16:33:39 CDT 2005
Re:runas sending a pwd using a file
Has anyone looked into the secure password extensions to WSH 5.6.
-- Jim Vierra "Jason Gurtz" <jason@NOSPAMtommyk.com>wrote in message QuoteOn 4/24/2005 12:37, Al Dunbar [MS-MVP] wrote: - |
| Al
Registered User |
Tue Apr 26 20:30:14 CDT 2005
Re:runas sending a pwd using a file"Jason Gurtz" <jason@NOSPAMtommyk.com>wrote in message QuoteOn 4/24/2005 12:37, Al Dunbar [MS-MVP] wrote: perhaps somewhat less than 45 pages of it ;-) But how encryption is used is likely as important as the algorithm on which it is based. I forget the details, but some time ago an implementation of a fairly strong algorithm was found to be easily cracked. The fact that it was 128bit-based (or whatever) was outweighed by the way they seeded it such that someone saw a pattern and deduced its source. In this case, is there anything about the implementation that would tend to arbitrarily limit the range of possible password values? /Al - |
| Jim
Registered User |
Tue Apr 26 21:33:24 CDT 2005
Re:runas sending a pwd using a file
If the password was of great complexity and a 256 bit hash were used and the
password were changed every 14 days and security is monitored very closely then that 256 encryption algorithm would be sufficient. Fail in any one of the above and I guarantee it is crackable. In fact there are, doubtlessly, web site that you can submit the encrypted password to and get a decrypted version within a reasonable amount of time. There has been a hacker attempt at build a super virtual computer just for cracking passwords quickly. If you have anything to protect then be careful. -- Jim Vierra "Al Dunbar [MS-MVP]" <alan-no-drub-spam@hotmail.com>wrote in message Quote
- |
| Jason
Registered User |
Wed Apr 27 14:22:23 CDT 2005
Re:runas sending a pwd using a file
On 4/26/2005 22:33, Jim Vierra wrote:
Quotethen that 256 encryption algorithm would be sufficient. Fail in any one of plain user (anyone). It's just not going to be perfect, but it can be pretty good. I guess the real question is how badly you think someone would want to crack it and is AES-256 at least a little more than they'd want to spend. Cheers, ~Jason -- - |
| Jim
Registered User |
Wed Apr 27 19:00:21 CDT 2005
Re:runas sending a pwd using a file
Depends on what you are storing on your network. If it is a bank, insurance
company, gov office any of these and others then someone would want to have it. -- Jim Vierra "Jason Gurtz" <jason@NOSPAMtommyk.com>wrote in message QuoteOn 4/26/2005 22:33, Jim Vierra wrote: - |
