Changed default websocket port

This commit is contained in:
antisnatchor
2012-04-07 13:34:21 +01:00
parent ce8919297f
commit faae01a9aa
3 changed files with 28 additions and 26 deletions

View File

@@ -17,7 +17,7 @@
beef:
version: '0.4.3.3-alpha'
debug: true
debug: false
restrictions:
# subnet of browser ip addresses that can hook to the framework
@@ -27,7 +27,7 @@ beef:
permitted_ui_subnet: "0.0.0.0/0"
http:
debug: true #Thin::Logging.debug, very verbose. Prints also full exception stack trace.
debug: false #Thin::Logging.debug, very verbose. Prints also full exception stack trace.
host: "0.0.0.0"
port: "3000"
# if running behind a nat set the public ip address here
@@ -40,7 +40,7 @@ beef:
websocket:
enable: true
secure: false # use WebSocketSecure
port: 6666
port: 11989
database:
# For information on using other databases please read the

View File

@@ -26,7 +26,7 @@ beef.websocket = {
/*server is always on ws.beefServer:6666*/
var webSocketServer=beef.net.host; /*beefHost*/
console.log(webSocketServer);
var webSocketPort=6666;
var webSocketPort=11989;
if(beef.browser.getBrowserName=="FF")
this.socket = new MozWebSocket("ws://"+webSocketServer+":"+webSocketPort+"/");
else

View File

@@ -20,35 +20,37 @@ module BeEF
def initialize
print_info("Starting WebSockets")
config = BeEF::Core::Configuration.instance
port = config.get("beef.http.websocket.port")
secure = config.get("beef.http.websocket.secure")
#todo antisnatchor: start websocket secure if beef.http.websocket.secure == true
server = WebSocketServer.new :accepted_domains => "0.0.0.0",
:port => config.get("beef.http.websocket.port")
websThread = Thread.new {
server.run() do |ws|
#@TODO debug print the path and who request for hooked browser mapping
print_info("Path requested #{ws.path} Origins #{ws.origin}")
if ws.path == "/"
ws.handshake() #accept and connect
server = WebSocketServer.new :accepted_domains => "127.0.0.1",
:port => port
print_info("Started WebSocket server: port [#{port.to_s}], secure [#{secure.to_s}]")
while true
#command interpretation
message=ws.receve()
Thread.new {
server.run() do |ws|
#@TODO debug print the path and who request for hooked browser mapping
print_info("Path requested #{ws.path} Origins #{ws.origin}")
if ws.path == "/"
ws.handshake() #accept and connect
while true
#command interpretation
message=ws.receve()
if (message!="helo")
#module return value case
else
print_info("Browser #{ws.origin} says helo! ws is running")
end
if (message!="helo")
#module return value case
else
print_info("Browser #{ws.origin} says helo! ws is running")
end
end
end
end
}
}
end
end
end
end
end
end
end