Skip to content

Commit

Permalink
testapp is back awwwwyeh
Browse files Browse the repository at this point in the history
  • Loading branch information
Contra committed Sep 24, 2011
1 parent 6e72058 commit 9ac4b19
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 7 deletions.
3 changes: 1 addition & 2 deletions .gitignore
@@ -1,5 +1,4 @@
.DS_Store
*.log
node_modules
temp
test
*npkg-temp*
5 changes: 0 additions & 5 deletions .npmignore

This file was deleted.

1 change: 1 addition & 0 deletions test/LICENSE
@@ -0,0 +1 @@
Throw those fucking sticks, I don't give a FUCK.
33 changes: 33 additions & 0 deletions test/index.html
@@ -0,0 +1,33 @@
<html>
<head>
<title>Fusker - Test Page</title>
<script type="text/javascript" src="/socket.io/socket.io.js"></script>
<script>
var socket = io.connect();

socket.on('connect', function () {
console.log('Socket.IO connected!');
});

socket.on('HelloClient', function (msg) {
console.log('Server: ' + msg);
socket.emit('TestObject', {username: 'ez-money', message: 'waz gud diz ya boi e-z e'});

//Uncomment this block to send attacks to the server on page load
/*
socket.emit('TestXSS', '"><img src=x onerror=alert("XSS")><noscript>');
socket.emit('TestLFI', '../../etc/passwd/');
socket.emit('TestSQL', '\' OR \'1\'=\'1');*/
});
</script>
</head>
<body bgcolor="black" background="http://content.ytmnd.com/content/1/d/b/1db6ede2772ba8f5428dbff9f1f2e3be.gif">
<br/><br/>
<center>
<h1>Fusker Test Page</h1><br/>
<img src="http://content.ytmnd.com/content/1/7/c/17c9f89183c18613f48450a649e3f64c.gif"/><br/>
<embed src="http://www.youtube.com/v/pOu1BvuhtRw?autoplay=1" type="application/x-shockwave-flash" wmode="transparent" width="1" height="1"></embed>
</center>
</body>
</html>

41 changes: 41 additions & 0 deletions test/main.js
@@ -0,0 +1,41 @@
var log = require('node-log')
log.setName('TestApp')
var fusker = require('fusker');

fusker.config.dir = __dirname;
fusker.config.banLength = 1;
fusker.config.verbose = true;
fusker.http.detect('csrf', 'xss', 'sqli', 'lfi', '404');
fusker.http.punish('blacklist', 'bush');
fusker.socket.detect('xss', 'sqli', 'lfi');
fusker.socket.punish('blacklist');

var server = fusker.http.createServer(8080);
var io = fusker.socket.listen(server);

io.sockets.on('connection', function(socket) {
socket.emit('HelloClient', 'o hay thar client');

socket.on('TestObject', function(msg) {
return console.log('HelloServer1! Contents: ' + msg);
});
socket.on('TestObject', function(msg) {
return console.log('HelloServer2! Contents: ' + msg);
});
socket.on('TestObject', function(msg) {
return console.log('HelloServer3! Contents: ' + msg);
});

/* Uncomment the attack senders in index.html to test these */;
socket.on('TestSQL', function(msg) {
return console.log('SQL Handled! Contents: ' + msg);
});

socket.on('TestLFI', function(msg) {
return console.log('LFI Handled! Contents: ' + msg);
});

socket.on('TestXSS', function(msg) {
return console.log('XSS Handled! Contents: ' + msg);
});
});
26 changes: 26 additions & 0 deletions test/package.json
@@ -0,0 +1,26 @@
{
"name":"TestApp",
"description":"TestApp for npkg",
"version":"0.0.1",
"homepage":"http://github.com/wearefractal/npkg",
"repository":"git://github.com/wearefractal/npkg.git",
"author":"Fractal <contact@wearefractal.com> (http://wearefractal.com/)",
"main":"./lib/main.js",

"dependencies":{
"coffee-script":"*",
"node-log":"*",
"fusker":"*",
"protege":"*",
"get":"*"
},
"engines":{
"node":">= 0.4.0"
},
"licenses":[
{
"type":"MIT",
"url":"http://github.com/wearefractal/npkg/raw/master/LICENSE"
}
]
}

0 comments on commit 9ac4b19

Please sign in to comment.