Jump to content

Protect password in batch file


Recommended Posts

Guest henryb
Posted

I need to use the net use command in a batch file that will be run

automatically, to ensure that a mapped drive is connected.

 

My question is, how can I avoid having the password to the mapped share

appear in plain text in the batch file?

 

Thanks.

  • Replies 3
  • Created
  • Last Reply
Guest Hans Le Roy
Posted

Hi Henry,

 

"henryb" <henryb@discussions.microsoft.com> wrote in message

news:281C754F-F208-4E66-B7F6-C0D4E7F4429F@microsoft.com...<span style="color:blue">

>I need to use the net use command in a batch file that will be run

> automatically, to ensure that a mapped drive is connected.

>

> My question is, how can I avoid having the password to the mapped share

> appear in plain text in the batch file?

>

> Thanks.</span>

 

Maybe Batch2Exe does what you want.

http://bat-to-exe-converter.fatih-kodak.qarchive.org/

 

Kind regards

 

Hans

Guest VanguardLH
Posted

Hans Le Roy wrote:

<span style="color:blue">

> Hi Henry,

>

> "henryb" <henryb@discussions.microsoft.com> wrote in message

> news:281C754F-F208-4E66-B7F6-C0D4E7F4429F@microsoft.com...<span style="color:green">

>>I need to use the net use command in a batch file that will be run

>> automatically, to ensure that a mapped drive is connected.

>>

>> My question is, how can I avoid having the password to the mapped share

>> appear in plain text in the batch file?

>>

>> Thanks.</span>

>

> Maybe Batch2Exe does what you want.

> http://bat-to-exe-converter.fatih-kodak.qarchive.org/</span>

 

You sure? Doesn't that merely wrap the original file with an .exe

interpreter? That is, the original batch file is probably just a data

section in the .exe file that anyone with a hex editor could view the

text strings to see the password. One of the features mentioned at the

author's home site is "hidden source" so maybe it jumbles up the data so

it can't be seen by looking inside the resultant .exe file with a hex

editor or string search utility.

Guest Anteaus
Posted

http://autoitscript.com

 

Compile to an encrypted executable, and it's reasonably secure - well,

against nongeek types anyway. You can run the batch file with Run() - or

better, use the builtin DriveMapAdd() command.

 

If you want to be more secure, there is an RC4 module you can encrypt the

password itself with. Although, I would have the user enter it manually, no

automatic password is entirely secure as the computer itself must have some

way of decrypting it.

 

You should also over-write any variable which held the plaintext password

with a random string before the program terminates, otherwise a

memory-sniffer could still find it in RAM or the swapfile. But then, that's

getting paranoid.

 

Either that, or use http://mylogon.net - a GPL tool for a similar purpose

which might meet your needs.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...