GFI LANguard 9 Scripting Manual, Documentation


Home
GFI LANguard 9 Scripting Manual Prev Page Prev Page
 
Introduction
Scripting Editor/Debugger
Important standards to follow
Native Vbscript Functions supported in GFI LANguard
Common mistakes and pitfalls.
Tips & Tricks
Developing a script in the GFI LANguard debugger
Adding a new scripting based vulnerability check to the scanner tool.
Functions List
Old -> New Function Mapping
Object Documentation
Socket Object:
SNMP Object:
File Object:
Registry Object:
HTTPObject
HTTPHeaders Object
FTP Object
Encode Object:
General Functions
List of functions
Using ActiveX, COM and OLE Automation components
Introduction to using automation objects
Using Libraries and code reusability
Creating libraries
Using libraries

PreviousNext

General Functions

List of functions

Echo

Echo is a simple function that displays output

Syntax

Echo (String)

Returns

No data returned.

Example
`This example displays the word Test
Function Main
echo "test"
End Function

WriteToLog

Writetolog will write any string passed to it, in the scripting engine log file

Syntax

WriteToLog(String)

Returns

No data returned.

Example
Function Main
WritetoLog "test"
End Function

StatusBar

StatusBar is used to display a string in the status bar of the current active component

Syntax

StatusBar(String)

Returns

No data returned.

Example
Function Main
StatusBar "test"
End Function

AddListItem

AddListItem is a function which allows scripts to return feedback to the user. This function will add any string passed to it as a sub node of the triggered vulnerability. The AddListItem function takes 2 different parameters. The first parameter specifies the parent node and the second parameter, the string to be added to the tree. If the parent node is left empty, the function will add the specified string to the top available node (the vulnerability parent node). The tree can only have 1 level though even though it can have as many siblings as required.

Syntax

AddListItem(String,String)

Returns

N/A

Example

Function MAIN
Dim wmi As Object
Dim objset As Object
Dim obj As Object
Dim monitor As Object
Dim prop As Object
Set wmi = GetObject("winmgmts:\\127.0.0.1\root\cimv2")
Set objset = wmi.instancesof("Win32_service")
For Each obj In objset
Set monitor = obj
For Each prop In monitor.properties_
If VarType(prop.value) = 8 Then
If Not (IsNull(prop.value)) Then
If prop.name = "Name" Then
if left(prop.value,1) = "a" then
AddListItem("A",prop.value)
end if
if left(prop.value,1) = "b" then
AddListItem("B",prop.value)
end if
if left(prop.value,1) = "c" then
AddListItem("C",prop.value)
end if
End If
End If
End If
Next
Next
main = true
End Function

SetDescription

SetDescription is used to return simple feedback to the user by means of programmatically changing the vulnerability description to indicate a more detailed reason for the vulnerability trigger. SetDescription takes only one parameter. The string passed to the function will be set as the new description for the vulnerability once it is triggered.

Syntax

SetDescription(String)

Returns

N/A

Example

Function Main
SetDescription ("This New description will be set in place of the one specified in the vulnerability")
Main=true
End Function

PreviousNext