Skip to content

Commit

Permalink
Merge pull request cure53#4 from jimmyhchan/npmAndBower
Browse files Browse the repository at this point in the history
add support for npm/bower so folks can use the attack data programatically
  • Loading branch information
cure53 committed Mar 28, 2014
2 parents 835a948 + e0f37b5 commit 137334a
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 8 deletions.
9 changes: 9 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
/* 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' : {
'en' : 'Vectors making use of HTML5 features',
'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的向量'
}
}
}));
21 changes: 18 additions & 3 deletions items.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
/* 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,
'category' : 'html5',
Expand Down Expand Up @@ -4857,4 +4871,5 @@ var items =
'tags' : ['html5', 'svg', 'from', 'inline', 'xss', 'passive'],
'reporter' : '.mario'
}
]
]
}));
11 changes: 11 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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": "[email protected]: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
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
/* 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_2' : 'javascript:alert(2)',
'js_uri_alert_3' : 'javascript:alert(3)',
Expand Down Expand Up @@ -33,4 +46,5 @@ var payloads =
'swf_path' : 'test.swf',
'jar_path' : 'test.jar',
'event_path' : 'event.php'
}
}
}));

0 comments on commit 137334a

Please sign in to comment.