Skip to content

Fix UnknownAttributeError on NetworkHost.create#3601

Open
sethumadh wants to merge 1 commit into
beefproject:masterfrom
sethumadh:fix/3573-networkhost-port-attribute
Open

Fix UnknownAttributeError on NetworkHost.create#3601
sethumadh wants to merge 1 commit into
beefproject:masterfrom
sethumadh:fix/3573-networkhost-port-attribute

Conversation

@sethumadh

Copy link
Copy Markdown
Contributor

Pull Request

Category

Bug

Feature/Issue Description

Q: Please give a brief summary of your feature/fix
A: Fixes #3573. The get_ntop_network_hosts module crashed when saving a
discovered network host, because it passed a port: value to
NetworkHost.create — but the network_hosts table has no port column. This
raised ActiveModel::UnknownAttributeError at runtime.

Q: Give a technical rundown of what you have changed (if applicable)
A: In modules/network/get_ntop_network_hosts/module.rb, the call on line 34
was passing an attribute that does not exist on the model:

# Before
BeEF::Core::Models::NetworkHost.create(hooked_browser_id: session_id, ip: ip, port: port)
# After
BeEF::Core::Models::NetworkHost.create(hooked_browser_id: session_id, ip: ip)

…osts

The network_hosts table has no 'port' column, so passing port: to
NetworkHost.create raised ActiveModel::UnknownAttributeError. Removed
the invalid port: argument.

Fixes beefproject#3573
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

get_ntop_network_hosts: NetworkHost.create called with non-existent port: attribute

1 participant