Skip to content

Conversation

@wheatley
Copy link
Contributor

work in process for the configuration changes relating to public configuration variables

@wheatley wheatley changed the title added spec file for testing changes public_ configuration refactoring Jul 17, 2021
@wheatley
Copy link
Contributor Author

@bcoles / @jcrew99 was thinking about using the existing configuration file beef/core/main/configuration.rb to refactor the public vs local configuration settings

@wheatley wheatley linked an issue Jul 17, 2021 that may be closed by this pull request
@wheatley wheatley added the Core label Jul 17, 2021
@wheatley wheatley self-assigned this Jul 17, 2021
@wheatley
Copy link
Contributor Author

@bcoles and @jcrew99 - could you check the progress of this pull request.

basically centralising the configuration used for the public url variables.

@wheatley wheatley marked this pull request as ready for review August 25, 2021 13:57
@wheatley wheatley requested review from bcoles and jcrew99 August 25, 2021 13:57
Comment on lines 151 to 156
#
# context name for the beef_url_str method when using this
# to say that this is the hook url
def hook_url
beef_url_str
end
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit of a strange API choice as hook_url doesn't include the hook file path portion of the URL.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

happy to change that to append the file path.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A helper for the proto://host:port base URL is useful, as evidenced by the many instances where this helper is used without appending the hook path. My concern is that the API is confusing. hook_url is not the hook URL.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated and appended the hook_file property

beef_port = @configuration.get("beef.http.public_port") || @configuration.get("beef.http.port")
beef_hook = @configuration.get("beef.http.hook_file")
hook_url = "#{beef_proto}://#{beef_host}:#{beef_port}/#{beef_hook}"
hook_url = BeEF::Core::Configuration.instance.hook_url
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a one-for-one replacement as hook_url doesn't include the hook path portion of the URL. I'm not sure if that matters.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ill check that out, and get back to you, I think it joins the hook file later, but I may be wrong

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated and appended the hook_file property

@wheatley
Copy link
Contributor Author

are we keen for a public section under http?

public
host ''
port ''
https true/false

@wheatley wheatley requested review from DeezyE and bcoles September 4, 2021 09:32
@wheatley wheatley changed the base branch from master to feature/1785_public_host_port September 8, 2021 04:49
@wheatley wheatley merged commit 7132a3c into beefproject:feature/1785_public_host_port Sep 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

core/main/client/net.js should use public_host / public_port

3 participants