Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 42 lines (29 sloc) 1.171 kB
183e20a @contra cs fix, remove protege, cross-platform fix
contra authored
1 fusker = require '../lib/main'
52709ab @contra added option to use as express middleware
contra authored
2 express = require 'express'
3
4 fusker.config.dir = process.cwd()
5 fusker.config.banLength = 1
6 fusker.config.verbose = true
7
8 fusker.http.detectives.push 'csrf', 'xss', 'sqli', 'lfi', '404'
9 fusker.http.payloads.push 'blacklist', 'bush'
10 fusker.socket.detectives.push 'xss', 'sqli', 'lfi'
11 fusker.socket.payloads.push 'blacklist'
12
13 app = express.createServer()
14 app.use fusker.express.check
15 app.use express.static(fusker.config.dir)
16
17 app.listen 8080
18
19 io = fusker.socket.listen app
20
21 io.sockets.on 'connection', (socket) ->
22
23 socket.emit 'HelloClient', 'o hay thar client'
24 socket.on 'TestObject', (msg) ->
25 console.log 'HelloServer1! Contents: ' + msg
26
27 socket.on 'TestObject', (msg) ->
28 console.log 'HelloServer2! Contents: ' + msg
29
30 socket.on 'TestObject', (msg) ->
31 console.log 'HelloServer3! Contents: ' + msg
32
33 /* Uncomment the attack senders in index.html to test these */
34 socket.on 'TestSQL', (msg) ->
35 console.log 'SQL Handled! Contents: ' + msg
36
37 socket.on 'TestLFI', (msg) ->
38 console.log 'LFI Handled! Contents: ' + msg
39
40 socket.on 'TestXSS', (msg) ->
41 console.log 'XSS Handled! Contents: ' + msg
Something went wrong with that request. Please try again.