Skip to content

Commit

Permalink
add support for npm and bower so folks can use the payload data progr…
Browse files Browse the repository at this point in the history
…amatically
  • Loading branch information
jimmyhchan committed Mar 28, 2014
1 parent 835a948 commit e0f37b5
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 8 deletions.
9 changes: 9 additions & 0 deletions bower.json
@@ -0,0 +1,9 @@
{
"name": "h5sc",
"version": "0.0.0",
"main": [
"items.js",
"payloads.js",
"categories.js"
]
}
18 changes: 16 additions & 2 deletions categories.js
@@ -1,6 +1,19 @@
/* Categories - the available categories */ /* Categories - the available categories */
var categories = (function (root, factory) {
{ if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define([], factory);
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory();
} else {
// Browser globals (root is window)
root.categories = factory();
}
}(this, function () {
return {
'html5' : { 'html5' : {
'en' : 'Vectors making use of HTML5 features', 'en' : 'Vectors making use of HTML5 features',
'ja' : 'HTML5\u306e\u6a5f\u80fd\u3092\u4f7f\u3063\u305f\u624b\u6cd5', 'ja' : 'HTML5\u306e\u6a5f\u80fd\u3092\u4f7f\u3063\u305f\u624b\u6cd5',
Expand Down Expand Up @@ -119,3 +132,4 @@ var categories =
'zh' : 'Clickjacking和UI Redressing的向量' 'zh' : 'Clickjacking和UI Redressing的向量'
} }
} }
}));
21 changes: 18 additions & 3 deletions items.js
@@ -1,6 +1,20 @@
/* Items - the set of available items and vectors */ /* Items - the set of available items and vectors */
var items =
[ (function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define([], factory);
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory();
} else {
// Browser globals (root is window)
root.items = factory();
}
}(this, function () {
return [
{ /* ID 1 - XSS via formaction - requiring user interaction (1) */ { /* ID 1 - XSS via formaction - requiring user interaction (1) */
'id' : 1, 'id' : 1,
'category' : 'html5', 'category' : 'html5',
Expand Down Expand Up @@ -4857,4 +4871,5 @@ var items =
'tags' : ['html5', 'svg', 'from', 'inline', 'xss', 'passive'], 'tags' : ['html5', 'svg', 'from', 'inline', 'xss', 'passive'],
'reporter' : '.mario' 'reporter' : '.mario'
} }
] ]
}));
11 changes: 11 additions & 0 deletions lib/index.js
@@ -0,0 +1,11 @@
var items = require('../items'),
payloads = require('../payload'),
categories = require('../categories');

var h5sc = {};

h5sc.items = items;
h5sc.payloads = payloads;
h5sc.categories = categories;

module.exports = h5sc;
22 changes: 22 additions & 0 deletions package.json
@@ -0,0 +1,22 @@
{
"name": "H5SC",
"version": "0.0.0",
"description": "HTML5 Security Cheatsheet",
"main": "lib/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git@github.com:cure53/H5SC.git"
},
"keywords": [
"security"
],
"author": "cure53",
"license": "Mozilla Public License, version 2.0",
"bugs": {
"url": "https://github.com/cure53/H5SC/issues"
},
"homepage": "https://github.com/cure53/H5SC"
}
20 changes: 17 additions & 3 deletions payloads.js
@@ -1,6 +1,19 @@
/* Payload - the generic payload templates */ /* Payload - the generic payload templates */
var payloads = (function (root, factory) {
{ if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define([], factory);
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory();
} else {
// Browser globals (root is window)
root.payloads = factory();
}
}(this, function () {
return {
'js_uri_alert' : 'javascript:alert(1)', 'js_uri_alert' : 'javascript:alert(1)',
'js_uri_alert_2' : 'javascript:alert(2)', 'js_uri_alert_2' : 'javascript:alert(2)',
'js_uri_alert_3' : 'javascript:alert(3)', 'js_uri_alert_3' : 'javascript:alert(3)',
Expand Down Expand Up @@ -33,4 +46,5 @@ var payloads =
'swf_path' : 'test.swf', 'swf_path' : 'test.swf',
'jar_path' : 'test.jar', 'jar_path' : 'test.jar',
'event_path' : 'event.php' 'event_path' : 'event.php'
} }
}));

0 comments on commit e0f37b5

Please sign in to comment.