Info Security Memo
  • Blog
  • Sitemap
    • Categories
  • Contact
  • About
  • Resources
  • Tools
  • 51sec.org

Build Confidence

Focusing on Information Security 

Info Security Notes

Using AutoIT to Create Launchers (SSMS SQL auth)

7/22/2021

0 Comments

 
Using AutoIT to Create Launchers (SSMS SQL auth)

AutoIT is basically a way of automating stuff in the windows GUI and has lots of uses. 

Here is an working launcher and example script for SSMS with SQL Authentication since ssms.exe >v.18.0 no longer supports command line arguments. All steps:

  • Install AUTO IT on to the RDS server

  • Create attached scrtipt and compile into an executable

  • Create security template and custom launcher to pass credentials and host information to the AutoIt script executable.


Install AutoIt

Install AutoIT on your user’s machines who will be using these launchers. If using session connector install on the RDS server: (https://ift.tt/3zn9sCG)

Download url : https://ift.tt/3zn9sCG



Create and Compile AutoIt Script

 Copy the attached script and open with SciTE (built in Auto IT script editor, convert to .au3)

 


Below is the example script to launch SSMS.exe and complete SQL Auth : 

;Thycotic ssms.exe with sql credential launcher script

;set filepath of ssms.exe
$Path = "C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\Ssms.exe"

;execute ssms.exe
ShellExecute($Path)

;Wait for the 'connect to server' window to appear
WinWaitActive("Connect to Server", "", 0)

;set auth mode to SQL authenticaiton
ControlSend("Connect to Server" , "" , "[NAME:comboBoxAuthentication]", "[NAME:SQL]")

;set server instance to servername passed from Secret Server launcher in cmd line parameter 1
ControlSetText("Connect to Server", "", "[NAME:serverInstance]", $CmdLine[1],1)

;set username to username passed from Secret Server launcher in cmd line parameter 2
ControlSetText("Connect to Server", "", "[NAME:userName]", $CmdLine[2],1)

;set password to password passed from Secret Server launcher in cmd line parameter 3
ControlSetText("Connect to Server", "", "[NAME:password]", $CmdLine[3],1)

;reactivate the connect to server window, required for the click of buttons within the window
WinActivate ("Connect to Server")

;click the connect button
ControlClick("Connect to Server", "", "[NAME:connect]")



Compile (go to Tools on toolbar and select Compile)



Save .exe to a location accessible to all users (c:\autoit in my case)


 

Create Launcher

Create a launcher with the following settings (note double quotes around variables):

 


 

Create a regular session connector launcher and use the above child launcher

Create a new secret template and pass servername, username and password.



via Blogger https://ift.tt/3BukjMR
July 22, 2021 at 09:31AM Thycotic
0 Comments



Leave a Reply.

    Categories

    All
    Architecture
    Blog
    Checkpoint
    Cisco
    Cloud
    CyberArk
    F5
    Fortigate
    Guardium
    Juniper
    Linux
    Network
    Others
    Palo Alto
    Qualys
    Raspberry Pi
    Security
    SIEM
    Software
    Vmware
    VPN
    Wireless

    Archives

    March 2024
    February 2024
    January 2024
    December 2023
    November 2023
    October 2023
    September 2023
    August 2023
    July 2023
    June 2023
    May 2023
    April 2023
    March 2023
    February 2023
    January 2023
    December 2022
    November 2022
    October 2022
    September 2022
    August 2022
    July 2022
    June 2022
    May 2022
    April 2022
    March 2022
    February 2022
    January 2022
    December 2021
    November 2021
    October 2021
    September 2021
    August 2021
    July 2021
    June 2021
    May 2021
    April 2021
    March 2021
    February 2021
    January 2021
    December 2020
    November 2020
    October 2020
    September 2020
    August 2020
    July 2020
    October 2019
    September 2019
    June 2019
    July 2018
    May 2018
    December 2017
    August 2017
    April 2017
    March 2017
    January 2017
    December 2016
    November 2016
    October 2016
    September 2016
    August 2016
    July 2016
    June 2016
    May 2016
    April 2016
    March 2016
    February 2016
    January 2016
    December 2015
    November 2015
    October 2015
    September 2015
    August 2015
    July 2015
    June 2015
    May 2015
    April 2015
    March 2015

    Print Page:

    RSS Feed

    Email Subscribe
Powered by Create your own unique website with customizable templates.
  • Blog
  • Sitemap
    • Categories
  • Contact
  • About
  • Resources
  • Tools
  • 51sec.org