utilizadortnt Posted July 28, 2013 Posted July 28, 2013 (edited) I have two batch files: map_drive.bat net use x: \\10.0.0.1\upload /user:utilizador password and putty.bat cd .. cd PuTTY putty.exe utilizador@10.0.0.1 -pw password I want to hide the passwords and create a executable from this batch files. Can someone please help me? Edited July 28, 2013 by utilizadortnt
Moderators Melba23 Posted July 28, 2013 Moderators Posted July 28, 2013 utilizadortnt,Welcome to the AutoIt forum. But you need to know immediately that AutoIt will not keep your passwords safe. Searching the forums will provide you with a lot more information in greater detail, but in brief: - Your plain language script is within the compiled .exe, but in compressed form. It is not immediately viewable with a hex editor, but is by no means secure as it is expanded in memory when the .exe is run.- Obfuscator (part of the full SciTE4AutoIt3 package) will obscure your script by changing variable and constant names (and a lot more!), which makes it harder to decompile but again does not render the .exe secure.So, compiling an AutoIt script will prevent quick snooping, but a determined, experienced hacker can relatively easily get your source - including passwords, specific filenames, etc - or the encryption routines you have used in your script to encrypt/decrypt them if they are stored in another file.Probably not what you wanted to hear, but best you are told straight away. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
utilizadortnt Posted July 28, 2013 Author Posted July 28, 2013 Thank you Melba23 ! I have read several posts and I realise that is a "mission impossible" to 100% secure passwords. I understand an experienced hacker can access that information but I want to protect my file from common users. I have run into this script to create the map_drive I need without exposing the password. #include <Process.au3> _RunDOS("net use x: /delete /yes > nul") _RunDOS("net use x: \\10.0.0.1\upload password /user:utilizador") MsgBox( 0, "Done", "Connected Server", 3) How can I protect it further with Obfuscator? I have also come accros this command: ShellExecute("putty.bat") But again, I don't want to have batch file with plain text passwords. I would prefer something like this: ShellExecute("putty.exe") Were the executable would contain the user and password. Can someone assist with this one please? Thanks in advance.
Moderators Melba23 Posted July 28, 2013 Moderators Posted July 28, 2013 utilizadortnt,To use Obfuscator just download the full SciTE4AutoIt3 package and install it. The <Help - SciTE Help> menu offers assistance for all the added goodies that you will find. As to using ShellExecute - look in the Help file and you will see how to add parameters to the command. The Help file should always be your first point of call when using AutoIt. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
utilizadortnt Posted July 28, 2013 Author Posted July 28, 2013 (edited) Thank you for your fast reply. I have tried this one ShellExecute('..\Putty\putty.exe', '"utilizador@10.0.0.1 -pw password"') But it still asks for the password. Can someone help me please? I have read the help file but am unable to proceed. Edited July 28, 2013 by utilizadortnt
Solution utilizadortnt Posted July 28, 2013 Author Solution Posted July 28, 2013 (edited) #include <Process.au3> _RunDOS("net use x: /delete /yes > nul") _RunDOS("net use x: \\10.0.0.1\upload password /user:utilizador") MsgBox( 0, "Done", "Connected Server", 3) $Execute = "..\putty\putty.exe" $Arguments = "utilizador@10.0.0.1 -pw password" ShellExecute ( $Execute, $Arguments) Edited July 28, 2013 by utilizadortnt
MarkRobbins Posted July 30, 2013 Posted July 30, 2013 I believe anything that uses shell execute can be hooked (and read) from within windows. So if you are trying to create a time-limited password key as an exe, this might be of concern to you.
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