Securecrt Login Script Example

I love SecureCRT by Van Dyke Software. I used it when I was running Windows as my main desktop, then used it when I was running Linux as my main desktop (for 8 years), and now for the past 4 years on my Mac. I love it to death.

Here are some of the features I am using and the tweaks I have done for my specific workflow.

When I am working with Cisco ASA, I want to be able to identify interface as it is something I refer to immediately. in a complex config, it is easy to lose it in the crowded output. You can, and I do, run the sh ip which gives you a brief information about the IP addresses assigned to the interfaces. But it does not give you description, security level etc.

Securecrt Login Script Example

Set-AutoLogon, Windows automatically login after reboot. RUNONCE AUTOLOGON Here is the PowerShell CmdLet that would enable AutoLogon next time when the server reboots.We could trigger a specific Script to execute after the server is back online after Auto Logon as optional. 2) Session Login: This feature will allow the user to log all the commands and outputs, this is helpful for later review or for training purposes. To enable logging: File - Log Session. A “Select Log File” window will pop-up, select the target directory, enter the filename and click Save. Here’s an example (from the ini file): S:”Keymap Name”=Custom S:”Keymap Filename”=C:crt scriptsPIX.key. Why use keyboard maps? Lets say your network has 100’s of routes and you more often than not only want to see a small range. In SecureCRT you can map a key (such as F6) to run a script. Create the script to type ‘show ip route.

Securecrt Script Examples Cisco

The way I like to view it is in a different color. In this case, I am using red.

Option Session Option Connection Logon Actions 창에서. Automate Logon 을 이용한 방법 ( 주로 이 방법 사용, Password Hide mode ) 2. Logon Script 를 이용하는 방법 ( Password 노출 우려가 있어서 아직은. ) 두번째 Logon Script 샘플 내용. My CCIE Blog: Check out the other parts of the video! Feel free to comment and enjoy watching!

Securecrt

Also, when I view the the IPSec Phase II, I like to look at encrypted and decrtypted packets. I change this color to two different shades of blue.

Securecrt Script Loop

Here are the steps:

Go to your Secure CRT. Select Options then Edit Default Session

Go to ‘Apperance’ and under Highligted Keywords, Choose Edit, now select a name and add a keyword you want to highlight and click add. Now you can use set color and edit to set your colors for each words.

Script

Button Bars

SecureCRT has a great button bar that allows you to choose application shortcuts, menu items, scripts etc by clicking a button.

Here is an example.

To enable this feature, go to view then choose button bar

Securecrt Login Script Example

Now you should see the button bar on the bottom which is the defualt location for the button bar. You can now right click on the button bar and choose ‘new button’

On the left, you will see ‘Function’. In this section you can choose from Menu Function, Scripts and other fucntionality although what I mostly use it Menu Function and Run Script.

Under Menu Function I have the following buttons created:

1. MENU_LOG_SESSION – With this button, I am able to click it and it will prompt me for the name and location for the log file. Once I select it, it starts to log ALL output from the screen. If I click it again, it toggles to off, meaning it will stop logging the session.

Securecrt script commands

2. MENU_COPY_PASTE – With this button, I am able to copy and paste whatever I have highlighted on the screen. Easier than right clicking and choosing Copy/Paste.

3. MENU_CLEAR_SCREEN_AND_SCROLL – This will clear the screen and clear the line buffer.

Additionally, I have scripts that run. These scripts will:

1. Add or remove a ‘no’ at the beginning of a highlighted command. Therefore anything you select that has a ‘no’ infront of it will be copied and pasted without the ‘no’ and if you choose a command on the device without a ‘no’ (e.g. ip route 0.0.0.0 0.0.0.0 1.1.1.1) the script will add a ‘no’ to it.

In addition to these features, I have added a space to allow me to select IP addresses and other text by using the space character as the delimiter. This allows me to double click and IP address and have it automatically add it to my clip board. You CAN enable the ‘Right Click Paste’ such as PuTTY, but I have that and it has bit me in the ass a few times already.

Attached to this post is a simple script which connects over either Telnet or SSH to a list of devices and resets the enable password, local password for the vty lines, and the console password. The script will login either with a username/password pair or with just a password. The script is setup to work with Cisco IOS devices, but customizing it for CatOS or some other vendor would not be difficult.

SecureCRT has a handy automation API which lets you build on the protocol support in it to automate tasks over the protocols it supports. As a Windows user, I don’t have things like Perl or an Expect shell readily available, but, I do have SecureCRT and VBScript. I wasn’t able to find much in the way of samples for this particular SecureCRT feature aside from the manufacturer’s webpage, so I thought I would share one I made.

There are a series of constants at the top of the file where the applicable credentials should be specified. The devices.txt path is set to c:scriptsdevices.txt. You can modify this to your liking.

The syntax for each line in the devices.txt is:

Hostname;IPOrFQDN;Protocol

Hostname isn’t actually used, but it’s there if you want to add logging or something like that.

Securecrt Python Script

Protocol can be Telnet, SSH1, or SSH2.

Securecrt Script Examples

The script and a sample devices.txt is attached in the zip below. The usual bit applies – it’s not my fault if something breaks. I’ve used this several times to mass change passwords and had it work every time, but I offer no guarantees. Enjoy.