Jump to content

Convert Batch (bat) into AutoIT (au3) and create EXECUTABLE


Go to solution Solved by utilizadortnt,

Recommended Posts

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 by utilizadortnt
Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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.
 
Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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 by utilizadortnt
Link to comment
Share on other sites

  • Solution

#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 by utilizadortnt
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...