AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Passwords in Exe Files?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Knowbodynow



Joined: 26 Jun 2007
Posts: 37

PostPosted: Fri Aug 08, 2008 8:39 am    Post subject: Passwords in Exe Files? Reply with quote

Hello, if I use runas in a script then I need to include my user account name and password. If I compile this into an exe file how secure is it? For example, would it be possible for the file to get hacked in some way if I inadvertantly hit a bad website while browsing? My apologies if this is a daft question. I just switched to using a Limited User Account on Windows XP. Currently I'm rightclicking and using Runas from explorer but I'd like to automate some tasks and want to avoid manually entering a password each time.

Thanks,

CaH
Back to top
View user's profile Send private message
BoBo²
Guest





PostPosted: Fri Aug 08, 2008 9:30 am    Post subject: Reply with quote

Let the exe read the pw from an restricted area? So an attack would have to be done during its transmission. Good enough?
Back to top
Knowbodynow



Joined: 26 Jun 2007
Posts: 37

PostPosted: Fri Aug 08, 2008 12:15 pm    Post subject: Reply with quote

Thanks for the reply - not sure I understand it! What I was thinking of doing was compiling an exe file containing my password. You seem to be suggesting accessing a file from a restricted area but what would that be C:\Program Files? Not sure how to create a restricted area or how to or why to pass a password to an exe file. What would i store the password in a text file. Sorry, I'm a complete beginner when it comes to this.

CaH
Back to top
View user's profile Send private message
Sivvy



Joined: 21 Jul 2008
Posts: 711
Location: Calgary, AB, Canada

PostPosted: Fri Aug 08, 2008 1:51 pm    Post subject: Reply with quote

First, search the forums for something called "Exe2Ahk". Your password is not safe in your exe.

Second, I think he means storing your password in something that has it's own password, or is hidden away. Problem is, you would need to have that extra info in your code, and if it's decompiled... Then people can go searching.

What I would really suggest is to have your program start with a single InputBox, that asks for your password. Enter your password once, and it saves to a variable for use everytime you need it. If you use this method, there is next to no chance for it to be put at risk. Win/Win. You only enter it once, it doesn't get found by others. Even if decompiled, the password only exists during "Run-Time", so they have no idea how to get at it.
Back to top
View user's profile Send private message MSN Messenger
Knowbodynow



Joined: 26 Jun 2007
Posts: 37

PostPosted: Fri Aug 08, 2008 2:38 pm    Post subject: Reply with quote

Thanks for the reply. I'll check out Exe2Ahk. This is an example of what I'm using at the moment. I amended something I found in the forum:

Code:
Loop
{
  InputBox,pw,Password,,Hide,150,100
  If ErrorLevel
    Exit

  User=Myname ; or User=%A_UserName% or User=Mike
  GoSub,PassCheck
 
}


PassCheck:
  RunAs,%User%,%pw%
  RunWait,hh.exe,,UseErrorLevel
  RunAs
  If ErrorLevel=ERROR
    msgbox Password incorrect
  Else
  {
    RunAs, %User%,%pw%
   runwait devcon disable PCI\VEN_10EC, , hide
   RunAs
   Exit
   }
Return

How would I store the password variable for future use?

Thanks again,

CaH
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6847
Location: Pacific Northwest, US

PostPosted: Fri Aug 08, 2008 4:41 pm    Post subject: Reply with quote

if you compile the exe with a password and a /nodecompile option, the password is pretty safe. There is no way to completely block the source code being read, but that will stop the casual browser.
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
Knowbodynow



Joined: 26 Jun 2007
Posts: 37

PostPosted: Fri Aug 08, 2008 9:37 pm    Post subject: Reply with quote

Hi, how do I do that. Looking at the Ahk2Exe that I have there seems to be one box for entering a password or typing N/A. How do I do both?

CaH
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6847
Location: Pacific Northwest, US

PostPosted: Sat Aug 09, 2008 4:37 am    Post subject: Reply with quote

there are a few scripts in the S&F subforum for "Those who Compile" that give you full options without using the command line to compile.
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group