This is the first cut at the tunneling proxy - it is by no means perfect - but it should be functional. git-svn-id: https://beef.googlecode.com/svn/trunk@849 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9
24 lines
570 B
Ruby
24 lines
570 B
Ruby
require 'webrick/httpproxy'
|
|
require 'webrick/httputils'
|
|
|
|
module BeEF
|
|
class HttpProxyBase < WEBrick::HTTPProxyServer
|
|
|
|
# call BeEF::HttpProxyZombie.instance
|
|
include Singleton
|
|
|
|
attr_reader :config
|
|
|
|
def initialize
|
|
@configuration = BeEF::Configuration.instance
|
|
@config[:Logger] = WEBrick::Log.new($stdout, WEBrick::Log::ERROR)
|
|
@config[:ServerType] = Thread
|
|
super(@config)
|
|
end
|
|
|
|
# remove beef hook if it exists
|
|
def remove_hook(res)
|
|
res.body.gsub!(%r'<script.*?http.*?exploit.js.*?</script>', '')
|
|
end
|
|
end
|
|
end |