?
Solved

How to read a efs enabled text file

Posted on 2008-02-12
10
Medium Priority
?
349 Views
Last Modified: 2012-08-14
Hi,

I have a requirement where i will store a password in a text file and enable EFS on the file using a domain account A. Now i have a perl script which will read the encryped text file to get the password and set the service account password on remote machines. Issue is that same domain account A is not able to read the file through the script functions but could open directly from the windows explorer.

Is there a way to read the contents of the encrypted text file using the same domain account with which its encrypted? This script is a bit critical for our product release but couldn't find a way to proceed.

Thanks
0
Comment
Question by:deshaw
  • 5
  • 3
  • 2
10 Comments
 
LVL 27

Expert Comment

by:Tolomir
ID: 20874521
Did you check if that perl script runs as that particular user (i.e. with his credentials)

0
 
LVL 1

Author Comment

by:deshaw
ID: 20874698
Hi,

Thanks for the response. Yes its running using same user. I encrypted the file using my login running the script using my login itself.

Thanks
0
 
LVL 27

Expert Comment

by:Tolomir
ID: 20874776
You could test if you set the permissions just for that account disable all others like System, Administrators and such for that single textfile - then disable EFS for that file - run that script.

When everything runs proper you should get your password. -> Then it's really an EFS issue.

0
KuppingerCole Reviews AlgoSec in Executive Report

Leading analyst firm, KuppingerCole reviews AlgoSec's Security Policy Management Solution, and the security challenges faced by companies today in their Executive View report.

 
LVL 39

Expert Comment

by:Adam314
ID: 20875430
What happens when the perl script tries to read the file?  Does it fail on the open statement?  What is the error ($!)?  Does it fail on the read?
0
 
LVL 1

Author Comment

by:deshaw
ID: 20876213
I verified using NTFS permissions and its works fine but as soon as i enabled EFS on the text file it starts throwing error in my script.

My script fails with message can't open the file c:\local\...txt

Thanks
0
 
LVL 39

Expert Comment

by:Adam314
ID: 20876236
You don't get a reason it can't open the file?  Are you printing $!?

Something like this:

open(IN, "<", $file) or die "Could not open file $file because $!\n";

Open in new window

0
 
LVL 1

Author Comment

by:deshaw
ID: 20876499
I get below message when i try to open the file.

INFO:  can't read c:\local\passwd\passwd.txt

readline() on closed filehandle FILE at C:\local\set-service.pl line 268
0
 
LVL 39

Expert Comment

by:Adam314
ID: 20876711
It sounds like the open failed, but didn't display an error message.
Can you post the set-service.pl file - or at least the relavant portions?
0
 
LVL 1

Author Comment

by:deshaw
ID: 20876742
Good news is that EFS perl module is helping to achieve this. Will let you know the details once it works.
0
 
LVL 1

Accepted Solution

by:
deshaw earned 0 total points
ID: 20900143
hmm...we could actually read the files normally. When we logged this request, we were trying to open the file in a Runas window which was failing to open the files. Normally its opening.

Sorry for the trouble.

0

Featured Post

Will You Be GDPR Compliant by 5/28/2018?

GDPR? That's a regulation for the European Union. But, if you collect data from customers or employees within the EU, then you need to know about GDPR and make sure your organization is compliant by May 2018. Check out our preparation checklist to make sure you're on track today!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Native ability to set a user account password via AD GPO was removed because the passwords can be easily decrypted by any authenticated user in the domain. Microsoft recommends LAPS as a replacement and I have written an article that does something …
The onset of year 2018 has been a usual business for IT teams still struggling to find their way out in terms of strengthening their cloud security.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

589 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