Skip to content

Commit a68e7bd

Browse files
committed
2 parents a78863a + 0e104a8 commit a68e7bd

File tree

179 files changed

+192596
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

179 files changed

+192596
-0
lines changed

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/debug.log
2+
/StixViz.exe
3+
/StixViz.nw
4+
/StixVizDistro.zipx
5+
/StixVizDistro.zip
6+
/build
7+
/.project
8+
<<<<<<< HEAD
9+
/examples
10+
/bin
11+
./src/nodejs/public/TempData
12+
.DS_Store
13+
=======
14+
./src/nodejs/public/TempData
15+
>>>>>>> 1fcde9010dc3bfce41557671281f4adf6eef3ea9

LICENSE.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Copyright (c) 2015, The MITRE Corporation
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions are met:
6+
* Redistributions of source code must retain the above copyright
7+
notice, this list of conditions and the following disclaimer.
8+
* Redistributions in binary form must reproduce the above copyright
9+
notice, this list of conditions and the following disclaimer in the
10+
documentation and/or other materials provided with the distribution.
11+
* Neither the name of The MITRE Corporation nor the
12+
names of its contributors may be used to endorse or promote products
13+
derived from this software without specific prior written permission.
14+
15+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
19+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README

Lines changed: 261 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,261 @@
1+
****************************************************
2+
3+
STIX Viz v1alpha5
4+
5+
Copyright (c) 2014 - The MITRE Corporation
6+
All rights reserved. See LICENSE.txt for complete terms.
7+
8+
****************************************************
9+
10+
BY USING THE STIX VIZ APPLICATION, YOU SIGNIFY YOUR ACCEPTANCE OF THE
11+
TERMS AND CONDITIONS OF USE. IF YOU DO NOT AGREE TO THESE TERMS, DO NOT USE
12+
THE STIX VIZ APPLICATION.
13+
14+
For more information, please refer to the terms.txt file.
15+
16+
#################################################################
17+
StixViz v1.0 alpha5
18+
Compatible with STIX v1.0.1
19+
20+
This is a proof of concept prototype to visualize a set of STIX documents
21+
as a node-link tree with the root at the top of the XML structure.
22+
23+
StixViz is implemented in Javascript as a standalone application using the node-webkit
24+
application runtime which is based on the Chromium rendering engine and node.js.
25+
26+
27+
To use STIXViz, first select a set of related XML files using the
28+
'Choose Files' menu.
29+
30+
STIXViz v1.0a5 includes three different views of STIX documents: Graph View,
31+
Tree View and Timeline View. These views show the same information using different layouts.
32+
To switch between views, use the drop-down menu at the top of the
33+
window. On startup, the default view is Graph View.
34+
35+
36+
Graph View
37+
38+
Graph View displays the same entities as tree view, but in a fully connected
39+
graph layout. The graph view uses a force-directed graph layout in order to
40+
dynamically position the nodes. Nodes may be dragged into a new position,
41+
in which case the layout will dynamically reconfigure itself.
42+
43+
Nodes in the Graph View are expandable. The display begins with all but the top two
44+
levels collapsed. To view the underlying structure of a node, single-click on the node
45+
and it will expand. Single-click again and the node will collapse. Leaf nodes
46+
are nodes with no children, and are represented by a washed-out color scheme and
47+
no dark border.
48+
49+
By default, the graph includes "Grouping" nodes which are a parent of all nodes of the same
50+
type. To remove these grouping nodes and see just the entity nodes in the graph, click
51+
the "Ungroup" button in the menu bar.
52+
53+
Hovering over a node in graph view highlights the links with other nodes. In-links
54+
are shown in blue and out-links in green.
55+
56+
Nodes may be fixed in position using the right-button context menu on each
57+
node. If a node is fixed, it may be dragged to a new position and it will stay
58+
where it was placed. Nodes may be un-fixed again using the context menu.
59+
60+
Nodes and links may be filtered using the Filter menu on the left of the screen. Uncheck
61+
checkbox next to a node type to hide all nodes of that type. Click the plus sign next
62+
to a node type to see a list of all link types associated with that node type. Filter
63+
links using the checkboxes next to the link types.
64+
65+
Nodes may also be hidden using the context menu. To re-display a hidden node,
66+
click on its parent node.
67+
68+
69+
70+
Tree View
71+
72+
STIXViz Tree View displays a tree containing nodes for top
73+
level STIX entities: campaign, course of action, exploit target,
74+
incident, indicator, observable, threat actor, and TTP. When the tree
75+
first displays, there is a top level node shown for each component type
76+
included in the xml files processed. Nodes with a black and white
77+
border can be expanded with a single click.
78+
79+
Each category of top level "items" is turned into a node in the tree.
80+
The nodes themselves are expandable to show the structure of the relationships
81+
between entities.
82+
83+
A down arrow on a link indicates that the child node is specified as
84+
part of the parent node's XML. For instance, a campaign will contain
85+
links with down arrows to indicator nodes specified by
86+
campaign:Related_Indicators.
87+
88+
An up arrow indicates that the parent node is specified via an idRef
89+
attribute in the child node. For instance, a threat actor will contain
90+
links to it from incident nodes that specify it under
91+
incident:Threat_Actors.
92+
93+
Long node names are truncated in the tree view. Mousing over a named
94+
node will display the node's id if it has one, as well as the full
95+
version of the text used as it's name.
96+
97+
A double click on a node will cause it to become the root node of the
98+
tree, hiding other branches from view. Double click on the root node
99+
again to walk back up the tree.
100+
101+
102+
103+
Timeline View:
104+
105+
The timeline view shows timestamped entities within a STIX document, such as
106+
incidents and their associated activities. Events that occur at a single point
107+
in time are represented by a dot, and events that occur over a period of time (with a
108+
start and end time) are represented by a horizontal bar. Different types of
109+
events are displayed with different colors, as denoted by the legend at the
110+
upper right of the timeline view.
111+
112+
The timeline can be zoomed and scrolled. When a new STIX file is loaded, it will
113+
initially display the full extent of the time period represented in the file. To zoom in on
114+
a specific period of time within the file, you can click and drag on the Overview bar
115+
below the main timeline display. When a region of time in the overview bar is selected,
116+
the main timeline will zoom in on that region of time. You can then scroll the selected
117+
area within the overview bar and the main display will scroll to show the corresponding
118+
time interval.
119+
120+
121+
122+
HTML Transform
123+
124+
The 'Show HTML' menu at the top of the page can be used to display an
125+
XSLT transformed file at the bottom of the STIXViz window. In both Tree View and
126+
Graph View, nodes that have an id specified in the XML file can be displayed
127+
in the HTML view as well. To do this, click right on the node and select 'Show HTML'.
128+
129+
130+
131+
This is a work in progress. Feedback is most welcome!
132+
133+
requirements:
134+
- node webkit framework including mime module from node.js (currently tested with node-webkit v0.9.2)
135+
- node.js (currently tested with version 0.10.13)
136+
- bootstrap.js (v3.0)
137+
- d3.js (v3)
138+
- jquery and jquery-ui (tested with jquery 1.10.2)
139+
- Stix HTML package (tested with v1beta4)
140+
- one or more STIX 1.0 input xml documents
141+
- Java 1.7 executable for XSLT transforms
142+
- Java Gson package (tested with 2.2.4)
143+
- Saxon HE (tested with version 9.5.3)
144+
145+
v1.0alpha5
146+
2014-06-13
147+
148+
STIX - http://stix.mitre.org
149+
#################################################################
150+
--------------------------------------------------------------------------------
151+
--Included Files----------------------------------------------------------------
152+
153+
README: this file.
154+
LICENSE.txt
155+
-src
156+
-nodejs: Runnable NodeJS package
157+
index.html: The main html page for the application
158+
package.json: node-webkit config file for the StixViz app
159+
java.exe: Java executable needed for xslt STIX to HTML transform
160+
-public
161+
-js
162+
StixViz.js: Top level StixViz app
163+
JavaRpcClient.js: Remote connection to Java processing of XML transform
164+
STIXJsonGeneration.js:Manages conversion of STIX files into JSON
165+
STIXRelationshipJson.js: Transforms STIX XML into JSON data structure for tree layout
166+
STIXTTPProcessing.js: Converts TTP structure to JSON
167+
STIXNameResolver.js: Determine node names
168+
STIXRelationshipTree.js: Displays the tree structure
169+
STIXRelationshipGraph.js: Displays the graph structure
170+
STIXTTPProcessing.js: Process TTPs into Json
171+
STIXXSLTTransformer.js: Converts XML to HTML
172+
STIXUtilities.js: Utilities for XML to JSON conversion
173+
STIXRelationshipTimeline.js: Displays the Timeline view
174+
STIXTimelineJson.js: converts STIX to JSON Format for timeline
175+
-bootstrap
176+
bootstrap.min.js
177+
-d3
178+
d3.v3.js
179+
-jquery
180+
jquery-1.10.2.min.js
181+
-jquery-ui
182+
jquery-ui-1.10.3.custom.min.js
183+
jquery.ui.draggable.js
184+
-plugin
185+
jquery.layout-latest.min.js
186+
-xslt
187+
-images
188+
directory of icon images
189+
cybox_common.xsl
190+
icons.xsl
191+
normalize.xsl
192+
stix_common.xsl
193+
stix_to_html.xsl
194+
common.js
195+
wgxpath.install.js
196+
common.css
197+
theme_default.css
198+
199+
-css
200+
stixLayout.css: common styles used by all views
201+
treeLayout.css: Stylesheet for tree display
202+
graphLayout.css: Stylesheet for graph view
203+
timeline.css: Stylesheet for timeline view
204+
-bootstrap
205+
bootstrap.min.css
206+
-jquery-ui
207+
jquery-ui-1.10.3.custom.min.css
208+
-plugin
209+
layout-default.css
210+
-node_modules
211+
mime
212+
node.js mime package contents
213+
-dist
214+
NodeRpc.jar: java package for handling remote procedure calls to perform XSLT transform
215+
-java
216+
Source code for the Java RPC library to respond to requests for XSLT transform. The executable jar file
217+
containing this code is included in the "dist" directory of the nodejs package.
218+
219+
--------------------------------------------------------------------------------
220+
--Usage Notes-------------------------------------------------------------------
221+
222+
Building:
223+
The StixViz app depends on the node.js "mime" module which is available from the npm package management system.
224+
The mime module is already included in the node_modules directory of this package. To
225+
reinstall the mime module, be sure you have node.js installed, then cd to the root directory of the StixViz app
226+
and execute the command:
227+
> npm install mime
228+
229+
To run the StixViz app using node-webkit, execute the following command:
230+
231+
> nw.exe {path to StixViz main directory}
232+
233+
To package the StixViz app to run standalone perform the following steps on Windows:
234+
235+
1. Create a zip file (NOT zipx) containing index.html, package.json, the public directory and the node_modules directory
236+
2. Name the zip file StixViz.nw
237+
3. At the command prompt run
238+
> copy /b nw.exe+StixViz.nw StixViz.exe
239+
This will create an executable StixViz.exe
240+
4. The executable requires the following files that come with the node-webkit distribution to be on the path:
241+
nw.pak
242+
icudt.dll
243+
ffmpegsumo.dll
244+
libEGL.dll
245+
libGLESv2.dll
246+
247+
On other platforms follow the instructions from https://github.com/rogerwang/node-webkit/wiki/How-to-package-and-distribute-your-apps
248+
249+
-- Runnning from Binary Executable --
250+
251+
A pre-packaged Java 7 executable is available from the GitHub release page at
252+
https://github.com/STIXProject/stix-viz/releases/download/v1.0.5a/StixVizDistro_Windows_java7.zip
253+
254+
A pre-packaged Java 8 executable is available from the GitHub release page at
255+
https://github.com/STIXProject/stix-viz/releases/download/v1.0.5a/StixVizDistro_Windows_Java8.zip
256+
257+
To run the pre-packaged Windows executable, extract all of the files included in the zip file into a directory and double click the file StixViz.exe.
258+
259+
A pre-packaged Mac OSX executable can be downloaded from https://github.com/STIXProject/stix-viz/releases/download/v1.0.5a/StixViz_Mac.zip.
260+
Extract StixViz.app from the zip file.
261+

lib/gson-2.2.4.jar

186 KB
Binary file not shown.

lib/hamcrest-core-1.3.jar

44 KB
Binary file not shown.

lib/junit-4.11.jar

239 KB
Binary file not shown.

lib/saxon9he.jar

9.89 MB
Binary file not shown.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Copyright (c) 2015 – The MITRE Corporation
3+
* All rights reserved. See LICENSE.txt for complete terms.
4+
*
5+
* A client that talks with a Java program which is emitting a simple JSON based
6+
* RPC protocol.
7+
*
8+
* Adapted from https://github.com/bspotswood/java-gson-rpc-example
9+
*
10+
* created 2013
11+
* gertner@mitre.org
12+
* lubar@mitre.org
13+
*
14+
*/
15+
16+
package org.mitre.node_rpc;
17+
18+
import com.google.gson.Gson;
19+
20+
/**
21+
* The Message class is an abstract base class to help with both request
22+
* and response message classes.
23+
*/
24+
public abstract class Message {
25+
/**
26+
* The messageName is used to determine the type of request or response.
27+
* It is a critical piece of information for the client and server to
28+
* distinguish the messages they are receiving from each other.
29+
*/
30+
private String messageName = super.getClass().getSimpleName();
31+
32+
/**
33+
* The instance of Gson used for encoding and decoding messages
34+
* between JSON and Message objects.
35+
* Special note: fields marked 'transient' will not be serialized by gson
36+
*/
37+
protected transient static Gson _gson = new Gson();
38+
39+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*
2+
* Copyright (c) 2015 – The MITRE Corporation
3+
* All rights reserved. See LICENSE.txt for complete terms.
4+
*
5+
* A client that talks with a Java program which is emitting a simple JSON based
6+
* RPC protocol.
7+
*
8+
* The node.js script sends a JSON encoded request object that is converted into a
9+
* RequestMessage object. The RequestMessage processes the request and returns
10+
* any number of ResponseMessage objects, as necessary, to fulfill the request.
11+
*
12+
* Uses the Google Gson library to convert between JSON objects and native Java objects.
13+
*
14+
* Adapted from https://github.com/bspotswood/java-gson-rpc-example
15+
*
16+
* created 2013
17+
* gertner@mitre.org
18+
* lubar@mitre.org
19+
*
20+
*/
21+
22+
package org.mitre.node_rpc;
23+
24+
import org.mitre.node_rpc.requests.Goodbye;
25+
import org.mitre.node_rpc.responses.Hello;
26+
27+
import java.io.IOException;
28+
29+
30+
public class NodeRpc {
31+
32+
public static final String APP_VERSION = "0.1";
33+
34+
public static void main(String[] args) throws IOException {
35+
NodeRpc instance = new NodeRpc();
36+
37+
instance.run();
38+
}
39+
40+
private void run() throws IOException {
41+
// When started, we automatically send out a Hello message
42+
(new Hello()).send();
43+
44+
// Now pump messages until we receive a Goodbye
45+
RequestMessage message;
46+
while ((message = RequestMessage.fetchRequest()) != null) {
47+
if (message instanceof Goodbye) {
48+
return;
49+
}
50+
51+
message.process();
52+
}
53+
}
54+
}

0 commit comments

Comments
 (0)