CISCO防火墙自动配置、备份脚本

CISCO防火墙 自动部署、配置、备份等。适用PIX501、ASA5505、ASA5506系列等防火墙,备份或者自动化配置脚本如下,如何xshell和按键精灵结合。本人研究不深,日常维护还是可以办到的。

Dim mima
 Path = "D:\SW_bak\list06.txt" //防火墙地址列表
 text = Plugin.File.ReadFileEx(Path) 
 fg = split(text, "|") 
 count = UBound(fg)
 Delay 10020
 For i = 1 To count - 1
 LeftClick 1
 SayString "ssh pix@"

If Len(fg(i)) < 100 Then 
ip = Lib.算法.提取字串符中所有数字(fg(i))
//MsgBox shouji
//mima = Replace(fg(i), " "  & ip, "")
NArray = Split(fg(i), " ")


SayString NArray(0)
Delay 1000
SayString NArray(1)
Delay 1000

KeyPress "Enter", 1
Delay 10000
KeyPress "Enter", 1
Delay 10000
SayString "密码"
Delay 1000
KeyPress "Enter", 1
Delay 1000
SayString "enable"
Delay 1000
KeyPress "Enter", 1
Delay 1000
SayString "密码"
Delay 1000
KeyPress "Enter", 1
Delay 1000
SayString "conf t"
KeyPress "Enter", 1
Delay 1000
//命令开始
SayString "logging trap informational"
Delay 1000
KeyPress "Enter", 1

SayString "logging host inside 10.3.105.121"
Delay 1000
KeyPress "Enter", 1


SayString "logging trap 6"
Delay 1000
KeyPress "Enter", 1


SayString "logging timestamp"
Delay 1000
KeyPress "Enter", 1

SayString "wr"
Delay 1000
KeyPress "Enter", 1
Delay 10020
SayString "logout"
Delay 5000
KeyPress "Enter", 1

//sh pix@/MsgBox mima
//Call Plugin.Sys.SetCLB(mima)
Delay 5020
End If
 Next

其他操作命令就把saystring字符换成对应的命令就可以了。

代码没有注解,不过非常简单,一看就明白了,没有本人同意严禁转载。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章