Fix missing #add_static API method #19880
Open
+24
−11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In fcd84a4 I removed the
#add_static
API method without realizing that it was being used by theMsf::Exploit::Remote::DNS::Server
mixin. I don't think it makes sense to revert the change and put it back because having the cache manage static hosts makes less sense now with the new DNS system added last year. This instead updates the mixin to create a record and call the#cache_record
API to effectively do the same thing, enabling it to continue to use the cache as a pseudo static host definition manager. This in turn fixes the bug described in #19591. Theexpire
keyword argument was added to allow the caller to specify if the cached record should expire. In most cases it should, but when it's used for a static definition, it should not.Verification
List the steps needed to make sure this thing works
msfconsole
msfconsole
was run with the necessary privileges)Demo