├── snapshoot
└── snapshoot.jpg
├── src
├── fonts
│ ├── stix-icons.eot
│ ├── stix-icons.ttf
│ ├── stix-icons.woff
│ └── stix-icons.svg
├── index.html
├── main.css
├── dot-snippets.js
├── RouteMap.js
├── index.js
└── stix-icon.font.js
├── docs
├── index.html
└── main.js.LICENSE.txt
├── webpack.config.js
├── package.json
├── .gitignore
├── README.md
└── LICENSE
/snapshoot/snapshoot.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JDArmy/RouteMap/HEAD/snapshoot/snapshoot.jpg
--------------------------------------------------------------------------------
/src/fonts/stix-icons.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JDArmy/RouteMap/HEAD/src/fonts/stix-icons.eot
--------------------------------------------------------------------------------
/src/fonts/stix-icons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JDArmy/RouteMap/HEAD/src/fonts/stix-icons.ttf
--------------------------------------------------------------------------------
/src/fonts/stix-icons.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JDArmy/RouteMap/HEAD/src/fonts/stix-icons.woff
--------------------------------------------------------------------------------
/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Red Teaming Route Map
5 |
6 |
7 |
8 |
9 |
10 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/docs/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Red Teaming Route Map
5 |
6 |
7 |
8 |
9 |
10 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/main.css:
--------------------------------------------------------------------------------
1 | body,
2 | html {
3 | width: 100%;
4 | height: 100%;
5 | padding: 0;
6 | margin: 0;
7 | }
8 |
9 | #contents {
10 | width: 100%;
11 | height: 98vh;
12 | margin: 0;
13 | padding: 5px;
14 | box-sizing: border-box;
15 | position: relative;
16 | clear: both;
17 | }
18 |
19 | #operate {
20 | padding: 5px;
21 | }
22 |
23 | #left,
24 | #right {
25 | position: absolute;
26 | width: 50%;
27 | height: 100%;
28 | margin: 0;
29 | padding: 5px;
30 | box-sizing: border-box;
31 | display: inline-block;
32 | }
33 |
34 | #left {
35 | top: 0;
36 | left: 0;
37 | }
38 |
39 | #right {
40 | top: 0;
41 | right: 0;
42 | }
43 |
44 | #aceEditorPane,#canvasPane {
45 | width: 100%;
46 | height: 100%;
47 | border: 1px solid #d3d3d3;
48 | box-sizing: border-box;
49 | }
50 |
51 | #canvasPane {
52 | margin: 0.7em 0px;
53 | }
54 |
55 | #error {
56 | padding: 5px;
57 | }
--------------------------------------------------------------------------------
/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require("path");
2 | const CopyPlugin = require("copy-webpack-plugin");
3 |
4 | module.exports = {
5 | mode: "development",
6 | entry: {
7 | index: "./src/index.js",
8 | },
9 | devtool: "inline-source-map",
10 | devServer: {
11 | static: "./src",
12 | compress: true,
13 | port: 9000,
14 | },
15 | output: {
16 | filename: "main.js",
17 | path: path.resolve(__dirname, "docs"),
18 | clean: false,
19 | },
20 | resolve: {
21 | fallback: {},
22 | },
23 | module: {
24 | rules: [
25 | {
26 | test: /\.css$/,
27 | use: ["style-loader", "css-loader"],
28 | },
29 | ],
30 | },
31 | plugins: [
32 | new CopyPlugin({
33 | patterns: [
34 | {
35 | from: path.resolve(__dirname, "src/index.html"),
36 | to: path.resolve(__dirname, "docs/index.html"),
37 | },
38 | ],
39 | }),
40 | ],
41 | };
42 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "routemap",
3 | "version": "1.0.0",
4 | "description": "Red Teaming Assessment Scoring System",
5 | "private": true,
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1",
8 | "build": "webpack",
9 | "dev": "webpack-dev-server --progress"
10 | },
11 | "keywords": [],
12 | "author": "Monyer",
13 | "license": "Apache-2.0",
14 | "main": "webpack.config.js",
15 | "repository": {
16 | "type": "git",
17 | "url": "git+https://github.com/RouteMap/RTASS.git"
18 | },
19 | "bugs": {
20 | "url": "https://github.com/RouteMap/RTASS/issues"
21 | },
22 | "homepage": "https://github.com/RouteMap/RTASS#readme",
23 | "devDependencies": {
24 | "acorn": "^8.5.0",
25 | "arraybuffer-loader": "^1.0.8",
26 | "copy-webpack-plugin": "^9.1.0",
27 | "css-loader": "^6.5.1",
28 | "style-loader": "^3.3.1",
29 | "uuid": "^8.3.2",
30 | "webpack": "^5.76.0",
31 | "webpack-cli": "^4.9.1",
32 | "webpack-dev-server": "^4.15.1"
33 | },
34 | "dependencies": {
35 | "ace-builds": "^1.4.13",
36 | "vis-network": "^9.1.0",
37 | "vue": "^2.6.14"
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/dot-snippets.js:
--------------------------------------------------------------------------------
1 | ace.define(
2 | "ace/snippets/dot",
3 | ["require", "exports", "module"],
4 | function (require, exports, module) {
5 | "use strict";
6 |
7 | exports.snippetText =
8 | '\n\
9 | snippet zupfnoter.print\n\
10 | %%%%hn.print {"startpos": ${1:pos_y}, "t":"${2:title}", "v":[${3:voices}], "s":[[${4:syncvoices}1,2]], "f":[${5:flowlines}], "sf":[${6:subflowlines}], "j":[${7:jumplines}]}\n\
11 | \n\
12 | snippet zupfnoter.note\n\
13 | %%%%hn.note {"pos": [${1:pos_x},${2:pos_y}], "text": "${3:text}", "style": "${4:style}"}\n\
14 | \n\
15 | snippet zupfnoter.annotation\n\
16 | %%%%hn.annotation {"id": "${1:id}", "pos": [${2:pos}], "text": "${3:text}"}\n\
17 | \n\
18 | snippet zupfnoter.lyrics\n\
19 | %%%%hn.lyrics {"pos": [${1:x_pos},${2:y_pos}]}\n\
20 | \n\
21 | snippet zupfnoter.legend\n\
22 | %%%%hn.legend {"pos": [${1:x_pos},${2:y_pos}]}\n\
23 | \n\
24 | \n\
25 | \n\
26 | snippet zupfnoter.target\n\
27 | "^:${1:target}"\n\
28 | \n\
29 | snippet zupfnoter.goto\n\
30 | "^@${1:target}@${2:distance}"\n\
31 | \n\
32 | snippet zupfnoter.annotationref\n\
33 | "^#${1:target}"\n\
34 | \n\
35 | snippet zupfnoter.annotation\n\
36 | "^!${1:text}@${2:x_offset},${3:y_offset}"\n\
37 | \n\
38 | \n\
39 | ';
40 | exports.scope = "dot";
41 | }
42 | );
43 | (function () {
44 | ace.require(["ace/snippets/dot"], function (m) {
45 | if (typeof module == "object" && typeof exports == "object" && module) {
46 | module.exports = m;
47 | }
48 | });
49 | })();
50 |
--------------------------------------------------------------------------------
/docs/main.js.LICENSE.txt:
--------------------------------------------------------------------------------
1 | /*!
2 | * Vue.js v2.6.14
3 | * (c) 2014-2021 Evan You
4 | * Released under the MIT License.
5 | */
6 |
7 | /*! *****************************************************************************
8 | Copyright (c) Microsoft Corporation.
9 |
10 | Permission to use, copy, modify, and/or distribute this software for any
11 | purpose with or without fee is hereby granted.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15 | AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17 | LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18 | OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 | PERFORMANCE OF THIS SOFTWARE.
20 | ***************************************************************************** */
21 |
22 | /*! Hammer.JS - v2.0.17-rc - 2019-12-16
23 | * http://naver.github.io/egjs
24 | *
25 | * Forked By Naver egjs
26 | * Copyright (c) hammerjs
27 | * Licensed under the MIT license */
28 |
29 | /**
30 | * vis-network
31 | * https://visjs.github.io/vis-network/
32 | *
33 | * A dynamic, browser-based visualization library.
34 | *
35 | * @version 9.1.0
36 | * @date 2021-08-29T08:43:14.666Z
37 | *
38 | * @copyright (c) 2011-2017 Almende B.V, http://almende.com
39 | * @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs
40 | *
41 | * @license
42 | * vis.js is dual licensed under both
43 | *
44 | * 1. The Apache 2.0 License
45 | * http://www.apache.org/licenses/LICENSE-2.0
46 | *
47 | * and
48 | *
49 | * 2. The MIT License
50 | * http://opensource.org/licenses/MIT
51 | *
52 | * vis.js may be distributed under either license.
53 | */
54 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | lerna-debug.log*
8 |
9 | # Diagnostic reports (https://nodejs.org/api/report.html)
10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11 |
12 | # Runtime data
13 | pids
14 | *.pid
15 | *.seed
16 | *.pid.lock
17 |
18 | # Directory for instrumented libs generated by jscoverage/JSCover
19 | lib-cov
20 |
21 | # Coverage directory used by tools like istanbul
22 | coverage
23 | *.lcov
24 |
25 | # nyc test coverage
26 | .nyc_output
27 |
28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29 | .grunt
30 |
31 | # Bower dependency directory (https://bower.io/)
32 | bower_components
33 |
34 | # node-waf configuration
35 | .lock-wscript
36 |
37 | # Compiled binary addons (https://nodejs.org/api/addons.html)
38 | build/Release
39 |
40 | # Dependency directories
41 | node_modules/
42 | jspm_packages/
43 |
44 | # TypeScript v1 declaration files
45 | typings/
46 |
47 | # TypeScript cache
48 | *.tsbuildinfo
49 |
50 | # Optional npm cache directory
51 | .npm
52 |
53 | # Optional eslint cache
54 | .eslintcache
55 |
56 | # Microbundle cache
57 | .rpt2_cache/
58 | .rts2_cache_cjs/
59 | .rts2_cache_es/
60 | .rts2_cache_umd/
61 |
62 | # Optional REPL history
63 | .node_repl_history
64 |
65 | # Output of 'npm pack'
66 | *.tgz
67 |
68 | # Yarn Integrity file
69 | .yarn-integrity
70 |
71 | # dotenv environment variables file
72 | .env
73 | .env.test
74 |
75 | # parcel-bundler cache (https://parceljs.org/)
76 | .cache
77 |
78 | # Next.js build output
79 | .next
80 |
81 | # Nuxt.js build / generate output
82 | .nuxt
83 | dist
84 |
85 | # Gatsby files
86 | .cache/
87 | # Comment in the public line in if your project uses Gatsby and *not* Next.js
88 | # https://nextjs.org/blog/next-9-1#public-directory-support
89 | # public
90 |
91 | # vuepress build output
92 | .vuepress/dist
93 |
94 | # Serverless directories
95 | .serverless/
96 |
97 | # FuseBox cache
98 | .fusebox/
99 |
100 | # DynamoDB Local files
101 | .dynamodb/
102 |
103 | # TernJS port file
104 | .tern-port
105 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # RouteMap
2 | a component of red teaming for generate route map.
3 |
4 |
5 |
6 | 
7 |
8 | Use dot language:
9 |
10 | ```dot
11 | digraph LR{
12 | // 我们使用图标名来控制图表方向,可选值有:LR、RL、UD、DU
13 |
14 | // 可以设置全局的node和edge属性
15 | // node [
16 | // shape=circle
17 | // fontcolor=blue,
18 | // fontsize=16
19 | // ]
20 | // edge [
21 | // length=200,
22 | // color=lightgray,
23 | // fontcolor=lightgray,
24 | // penwidth=3,
25 | // ]
26 |
27 | hacker[label="JD.Army" icon=Threat_Actor]
28 | target[
29 | label="Enterprise",
30 | icon=Identity
31 | fontsize=20,
32 | fontcolor=purple
33 | ]
34 | hacker -> target[color=red fontcolor="#666" label="开展实战攻防演练" ]
35 | // hacker -- target
36 |
37 | "主站"[icon=Identity]
38 | collinfo[label="信息收集" icon=Intrusion_Set]
39 | SQLin[label="SQL注入漏洞" icon="Vulnerability"]
40 | target -> collinfo -> "主站" -> SQLin
41 |
42 | RCE[label="远程命令执行漏洞" icon="Vulnerability" fontboldcolor="green"]
43 | "sso.target"[label="统一登录系统\\nsso.target.com" icon=Identity margin=15]
44 | collinfo -> "sso.target" -> RCE[label="获取服务器权限"]
45 |
46 | "UDF提权"[icon=Attack_Pattern]
47 | "白利用提权"[icon=Attack_Pattern fontbackground="red" ]
48 | "sso.target" -> {"UDF提权"; "白利用提权"}[label="提权" fontbackground="red"]
49 |
50 | RCE -> "UDF提权"[style="dashed" arrowhead=box]
51 | RCE -> "白利用提权"[style="dotted" penwidth=1 dir=both arrowhead=diamond arrowtail=box]
52 |
53 |
54 | // 本系统使用vis-network做图形绘制,使用dot language作为绘制语言,
55 | // 详见:https://visjs.github.io/vis-network/examples/network/data/dotLanguage/dotEdgeStyles.html
56 |
57 | // 本系统使用STIX2.1的对象和图标描述攻击路线,
58 | // 详见:https://oasis-open.github.io/cti-documentation/stix/intro
59 |
60 | // 漏洞(黑客可以直接使用软件中的错误来访问系统或网络。)
61 | // Vulnerability[icon="Vulnerability"]
62 |
63 | // 工具(可被威胁行为者用来执行攻击的合法软件。)
64 | // Tool[icon=Tool]
65 |
66 | // 威胁行为者(被认为具有恶意行为的实际个人、团体或组织。)
67 | // Threat_Actor[icon=Threat_Actor]
68 |
69 | // 瞄准(表示相信看到了 CTI 中的某些内容(例如,指标、恶意软件、工具、威胁行为者等)。)
70 | // Sighting[icon=Sighting]
71 |
72 | // 报告(集中于一个或多个主题的威胁情报集合,例如威胁参与者、恶意软件或攻击技术的描述)
73 | // Report[icon=Report]
74 |
75 | // 关系(用于将两个 SDO 或 SCO 链接在一起,以描述它们如何相互关联。)
76 | // Relationship[icon=Relationship]
77 |
78 | // 观点(对不同实体生成的 STIX 对象中信息正确性的评估。)
79 | // Opinion[icon=Opinion]
80 |
81 | // 观测数据(有关网络安全相关实体(例如文件、系统和网络)的信息)
82 | // Observed_Data[icon=Observed_Data]
83 |
84 | // 笔记(传达信息文本)
85 | // Note[icon=Note]
86 |
87 | // 恶意软件
88 | // Malware[icon=Malware]
89 |
90 | // 恶意软件分析(分析的元数据和结果)
91 | // Malware_Analysis[icon=Malware_Analysis]
92 |
93 | // 地点(代表一个地理位置)
94 | // Location[icon=Location]
95 |
96 | // 入侵集(一组具有共同属性的对抗性行为和资源)
97 | // Intrusion_Set[icon=Intrusion_Set]
98 |
99 | // 基础设施(用于攻防目的的任何系统、软件服务和任何相关的物理或虚拟资源)
100 | // Infrastructure[icon=Infrastructure]
101 |
102 | // 指标器(IOC)
103 | // Indicator[icon=Indicator]
104 |
105 | // 事件(在STIX 2.1版本中被移除了)
106 | // Incident[icon=Incident]
107 |
108 | // 身份(实际的个人、组织、系统或团体)
109 | // Identity[icon=Identity]
110 |
111 | // 分组
112 | // Grouping[icon=Grouping]
113 |
114 | // 行动方案(缓解方案)
115 | // Course_of_Action[icon=Course_of_Action]
116 |
117 | // 活动(一组对抗性行为,描述了在一段时间内针对一组特定目标发生的一组恶意活动或攻击)
118 | // Campaign[icon=Campaign]
119 |
120 | // 攻击类型(TTP)
121 | // Attack_Pattern[icon=Attack_Pattern]
122 | }
123 | ```
--------------------------------------------------------------------------------
/src/RouteMap.js:
--------------------------------------------------------------------------------
1 | import stixIcon from "./stix-icon.font";
2 | var vis = require("vis-network/standalone/umd/vis-network.min");
3 |
4 | function RouteMap(args) {
5 | RouteMap._init(args);
6 | }
7 |
8 | RouteMap.network = null;
9 | RouteMap.defaultOptions = {
10 | nodes: {
11 | font: {
12 | color: 'blue',
13 | size: 16,
14 | multi: true,
15 | bold: {
16 | color: "red",
17 | },
18 | },
19 | shape: 'circle',
20 | shadow: true,
21 | },
22 | edges: {
23 | length: 200,
24 | color: '#ddd',
25 | font: {
26 | color: '#aaa',
27 | size: 10,
28 | },
29 | width: 3,
30 | },
31 | };
32 |
33 | RouteMap.destroy = function () {
34 | if (RouteMap.network) {
35 | RouteMap.network.destroy();
36 | RouteMap.network = null;
37 | }
38 | };
39 |
40 | RouteMap.setOptions = function (options) {
41 | let opts = RouteMap.defaultOptions;
42 | if (options) {
43 | Object.keys(options).map((key) => {
44 | opts[key] = options[key];
45 | });
46 | }
47 | return opts;
48 | };
49 |
50 | RouteMap.parseData = function (dotContent) {
51 | let data = vis.parseDOTNetwork(dotContent);
52 | dotContent.replace(/^(digraph|dinetwork|graph)\s*(UD|DU|RL|LR)?\s*[^\w]+/,function($0,$1,$2){
53 | if($2){
54 | RouteMap.defaultOptions.layout = {
55 | hierarchical: {
56 | direction: $2,
57 | },
58 | };
59 | }
60 | })
61 |
62 | data.edges = data.edges.map(edge=>{
63 | //处理 edge 中的 fontbackground
64 | if(edge.fontbackground){
65 | edge.font = {
66 | background: edge.fontbackground
67 | };
68 | }
69 | return edge;
70 | });
71 |
72 | data.nodes = data.nodes.map(node=>{
73 | //处理node中的icon
74 | if(node.icon && stixIcon[node.icon]){
75 | node.shape = 'icon';
76 | node.icon = {
77 | face: 'stix-icons',
78 | code: stixIcon.black_o[node.icon].content,
79 | color: stixIcon[node.icon].color,
80 | size: 50,
81 | };
82 | }
83 |
84 | if(!node.font) node.font = {};
85 | //处理node中的 fontboldcolor
86 | if(node.fontboldcolor){
87 | node.font['bold'] = {
88 | color: node.fontboldcolor
89 | }
90 | }
91 | //处理node中的 fontbackground
92 | if(node.fontbackground){
93 | node.font['background'] = node.fontbackground;
94 | }
95 | //处理node中的 margin
96 | if(!node.margin) node.margin = {};
97 | if(node.margintop){
98 | node.margin = {
99 | top: node.margintop
100 | }
101 | }
102 | if(node.marginleft){
103 | node.margin = {
104 | left: node.marginleft
105 | }
106 | }
107 | if(node.marginright){
108 | node.margin = {
109 | right: node.marginright
110 | }
111 | }
112 | if(node.marginbottom){
113 | node.margin = {
114 | bottom: node.marginbottom
115 | }
116 | }
117 | return node;
118 | });
119 | console.log(data);
120 | return data;
121 | };
122 |
123 | RouteMap._init = function (args) {
124 | RouteMap.destroy();
125 |
126 | if (!args.id) {
127 | throw console.error("Not set route map container id");
128 | }
129 | let container = document.getElementById(args.id);
130 | if (!container) {
131 | throw console.error("Route map container not found: " + args.id);
132 | }
133 | let data = RouteMap.parseData(args.dotContent);
134 | let options = RouteMap.setOptions(args.options);
135 |
136 | RouteMap.network = new vis.Network(container, data, options);
137 | };
138 |
139 | export default RouteMap;
140 |
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | import Vue from "vue/dist/vue.esm.js";
2 | import "./main.css";
3 | import RouteMap from "./RouteMap";
4 |
5 | import ace from "ace-builds";
6 | import "ace-builds/src-noconflict/mode-dot";
7 | import "ace-builds/src-noconflict/theme-xcode"
8 | import "ace-builds/src-noconflict/mode-snippets"
9 | import "ace-builds/src-noconflict/ext-language_tools"
10 | import "./dot-snippets"
11 | import beautify from 'ace-builds/src-noconflict/ext-beautify'
12 |
13 | new Vue({
14 | el: "#forVue",
15 | data: {
16 | err: "123",
17 | aceEditorId: "aceEditorPane",
18 | routeMapId: "canvasPane",
19 | dotContent: `digraph LR{
20 | // 我们使用图标名来控制图表方向,可选值有:LR、RL、UD、DU
21 |
22 | // 可以设置全局的node和edge属性
23 | // node [
24 | // shape=circle
25 | // fontcolor=blue,
26 | // fontsize=16
27 | // ]
28 | // edge [
29 | // length=200,
30 | // color=lightgray,
31 | // fontcolor=lightgray,
32 | // penwidth=3,
33 | // ]
34 |
35 | hacker[label="JD.Army" icon=Threat_Actor]
36 | target[
37 | label="Enterprise",
38 | icon=Identity
39 | fontsize=20,
40 | fontcolor=purple
41 | ]
42 | hacker -> target[color=red fontcolor="#666" label="开展实战攻防演练" ]
43 | // hacker -- target
44 |
45 | "主站"[icon=Identity]
46 | collinfo[label="信息收集" icon=Intrusion_Set]
47 | SQLin[label="SQL注入漏洞" icon="Vulnerability"]
48 | target -> collinfo -> "主站" -> SQLin
49 |
50 | RCE[label="远程命令执行漏洞" icon="Vulnerability" fontboldcolor="green"]
51 | "sso.target"[label="统一登录系统\\nsso.target.com" icon=Identity margin=15]
52 | collinfo -> "sso.target" -> RCE[label="获取服务器权限"]
53 |
54 | "UDF提权"[icon=Attack_Pattern]
55 | "白利用提权"[icon=Attack_Pattern fontbackground="red" ]
56 | "sso.target" -> {"UDF提权"; "白利用提权"}[label="提权" fontbackground="red"]
57 |
58 | RCE -> "UDF提权"[style="dashed" arrowhead=box]
59 | RCE -> "白利用提权"[style="dotted" penwidth=1 dir=both arrowhead=diamond arrowtail=box]
60 |
61 |
62 | // 本系统使用vis-network做图形绘制,使用dot language作为绘制语言,
63 | // 详见:https://visjs.github.io/vis-network/examples/network/data/dotLanguage/dotEdgeStyles.html
64 |
65 | // 本系统使用STIX2.1的对象和图标描述攻击路线,
66 | // 详见:https://oasis-open.github.io/cti-documentation/stix/intro
67 |
68 | // 漏洞(黑客可以直接使用软件中的错误来访问系统或网络。)
69 | // Vulnerability[icon="Vulnerability"]
70 |
71 | // 工具(可被威胁行为者用来执行攻击的合法软件。)
72 | // Tool[icon=Tool]
73 |
74 | // 威胁行为者(被认为具有恶意行为的实际个人、团体或组织。)
75 | // Threat_Actor[icon=Threat_Actor]
76 |
77 | // 瞄准(表示相信看到了 CTI 中的某些内容(例如,指标、恶意软件、工具、威胁行为者等)。)
78 | // Sighting[icon=Sighting]
79 |
80 | // 报告(集中于一个或多个主题的威胁情报集合,例如威胁参与者、恶意软件或攻击技术的描述)
81 | // Report[icon=Report]
82 |
83 | // 关系(用于将两个 SDO 或 SCO 链接在一起,以描述它们如何相互关联。)
84 | // Relationship[icon=Relationship]
85 |
86 | // 观点(对不同实体生成的 STIX 对象中信息正确性的评估。)
87 | // Opinion[icon=Opinion]
88 |
89 | // 观测数据(有关网络安全相关实体(例如文件、系统和网络)的信息)
90 | // Observed_Data[icon=Observed_Data]
91 |
92 | // 笔记(传达信息文本)
93 | // Note[icon=Note]
94 |
95 | // 恶意软件
96 | // Malware[icon=Malware]
97 |
98 | // 恶意软件分析(分析的元数据和结果)
99 | // Malware_Analysis[icon=Malware_Analysis]
100 |
101 | // 地点(代表一个地理位置)
102 | // Location[icon=Location]
103 |
104 | // 入侵集(一组具有共同属性的对抗性行为和资源)
105 | // Intrusion_Set[icon=Intrusion_Set]
106 |
107 | // 基础设施(用于攻防目的的任何系统、软件服务和任何相关的物理或虚拟资源)
108 | // Infrastructure[icon=Infrastructure]
109 |
110 | // 指标器(IOC)
111 | // Indicator[icon=Indicator]
112 |
113 | // 事件(在STIX 2.1版本中被移除了)
114 | // Incident[icon=Incident]
115 |
116 | // 身份(实际的个人、组织、系统或团体)
117 | // Identity[icon=Identity]
118 |
119 | // 分组
120 | // Grouping[icon=Grouping]
121 |
122 | // 行动方案(缓解方案)
123 | // Course_of_Action[icon=Course_of_Action]
124 |
125 | // 活动(一组对抗性行为,描述了在一段时间内针对一组特定目标发生的一组恶意活动或攻击)
126 | // Campaign[icon=Campaign]
127 |
128 | // 攻击类型(TTP)
129 | // Attack_Pattern[icon=Attack_Pattern]
130 | }`,
131 | direction: "LR",
132 | aceEditor: null,
133 | },
134 | watch: {
135 | dotContent: function () {
136 | this.initRouteMap();
137 | },
138 | direction: function () {
139 | this.initRouteMap();
140 | },
141 | },
142 | methods: {
143 | initRouteMap: function () {
144 | try {
145 | this.err = "";
146 | RouteMap({
147 | id: this.routeMapId,
148 | dotContent: this.dotContent,
149 | });
150 | } catch (err) {
151 | this.err = err.toString();
152 | }
153 | },
154 | initAceEditor: function() {
155 | ace.require(["ace/snippets/dot"]);
156 | this.aceEditor = ace.edit(this.aceEditorId);
157 | this.aceEditor.setTheme("ace/theme/xcode");
158 | this.aceEditor.session.setMode("ace/mode/dot");
159 | this.aceEditor.setOptions({
160 | enableBasicAutocompletion: true,
161 | enableLiveAutocompletion: true,
162 | enableSnippets: true,
163 | wrap: true,
164 | });
165 | this.aceEditor.setValue(this.dotContent);
166 | beautify.beautify(this.aceEditor.getSession());
167 | this.aceEditor.getSession().on('change', () => {
168 | this.dotContent = this.aceEditor.getSession().getValue();
169 | })
170 | },
171 | },
172 | mounted() {
173 | this.initRouteMap();
174 | this.initAceEditor();
175 | }
176 | });
177 |
--------------------------------------------------------------------------------
/src/stix-icon.font.js:
--------------------------------------------------------------------------------
1 | import stixIconsFont from "arraybuffer-loader!./fonts/stix-icons.woff";
2 |
3 | (function () {
4 | const myFont = new FontFace("stix-icons", stixIconsFont);
5 | myFont.load().then((font) => {
6 | document.fonts.add(font);
7 | });
8 | })();
9 |
10 | let stixIcon = {
11 | black_o: {
12 | Vulnerability: {
13 | content: "\ue900",
14 | },
15 | Tool: {
16 | content: "\ue901",
17 | },
18 | Threat_Actor: {
19 | content: "\ue902",
20 | },
21 | Sighting: {
22 | content: "\ue903",
23 | },
24 | Report: {
25 | content: "\ue904",
26 | },
27 | Relationship: {
28 | content: "\ue905",
29 | },
30 | Opinion: {
31 | content: "\ue906",
32 | },
33 | Observed_Data: {
34 | content: "\ue907",
35 | },
36 | Note: {
37 | content: "\ue908",
38 | },
39 | Malware: {
40 | content: "\ue909",
41 | },
42 | Malware_Analysis: {
43 | content: "\ue90a",
44 | },
45 | Location: {
46 | content: "\ue90b",
47 | },
48 | Intrusion_Set: {
49 | content: "\ue90c",
50 | },
51 | Infrastructure: {
52 | content: "\ue90d",
53 | },
54 | Indicator: {
55 | content: "\ue90e",
56 | },
57 | Incident: {
58 | content: "\ue90f",
59 | },
60 | Identity: {
61 | content: "\ue910",
62 | },
63 | Grouping: {
64 | content: "\ue911",
65 | },
66 | Course_of_Action: {
67 | content: "\ue912",
68 | },
69 | Campaign: {
70 | content: "\ue913",
71 | },
72 | Attack_Pattern: {
73 | content: "\ue914",
74 | },
75 | },
76 | white_o: {
77 | Vulnerability: {
78 | content: "\ue915",
79 | color: "#fff",
80 | },
81 | Tool: {
82 | content: "\ue916",
83 | color: "#fff",
84 | },
85 | Threat_Actor: {
86 | content: "\ue917",
87 | color: "#fff",
88 | },
89 | Sighting: {
90 | content: "\ue918",
91 | color: "#fff",
92 | },
93 | Report: {
94 | content: "\ue919",
95 | color: "#fff",
96 | },
97 | Relationship: {
98 | content: "\ue91a",
99 | color: "#fff",
100 | },
101 | Opinion: {
102 | content: "\ue91b",
103 | color: "#fff",
104 | },
105 | Observed_Data: {
106 | content: "\ue91c",
107 | color: "#fff",
108 | },
109 | Note: {
110 | content: "\ue91d",
111 | color: "#fff",
112 | },
113 | Malware: {
114 | content: "\ue91e",
115 | color: "#fff",
116 | },
117 | Malware_Analysis: {
118 | content: "\ue91f",
119 | color: "#fff",
120 | },
121 | Location: {
122 | content: "\ue920",
123 | color: "#fff",
124 | },
125 | Intrusion_Set: {
126 | content: "\ue921",
127 | color: "#fff",
128 | },
129 | Infrastructure: {
130 | content: "\ue922",
131 | color: "#fff",
132 | },
133 | Indicator: {
134 | content: "\ue923",
135 | color: "#fff",
136 | },
137 | Incident: {
138 | content: "\ue924",
139 | color: "#fff",
140 | },
141 | Identity: {
142 | content: "\ue925",
143 | color: "#fff",
144 | },
145 | Grouping: {
146 | content: "\ue926",
147 | color: "#fff",
148 | },
149 | Course_of_Action: {
150 | content: "\ue927",
151 | color: "#fff",
152 | },
153 | Campaign: {
154 | content: "\ue928",
155 | color: "#fff",
156 | },
157 | Attack_Pattern: {
158 | content: "\ue929",
159 | color: "#fff",
160 | },
161 | },
162 | black: {
163 | Vulnerability: {
164 | content: "\ue92a",
165 | },
166 | Tool: {
167 | content: "\ue92b",
168 | },
169 | Threat_Actor: {
170 | content: "\ue92c",
171 | },
172 | Sighting: {
173 | content: "\ue92d",
174 | },
175 | Report: {
176 | content: "\ue92e",
177 | },
178 | Relationship: {
179 | content: "\ue92f",
180 | },
181 | Opinion: {
182 | content: "\ue930",
183 | },
184 | Observed_Data: {
185 | content: "\ue931",
186 | },
187 | Note: {
188 | content: "\ue932",
189 | },
190 | Malware_Analysis: {
191 | content: "\ue933",
192 | },
193 | Malware: {
194 | content: "\ue934",
195 | },
196 | Location: {
197 | content: "\ue935",
198 | },
199 | Intrusion_Set: {
200 | content: "\ue936",
201 | },
202 | Infrastructure: {
203 | content: "\ue937",
204 | },
205 | Indicator: {
206 | content: "\ue938",
207 | },
208 | Incident: {
209 | content: "\ue939",
210 | },
211 | Identity: {
212 | content: "\ue93a",
213 | },
214 | Grouping: {
215 | content: "\ue93b",
216 | },
217 | Course_of_Action: {
218 | content: "\ue93c",
219 | },
220 | Campaign: {
221 | content: "\ue93d",
222 | },
223 | Attack_Pattern: {
224 | content: "\ue93e",
225 | },
226 | },
227 | white: {
228 | Vulnerability: {
229 | content: "\ue93f",
230 | color: "#fff",
231 | },
232 | Tool: {
233 | content: "\ue940",
234 | color: "#fff",
235 | },
236 | Threat_Actor: {
237 | content: "\ue941",
238 | color: "#fff",
239 | },
240 | Sighting: {
241 | content: "\ue942",
242 | color: "#fff",
243 | },
244 | Report: {
245 | content: "\ue943",
246 | color: "#fff",
247 | },
248 | Relationship: {
249 | content: "\ue944",
250 | color: "#fff",
251 | },
252 | Opinion: {
253 | content: "\ue945",
254 | color: "#fff",
255 | },
256 | Observed_Data: {
257 | content: "\ue946",
258 | color: "#fff",
259 | },
260 | Note: {
261 | content: "\ue947",
262 | color: "#fff",
263 | },
264 | Malware_Analysis: {
265 | content: "\ue948",
266 | color: "#fff",
267 | },
268 | Malware: {
269 | content: "\ue949",
270 | color: "#fff",
271 | },
272 | Location: {
273 | content: "\ue94a",
274 | color: "#fff",
275 | },
276 | Intrusion_Set: {
277 | content: "\ue94b",
278 | color: "#fff",
279 | },
280 | Infrastructure: {
281 | content: "\ue94c",
282 | color: "#fff",
283 | },
284 | Indicator: {
285 | content: "\ue94d",
286 | color: "#fff",
287 | },
288 | Incident: {
289 | content: "\ue94e",
290 | color: "#fff",
291 | },
292 | Identity: {
293 | content: "\ue94f",
294 | color: "#fff",
295 | },
296 | Grouping: {
297 | content: "\ue950",
298 | color: "#fff",
299 | },
300 | Course_of_Action: {
301 | content: "\ue951",
302 | color: "#fff",
303 | },
304 | Campaign: {
305 | content: "\ue952",
306 | color: "#fff",
307 | },
308 | Attack_Pattern: {
309 | content: "\ue953",
310 | color: "#fff",
311 | },
312 | },
313 | Incident: {
314 | content: "\ue97f",
315 | color: "#fcb617",
316 | },
317 | Vulnerability: {
318 | content: "\ue980",
319 | color: "#ffd100",
320 | },
321 | Tool: {
322 | content: "\ue981",
323 | color: "#57509d",
324 | },
325 | Threat_Actor: {
326 | content: "\ue982",
327 | color: "#e61b5c",
328 | },
329 | Sighting: {
330 | content: "\ue983",
331 | color: "#eb5e2a",
332 | },
333 | Report: {
334 | content: "\ue984",
335 | color: "#769279",
336 | },
337 | Relationship: {
338 | content: "\ue985",
339 | color: "#cdd6d8",
340 | },
341 | Opinion: {
342 | content: "\ue986",
343 | color: "#505657",
344 | },
345 | Observed_Data: {
346 | content: "\ue987",
347 | },
348 | Note: {
349 | content: "\ue988",
350 | color: "#505657",
351 | },
352 | Malware_Analysis: {
353 | content: "\ue989",
354 | color: "#e776ac",
355 | },
356 | Malware: {
357 | content: "\ue98a",
358 | color: "#d3a3cb",
359 | },
360 | Location: {
361 | content: "\ue98b",
362 | color: "#505657",
363 | },
364 | Intrusion_Set: {
365 | content: "\ue98c",
366 | color: "#39b2c1",
367 | },
368 | Infrastructure: {
369 | content: "\ue98d",
370 | color: "#aed7c0",
371 | },
372 | Indicator: {
373 | content: "\ue98e",
374 | color: "#f3921a",
375 | },
376 | Identity: {
377 | content: "\ue98f",
378 | color: "#929697",
379 | },
380 | Grouping: {
381 | content: "\ue990",
382 | color: "#a3358b",
383 | },
384 | Course_of_Action: {
385 | content: "\ue991",
386 | color: "#a1c628",
387 | },
388 | Campaign: {
389 | content: "\ue992",
390 | color: "#50b682",
391 | },
392 | Attack_Pattern: {
393 | content: "\ue993",
394 | color: "#2277b5",
395 | },
396 | };
397 |
398 | export default stixIcon;
399 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/src/fonts/stix-icons.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------