Solved

encrypt password in the batch file for net use command

Posted on 2008-06-23
5
15,518 Views
Last Modified: 2011-10-04
Hi,

I have a batch file to connect to the remote server using the net use command and i am using a service account for it.
But, the problem is that the password is in clear text so is there any way so that i can encrypt the password or any other option to store the password in registry files and call from there.

Please help me with this as i am not good at batch file scripting

Thanks a lot
0
Comment
Question by:deepikanandi
5 Comments
 
LVL 11

Expert Comment

by:rowansmith
Comment Utility
At the end of the day you have to store the password somewhere where it is readable.

The only way to protect this password is via NTFS permissions to ensure that no one can read it who is not authorised to read it.

The other option is not to use a password and instead rely on the built-in account that the batch is running in.  this dosn;t really change your security posture as anyone with access to that account is also able to access the resources.

-Rowan
0
 
LVL 13

Accepted Solution

by:
TheCapedPlodder earned 500 total points
Comment Utility
I use a freeware tool called cpau to encrypt my batch files with stored credentials.

You can find it here:

http://www.joeware.net/freetools/tools/cpau/index.htm

All of the details you need to get started are on the website or available from cpau /?

Once you've tried it if you have any specific cpau queries, let me know.

Cheers,

TCP
0
 

Expert Comment

by:netfriendsinc
Comment Utility
I have a question on this.  I have a batch file that runs and maps a drive which includes plain text password, eg:

net use x: \\server\share /user:domain\users password123

how do i use cpau to run this batch file so that it is encrypted?  

I was thinking it was something like this:  

cpau -u domain\user -p password123 -ex batchfilename.bat -enc  

but I think thats wrong..and do all files need to be in the same directory?  I have shortcuts in 'all users' profile under startup so that each user who logs on will get the script..

Thank you!
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

#SSL #TLS #Citrix #HTTPS #PKI #Compliance #Certificate #Encryption #StoreFront #Web Interface #Citrix XenApp
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now