Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change https variable to nodeHttp/Remove deprecated 'sys'/comments & organization #6

Merged
merged 8 commits into from
Jan 26, 2012
File renamed without changes.
3 changes: 1 addition & 2 deletions lib/fusker.coffee
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
require('node-log').setName 'fusker'

fusker = {}
fusker.util = require './util'
fusker.attackLogger = require './attackLogger'
fusker.config = require './config'
fusker.http = require './http'
fusker.express = require './express'
fusker.socket = require './socketio'
fusker.patterns = require('xemplar').security

module.exports = fusker

17 changes: 10 additions & 7 deletions lib/http.coffee
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
https = require 'http'
# Node Internal Libs
nodeHttp = require 'http'
url = require 'url'
sys = require 'sys'
fs = require 'fs'
path = require 'path'
util = require './util'
config = require './config'

# NPM Libs (Dependencies)
log = require 'node-log'
mime = require 'mime'
digest = require 'digest'
async = require 'async'

# Custom Files
attackLogger = require './attackLogger'
config = require './config'
blacklist = require './blacklist'

http = {}
Expand All @@ -26,7 +30,7 @@ http.createServer = (port, username, password) ->
log.info 'Login Credentials: ' + (username + ':' + password).red
serv = digest.createServer username, password, http.serveRequest
else
serv = https.createServer http.serveRequest
serv = nodeHttp.createServer http.serveRequest
serv.listen port
return serv

Expand Down Expand Up @@ -81,7 +85,6 @@ http.handleAttack = (module, req, res) ->
module.run req, res
call()

async.forEach http.payloads, kill, -> util.logHTTP module, req
async.forEach http.payloads, kill, -> attackLogger.logHTTP module, req

module.exports = http

16 changes: 10 additions & 6 deletions lib/socketio.coffee
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
# Node Internal Libs
url = require 'url'
sys = require 'sys'
fs = require 'fs'
path = require 'path'
util = require './util'
config = require './config'
util = require 'util'

# NPM Libs (Dependencies)
log = require 'node-log'
async = require 'async'

# Custom Files
attackLogger = require './attackLogger'
config = require './config'
blacklist = require './blacklist'

socketio = {}
Expand Down Expand Up @@ -39,7 +44,7 @@ socketio.listen = (server) ->
socketio.processRequest = (socket, message, cb) ->
check = (detective, call) ->
module = require './socket-detectives/' + detective
module.check socket, sys.inspect(message)
module.check socket, util.inspect(message)
call()

async.forEach socketio.detectives, check, cb
Expand All @@ -51,7 +56,6 @@ socketio.handleAttack = (module, socket, msg) ->
module.run socket, msg
call()

async.forEach socketio.payloads, kill, -> util.logSocket module, socket, msg
async.forEach socketio.payloads, kill, -> attackLogger.logSocket module, socket, msg

module.exports = socketio

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"keywords": ["fusker", "hack", "protect", "csrf", "lfi", "xss", "sqli", "injection", "attack", "blacklist", "express", "socket", "security", "firewall"],
"author":"Fractal <contact@wearefractal.com> (http://wearefractal.com/)",
"main": "./lib/main.js",

"dependencies": {
"socket.io": ">= 0.7.4",
"coffee-script": "*",
Expand All @@ -18,11 +18,10 @@
"xemplar":"*"
},
"engines": {
"node": "*"
"node": ">= 0.4.0"
},
"licenses": [{
"type": "MIT",
"url": "http://github.com/wearefractal/fusker/raw/master/LICENSE"
}]
}