adding the squeleton for the requester proxy

git-svn-id: https://beef.googlecode.com/svn/trunk@514 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9
This commit is contained in:
mosse.benjamin
2010-11-13 05:04:47 +00:00
parent 9b5c8f6a5a
commit 5575d8848e
3 changed files with 43 additions and 0 deletions

View File

@@ -18,6 +18,10 @@ BeEF::Migration.instance.update_db!
BeEF::Console::Banner.generate
# start the requester proxy
#requester_proxy = BeEF::Requester::ProxyServer.instance
#requester_proxy.start
# start the hook server
http_hook_server = BeEF::HttpHookServer.instance
http_hook_server.start

View File

@@ -1,5 +1,6 @@
require 'rubygems'
require 'webrick'
require 'webrick/httpproxy'
require 'dm-core'
require 'dm-migrations'
require 'json'
@@ -56,6 +57,7 @@ require 'lib/server/inithandler'
require 'lib/logger'
require 'lib/modules/command'
require 'lib/modules/requester'
require 'openssl'

37
lib/modules/requester.rb Normal file
View File

@@ -0,0 +1,37 @@
module BeEF
module Requester
# Setting up the proxy server for the Requester
class ProxyServer
include Singleton
def initialize
@config = {
:Port => 8080,
:BindAddress => '127.0.0.1',
:Logger => WEBrick::Log.new($stdout, WEBrick::Log::ERROR),
:ServerType => Thread,
:RequestCallback => BeEF::Requester::ProxyHttpHandler.new
}
@server = WEBrick::HTTPProxyServer.new @config
trap("INT"){@server.shutdown}
end
def start
@server.start
end
end
# The http handler that receives requests
class ProxyHttpHandler
def call(req, res)
#puts req.request_line, req.raw_header
end
end
end
end