beefproject/beef — Issue #528: Hook polling requests change IP address
Author: passbe
Created: 2011-12-10 23:43:59+00:00
State: open

When a server with multiple interfaces is used to hook a browser the framework becomes confused.

Sometimes the hook.js script is requested from interface A however, it contains references to to interface B. It will even instruct the browser poll the incorrect interface B. See attached screen shot. If both interfaces are accessible from the hooked browser the bug won't be detectable.

The issue appears to be related to the following snippet in common.rb. In this bug the framework seems to set beef_host and beef_url to be different values. The beef_url domain should always be set to req_host even if its current domain is not 0.0.0.0.

# if http_host="0.0.0.0" in config ini, use the host requested by client
if hook_session_config['beef_host'].eql? "0.0.0.0"
hook_session_config['beef_host'] = req_host
hook_session_config['beef_url'].sub!(/0\.0\.0\.0/, req_host)
end

Google Code Issue: http://code.google.com/p/beef/issues/detail?id=287