DigitalDave99 Posted February 18, 2011 Share Posted February 18, 2011 Greetings all, I wrote the below script as a security measure to prevent users from going on the internet without first knowing the password, I wanted the password to be changeable by our commercial manager via another script and encrypted in a file. We are using firefox for our browser. The script has been compiled into a exe and has been named firefox.exe with the normal firefox logo the real firefox exe has had it's icon/name changed and is hidden. [The problem] The problem I am having is that when the users click on a url in a email, it executes and asks for the password but does not go to the website they clicked on. Have been looking and looking but so far have not found out how to get the url infomation to pass on. Any idea's fokes? Thanks Dave #Include "aes.au3" #include <file.au3> ; Part 1 - To save the password ;$PlainText = "True,Today" ;$Key = "yourkey" ;$Data = _AesEncrypt($Key, $PlainText) ;$File = FileOpen("X:\ie Policys\fox2.ini", 2) ;FileWrite($File, $Data) ;FileClose($File) ; Part 2 - To load the password $File = FileOpen("X:\ie Policys\fox2.ini", 16) $Data = FileRead($File) FileClose($File) $Key = "yourkey" $PlainText = _AesDecrypt($Key, $Data) ;ConsoleWrite($PlainText) ; Its a Binary encripted string we need to convert it then split the seprate values out with , seperating $StringDeEncripted = StringSplit(BinaryToString(_AesDecrypt($Key, $Data)), ",") $EnableUserPass=$StringDeEncripted[1] $Pass=$StringDeEncripted[2] Global $Pass = $StringDeEncripted[2] Global $EnableUserPass = $StringDeEncripted[1] $ES_PASSWORD = InputBox("Security Check", "Enter your password.", "", "*") $sLogPath = "x:\ie policys\firefox.log" If $EnableUserPass='True' Then If $ES_PASSWORD = $Pass or $ES_PASSWORD = 'word1' or $ES_PASSWORD = 'word2' or $ES_PASSWORD = 'word3' Then Run("C:\Program Files\Mozilla Firefox\uninstall.exe", "") _FileWriteLog($sLogPath,@ComputerName &" "&@UserName &" "& "Password Accepted") Else MsgBox(4096, "Error", "Wrong User Password Entered", 10) _FileWriteLog($sLogPath,@ComputerName &" "&@UserName &" "& "Password Wrong") EndIf Else If $ES_PASSWORD = 'word1' or $ES_PASSWORD = 'word2' Then Run("C:\Program Files\Mozilla Firefox\uninstall.exe", "") _FileWriteLog($sLogPath,@ComputerName &" "&@UserName &" "& "Admin Password Accepted") Else MsgBox(4096, "Error", "Wrong Admin Password Entered", 10) _FileWriteLog($sLogPath,@ComputerName &" "&@UserName &" "& "Password Wrong") EndIf EndIf Link to comment Share on other sites More sharing options...
hannes08 Posted February 18, 2011 Share Posted February 18, 2011 Hi DigitalDave99, to things - 1. Probably your emailclient tryes to call sth like "firefox.exe http://www.google.com" so you need to get the CmdLine parameter which has been passed to your Program. You can look it up in the helpfile. 2. Change the Run() part of your script so it calls the firefoxuninstall.exe (I assume that's the real firfox.exe) with the given parameter. Regards, Hannes Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler] Link to comment Share on other sites More sharing options...
John Posted February 18, 2011 Share Posted February 18, 2011 Run("C:\Program Files\Mozilla Firefox\uninstall.exe", "") Hannes123 is right. The above line does not contain a variable to pass the URL being opened. The default command line parameters, when compiled, is $CmdLineRaw for the entire string, or $CmdLine[#] for each argument of the command line separately. $CmdLine[0] contained the number of arguments, $CmdLine[1] for first arguement, etc. For your situation simply passing $CmdLineRaw is probably good enough, unless you want to strip some of Firefox's command line options. Run("C:\Program Files\Mozilla Firefox\uninstall.exe " & $CmdLineRaw, "") Link to comment Share on other sites More sharing options...
DigitalDave99 Posted February 18, 2011 Author Share Posted February 18, 2011 Oh, that was easier than expected, Thank you both Hannes123 and John $ComLine=$CmdLine[4] Run("C:\Program Files (x86)\Mozilla Firefox\uninstall.exe " & $ComLine,"") works like a charm. Hi DigitalDave99, to things - 1. Probably your emailclient tryes to call sth like "firefox.exe http://www.google.com" so you need to get the CmdLine parameter which has been passed to your Program. You can look it up in the helpfile. 2. Change the Run() part of your script so it calls the firefoxuninstall.exe (I assume that's the real firfox.exe) with the given parameter. Regards, Hannes Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now