Project

General

Profile

Common Tasks » History » Version 1

Luke Murphey, 04/02/2010 07:17 PM

1 1 Luke Murphey
h1. Common Tasks
2 1 Luke Murphey
3 1 Luke Murphey
h2. Adding Functions to the Script Environment
4 1 Luke Murphey
5 1 Luke Murphey
The environment used by scripts is populated in the _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).
6 1 Luke Murphey
7 1 Luke Murphey
<pre><code class="java">
8 1 Luke Murphey
Hashtable<String, String> temp = new Hashtable<String, String>();
9 1 Luke Murphey
				
10 1 Luke Murphey
temp.put("ThreatScript.Result", "net.lukemurphey.nsia.scan.Result");
11 1 Luke Murphey
temp.put("HTTP.URL", "java.net.URL");
12 1 Luke Murphey
temp.put("HTTP.TagNameFilter", "org.htmlparser.filters.TagNameFilter");
13 1 Luke Murphey
temp.put("ThreatScript.DataAnalysis", "net.lukemurphey.nsia.scan.ScriptSignatureUtils");
14 1 Luke Murphey
</pre>