Merge target info into the module info #20786
Open
+4,553
−5,319
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.
Fixes #20603 by updating the module code to merge the target Arch and Platform entries into the module's top level data. An AI generated script was then used to update all exploit modules to remove redundant entries that are no longer required. As a bonus this also enables Author and References to be included in the target hash and they are also merged up. I then went through and moved a bunch of authors into their targets when there was a comment that made it clear they were the author of one or more specific target. There should be no noticable changes for end users but module authors now don't have to worry about setting the merged module metadata when they already specified it in the target.
The diff was relatively clear before robocop got involved. I recommend reviewing the changes one commit at a time.
Verification
exploit/multi/http/atlassian_confluence_rce_cve_2023_22527as an exampleinfoand see the Platform and Arch data in the module info at the topexploit/multi/script/web_deliveryas an exampleinfosee thatbcolesin particular shows up exactly once as a module authorTZ=UTC tools/automation/cache/build_new_cache.shfrom the framework directorydb/modules_metadata_base.json, see that there are changes but the changes are due to inaccuracies that were previously in the modulesAI refactor code
Including this for future reference but it has served its purpose.