KFSensor

 

Example External Console Scripts

KFSensor includes a number of example scripts that implement simple services. These can be configured to run as external console applications using the Edit External Console App dialog box.

The scripts are located in the directory:
C:\Program Files\KeyFocus\KFSensor\files\scripts

Your own scripts can be located in any directory on the local hard drive.

The example scripts are written in PERL. In order to use these scripts you will need to install a copy of PERL.

The descriptions below contains the field values that need to be entered into the Edit External Console App dialog box.

Example 1 - Quote of the day - kfquoteoftheday.pl

This basic script emulates the Microsoft Quote of the day service. It chooses one of 11 quotes at random and sends the text to the visitor.

Note: It is important to include the quotes in the Argument field as PERL does not like a space in a path name.

Field Value
NameEx Quote
Default port17
Application IDQuote of the day
Application PathC:\Perl\bin\perl.exe
Arguments"C:\Program Files\KeyFocus\KFSensor\files\scripts\kfquoteoftheday.pl"
Working directoryC:\Program Files\KeyFocus\KFSensor\files
Exit code 

Example 2 - Echo - kfecho.pl

This script implements the echo service, which simple reads data from the socket and writes the same data back to the socket.

Note: This script will continue running until either the visitor closes the connection or KFSensor times out the connection.

Field Value
NameEx Echo
Default port7
Application IDEcho
Application PathC:\Perl\bin\perl.exe
Arguments"C:\Program Files\KeyFocus\KFSensor\files\scripts\kfecho.pl"
Working directoryC:\Program Files\KeyFocus\KFSensor\files
Exit code 

Example 1 - Test Script

This script is useful for debugging purposes only. It sends its command line arguments and environment variables to the visitor.

Note: The $ arguments will be substituted with their parameter values.

Field Value
NameEx Test Script
Default port3000
Log Response Size10240
Application IDTestScript
Application PathC:\Perl\bin\perl.exe
Arguments"C:\Program Files\KeyFocus\KFSensor\files\scripts\kftest.pl" $ipdst $dport $ipsrc $sport $appid $proto $domain test
Working directoryC:\Program Files\KeyFocus\KFSensor\files
Exit code 

Third party example

There are a number of scripts that emulate services that have been released as open source on the Internet.
Many of these have been written for the Honeyd system. Most of these scripts are compatible with KFSensor.

This example configuration is for a Unix shell script that emulates a POP3 server.

In order to run a shell script you will need to install CygWin, http://www.cygwin.com.

Field Value
NameEx POP3
Default port110
Log styleMixed
Application IDPOP3
Application PathC:\cygwin\bin\bash.exe
Arguments--login -c /home/scripts/pop3.sh $ipsvc $ipdst $sport $dport
Working directory 
Exit code 

Related Topics


KFSensor On-Line Manual Contents