-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathnemo.sql
247 lines (229 loc) · 9.01 KB
/
nemo.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
/*
Navicat Premium Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 50732
Source Host : localhost:3306
Source Schema : nemo
Target Server Type : MySQL
Target Server Version : 50732
File Encoding : 65001
Date: 03/02/2021 09:07:28
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for domain
-- ----------------------------
DROP TABLE IF EXISTS `domain`;
CREATE TABLE `domain` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`domain` varchar(100) NOT NULL,
`org_id` int(10) unsigned DEFAULT NULL,
`create_datetime` datetime NOT NULL,
`update_datetime` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `index_domain_domain` (`domain`) USING BTREE,
KEY `fk_domain_org_id` (`org_id`),
CONSTRAINT `fk_domain_org_id` FOREIGN KEY (`org_id`) REFERENCES `organization` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=1796 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Table structure for domain_attr
-- ----------------------------
DROP TABLE IF EXISTS `domain_attr`;
CREATE TABLE `domain_attr` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`r_id` int(10) unsigned NOT NULL,
`source` varchar(40) DEFAULT NULL,
`tag` varchar(40) NOT NULL,
`content` varchar(1000) DEFAULT NULL,
`hash` char(32) DEFAULT NULL,
`create_datetime` datetime NOT NULL,
`update_datetime` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `index_domain_attr_hash` (`hash`) USING BTREE,
KEY `index_domain_attr_ip_id` (`r_id`),
CONSTRAINT `domain_attr_ibfk_1` FOREIGN KEY (`r_id`) REFERENCES `domain` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3272 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Table structure for domain_color_tag
-- ----------------------------
DROP TABLE IF EXISTS `domain_color_tag`;
CREATE TABLE `domain_color_tag` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`r_id` int(10) unsigned NOT NULL,
`color` char(20) NOT NULL,
`create_datetime` datetime DEFAULT NULL,
`update_datetime` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `fk_domain_color_tag_rid_unique` (`r_id`),
KEY `fk_domain_color_tag_rid` (`r_id`) USING BTREE,
CONSTRAINT `fk_domain_color_tag_rid` FOREIGN KEY (`r_id`) REFERENCES `domain` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Table structure for domain_memo
-- ----------------------------
DROP TABLE IF EXISTS `domain_memo`;
CREATE TABLE `domain_memo` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`r_id` int(10) unsigned NOT NULL,
`content` varchar(10000) DEFAULT NULL,
`create_datetime` datetime DEFAULT NULL,
`update_datetime` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `fk_domain_memo_rid_unique` (`r_id`),
CONSTRAINT `fk_domain_memo_rid` FOREIGN KEY (`r_id`) REFERENCES `domain` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Table structure for ip
-- ----------------------------
DROP TABLE IF EXISTS `ip`;
CREATE TABLE `ip` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`ip` varchar(128) CHARACTER SET utf8 NOT NULL,
`ip_int` bigint(11) NOT NULL,
`org_id` int(10) unsigned DEFAULT NULL,
`location` varchar(200) CHARACTER SET utf8 DEFAULT NULL,
`status` varchar(20) CHARACTER SET utf8 DEFAULT NULL,
`create_datetime` datetime NOT NULL,
`update_datetime` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `index_ip_ip` (`ip`) USING BTREE,
UNIQUE KEY `index_ip_ip_int` (`ip_int`) USING BTREE,
KEY `index_ip_org_id` (`org_id`),
CONSTRAINT `fk_ip_org_id` FOREIGN KEY (`org_id`) REFERENCES `organization` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=635 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Table structure for ip_attr
-- ----------------------------
DROP TABLE IF EXISTS `ip_attr`;
CREATE TABLE `ip_attr` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`r_id` int(10) unsigned NOT NULL,
`source` varchar(40) DEFAULT NULL,
`tag` varchar(40) NOT NULL,
`content` varchar(1000) DEFAULT NULL,
`hash` char(32) DEFAULT NULL,
`create_datetime` datetime NOT NULL,
`update_datetime` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `index_ip_attr_hash` (`hash`) USING BTREE,
KEY `index_ip_attr_ip_id` (`r_id`),
CONSTRAINT `fk_ip_attr_ip_id` FOREIGN KEY (`r_id`) REFERENCES `ip` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Table structure for ip_color_tag
-- ----------------------------
DROP TABLE IF EXISTS `ip_color_tag`;
CREATE TABLE `ip_color_tag` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`r_id` int(10) unsigned NOT NULL,
`color` char(20) NOT NULL,
`create_datetime` datetime DEFAULT NULL,
`update_datetime` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `fk_ip_color_tag_rid_unique` (`r_id`),
KEY `fk_ip_color_tag_rid` (`r_id`),
CONSTRAINT `ip_color_tag_ibfk_1` FOREIGN KEY (`r_id`) REFERENCES `ip` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Table structure for ip_memo
-- ----------------------------
DROP TABLE IF EXISTS `ip_memo`;
CREATE TABLE `ip_memo` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`r_id` int(10) unsigned NOT NULL,
`content` varchar(10000) DEFAULT NULL,
`create_datetime` datetime DEFAULT NULL,
`update_datetime` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `fk_ip_memo_rid_unqie` (`r_id`),
CONSTRAINT `fk_ip_memo_rid` FOREIGN KEY (`r_id`) REFERENCES `ip` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Table structure for organization
-- ----------------------------
DROP TABLE IF EXISTS `organization`;
CREATE TABLE `organization` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`org_name` varchar(200) CHARACTER SET utf8 NOT NULL,
`status` varchar(20) CHARACTER SET utf8 NOT NULL,
`sort_order` int(10) unsigned NOT NULL DEFAULT '100',
`create_datetime` datetime NOT NULL,
`update_datetime` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Table structure for port
-- ----------------------------
DROP TABLE IF EXISTS `port`;
CREATE TABLE `port` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`ip_id` int(10) unsigned NOT NULL,
`port` int(10) NOT NULL,
`status` varchar(20) NOT NULL,
`create_datetime` datetime NOT NULL,
`update_datetime` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `index_port_ip_port` (`ip_id`,`port`),
CONSTRAINT `fk_port_ip` FOREIGN KEY (`ip_id`) REFERENCES `ip` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=1385 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Table structure for port_attr
-- ----------------------------
DROP TABLE IF EXISTS `port_attr`;
CREATE TABLE `port_attr` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`r_id` int(10) unsigned NOT NULL,
`source` varchar(40) DEFAULT NULL,
`tag` varchar(40) NOT NULL,
`content` varchar(1000) DEFAULT NULL,
`hash` char(32) DEFAULT NULL,
`create_datetime` datetime NOT NULL,
`update_datetime` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `index_port_attr_hash` (`hash`),
KEY `fk_port_attr_r_id` (`r_id`),
CONSTRAINT `fk_port_attr_r_id` FOREIGN KEY (`r_id`) REFERENCES `port` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2597 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Table structure for task
-- ----------------------------
DROP TABLE IF EXISTS `task`;
CREATE TABLE `task` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`task_id` char(36) NOT NULL,
`task_name` varchar(100) NOT NULL,
`args` varchar(2000) DEFAULT NULL,
`kwargs` varchar(4000) DEFAULT NULL,
`worker` varchar(100) DEFAULT NULL,
`state` varchar(40) NOT NULL,
`result` varchar(4000) DEFAULT NULL,
`received` datetime DEFAULT NULL,
`retried` datetime DEFAULT NULL,
`revoked` datetime DEFAULT NULL,
`started` datetime DEFAULT NULL,
`succeeded` datetime DEFAULT NULL,
`failed` datetime DEFAULT NULL,
`progress_message` varchar(100) DEFAULT NULL,
`create_datetime` datetime NOT NULL,
`update_datetime` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=89 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Table structure for vulnerability
-- ----------------------------
DROP TABLE IF EXISTS `vulnerability`;
CREATE TABLE `vulnerability` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`target` varchar(100) NOT NULL,
`url` varchar(200) NOT NULL,
`poc_file` varchar(200) NOT NULL,
`source` varchar(40) NOT NULL,
`extra` varchar(4000) DEFAULT NULL,
`hash` char(32) NOT NULL,
`create_datetime` datetime NOT NULL,
`update_datetime` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4;
SET FOREIGN_KEY_CHECKS = 1;