Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Batch using encrypted password

1,438 views
Skip to first unread message

ro...@netware.arp

unread,
Mar 27, 2002, 1:46:00 AM3/27/02
to
Hello

I have many batch-files, using user-id and password. is there a possibility
to encrypt the password inside the batchfile, so users from outsid won't see
the password?

thanks


Frank-Peter Schultze

unread,
Mar 28, 2002, 11:19:02 AM3/28/02
to
In article <3ca16a99$0$751$7402...@newsfeed.sunrise.ch>,
ro...@netware.arp says...

Instead of hard-code the password you could save the password in a text
file w/appropriate security settings (requires an NTFS formatted drive).
To set a variable PW to the password:

For /F %%P In (passwordfile) Do Set PW=%%P

A while ago, I used an "enhancement" of this method:

I started DEBUG and typed

e100 "set PW=mypassword"D A

Then I typed 'd100' to get a hexdump of the above. Based on that data I
created a debug script (say %SystemRoot%\pw.dbg) like this:

e0100 73 65 74 20 50 57 3D 6D 79 70 61 73 73 77 6F 72
e0110 64 0D 0A 66 61 73 64 66-0D 0A CD 21 34 00 58 0C
rcx
13
w
q

Whenever I needed the password I used this commands

Type NUL > %TEMP%.\$PW.BAT
Debug %TEMP%.\$PW.BAT < %SystemRoot%\pw.dbg > NUL
For %%C In (Call Del) Do %%C %TEMP%.\$PW.BAT
::For example:
Net Use * \\server\share %PW% /user:angusyoung

HTH

--
Frank-Peter Schultze, http://www.fpschultze.de

Pavel Srubar

unread,
Mar 28, 2002, 11:43:35 AM3/28/02
to
<ro...@netware.arp> wrote

> I have many batch-files, using user-id and password. is there a possibility
> to encrypt the password inside the batchfile, so users from outsid won't see
> the password?

This is usualy being done by revoking all NTFS rights from the batch files
except for the account the batch in question will run under.
If you are creating the scripts 'on the fly' you can also write
another batch file GIVEPWD.CMD which only echoes the password
on system output and hide GIVEPWD.CMD using NTFS rights:

---GIVEPWD.CMD---
@ECHO mysecretpwd

---SENDFTP.CMD---
ECHO username > %TEMP%\FTP.SCR
CALL GIVEPWD.CMD >>%TEMP%\FTP.SCR
ECHO binary >>%TEMP%\FTP.SCR
ECHO put aFile >>%TEMP%\FTP.SCR
ECHO bye >>%TEMP%\FTP.SCR
FTP -i -s:%TEMP%\FTP.SCR
DEL %TEMP%\FTP.SCR

Bye,
v
Sr.

ro...@netware.arp

unread,
Apr 4, 2002, 6:27:06 AM4/4/02
to

"Frank-Peter Schultze" <fpsch...@bigfoot.de> schrieb im Newsbeitrag
news:MPG.170d60bbe...@news.cis.dfn.de...

>>> Hallo Frank
>>> Dein dbg File scheint nicht so richtig zu funktionieren. Hast Du eine
Idee?
>>> Gruss und danke
>>> PS. Angus, I got the Jack!

Frank-Peter Schultze

unread,
Apr 4, 2002, 12:14:23 PM4/4/02
to
In article <3cac387d$0$23947$7402...@newsfeed.sunrise.ch>,
ro...@netware.arp says...

>
> "Frank-Peter Schultze" <fpsch...@bigfoot.de> schrieb im Newsbeitrag
> news:MPG.170d60bbe...@news.cis.dfn.de...
> > In article <3ca16a99$0$751$7402...@newsfeed.sunrise.ch>,
> > ro...@netware.arp says...
> > > Hello
> > >
> > > I have many batch-files, using user-id and password. is there a
> possibility
> > > to encrypt the password inside the batchfile, so users from outsid won't
> see
> > > the password?
> >
> > Instead of hard-code the password you could save the password in a text
> > file w/appropriate security settings (requires an NTFS formatted drive).
> > To set a variable PW to the password:
> >
> > For /F %%P In (passwordfile) Do Set PW=%%P
> >
> > A while ago, I used an "enhancement" of this method:
> >
> > I started DEBUG and typed
> >
> > e100 "set PW=mypassword"D A
> >
> > Then I typed 'd100' to get a hexdump of the above. Based on that data I
> > created a debug script (say %SystemRoot%\pw.dbg) like this:
> >
> > e0100 73 65 74 20 50 57 3D 6D 79 70 61 73 73 77 6F 72

Remove the hyphen (-) in the next line

0 new messages