Solved

VBscript to mask password when using Juniper nclauncher.exe

Posted on 2011-09-20
5
872 Views
Last Modified: 2012-05-12
Hi,

Im looking for a VBscript that masks password to be used with Junipers nclauncher.exe.
Till now I have a batch file that pickes up the user name, then the realm url etc. using nclauncher.exe.
The password is empty so user need to type it in, but the problem is thats in clear text and that is not good.
I was hoping to use a VBscript that promts the user to type the password, but masks it, then use it in the nclauncher.exe filed Password:

nclauncher [-url Url] [-u username] [-p password] [-r realm]

Hope this is possible or if there is an other solution even better?

fjebja
0
Comment
Question by:Bjarte Fjelland
  • 3
  • 2
5 Comments
 
LVL 65

Expert Comment

by:RobSampson
ID: 36570415
Hi, perhaps something like this would work?

Run it with
cscript RunNCLauncher.vbs

We could could make the more static parameters get passed as arguments to the script if you wanted to.

Regards,

Rob.
Set objPassword = CreateObject("ScriptPW.Password") 

WScript.StdOut.Write "Enter your URL: "
strURL = WScript.StdIn.ReadLine
WScript.StdOut.Write "Enter your username: "
strUsername = WScript.StdIn.ReadLine
WScript.StdOut.Write "Please enter your password: "
strPassword = objPassword.GetPassword() 
WScript.StdOut.Write "Enter your realm: "
strRealm = WScript.StdIn.ReadLine

strCommand = "nclauncher -url " strUrl & " -u " & strUsername & " -p " & strPassword & " -r " & strRealm
Set objShell = CreateObject("WScript.Shell")
objShell.Run strCommand, 1, False

Open in new window

0
 
LVL 1

Author Comment

by:Bjarte Fjelland
ID: 36576388
Hi Rob,

Great and thank you, thats what Im looking for.
I just added '&' after -url "
strCommand = "nclauncher -url " & strUrl & " -u " & strUsername & " -p " & strPassword & " -r " & strRealm

Is it possible to only use users password?
put the URL in the script, same with realm, fetch the username from windows.

Hope Im not asking to mutch?
0
 
LVL 65

Accepted Solution

by:
RobSampson earned 500 total points
ID: 36577275
OK, that's easy.  We just change the parameters at the top to be hardcoded instead of input boxes.

Rob.
Set objPassword = CreateObject("ScriptPW.Password") 
Set objNetwork = CreateObject("WScript.Network")

strURL = "http://10.0.0.1"
strUsername = objNetwork.UserName
WScript.StdOut.Write "Please enter your password: "
strPassword = objPassword.GetPassword() 
strRealm = "yourealm"

strCommand = "nclauncher -url " & strUrl & " -u " & strUsername & " -p " & strPassword & " -r " & strRealm
Set objShell = CreateObject("WScript.Shell")
objShell.Run strCommand, 1, False

Open in new window

0
 
LVL 1

Author Closing Comment

by:Bjarte Fjelland
ID: 36583158
Yes, thats it!
Thank you so much!
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 36583936
No problem.

Rob.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

For a while, I have wanted to connect my HTC Incredible to my corporate network to take advantage of the phone's powerful capabilities. I searched online and came up with varied answers from "it won't work" to super complicated statements that I did…
Secure VPN Connection terminated locally by the Client.  Reason 442: Failed to enable Virtual Adapter. If you receive this error on Windows 8 or Windows 8.1 while trying to connect with the Cisco VPN Client then the solution is a simple registry f…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now