Common Tasks » History » Version 2
Luke Murphey, 04/09/2010 12:36 AM
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 | 2 | Luke Murphey | The environment used by scripts is populated in the populateShortcuts() method in source:/trunk/src/net/lukemurphey/nsia/scan/ScriptClassLoader.java. 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> |