Project

General

Profile

Common Tasks » History » Version 2

Version 1 (Luke Murphey, 04/02/2010 07:17 PM) → Version 2/4 (Luke Murphey, 04/09/2010 12:36 AM)

h1. Common Tasks

h2. Adding Functions to the Script Environment

The environment used by scripts is populated in the populateShortcuts() method in source:/trunk/src/net/lukemurphey/nsia/scan/ScriptClassLoader.java. _ScriptClassLoader.populateShortcuts()_ method. The populateShortcuts must be updated anytime changes are made to the namespaces used to populate the environment must (see below for an example).

<pre><code class="java">
Hashtable<String, String> temp = new Hashtable<String, String>();

temp.put("ThreatScript.Result", "net.lukemurphey.nsia.scan.Result");
temp.put("HTTP.URL", "java.net.URL");
temp.put("HTTP.TagNameFilter", "org.htmlparser.filters.TagNameFilter");
temp.put("ThreatScript.DataAnalysis", "net.lukemurphey.nsia.scan.ScriptSignatureUtils");
</pre>