Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@msutovsky-r7
Copy link
Contributor

Fixes #20864

This PR addresses issue with update_payload_cached_sizes script. There has been some issues and inconsistencies with the script, leading to behavior when developers had to manually update cached sizes of payload, when CI failed. This PR tries to address the issue by unifying the way framework instance is created in CI and in the script. Furthermore, it takes into account the dynamic cached sizes and tries to forbid overwriting cached sizes by multiple payloads (i.e. staggers). As a bonus, it fixes a bug in PHP exec payload.

This is work in progress, the initial fix seems to be working, further tests are necessary.

  • Run the script with multiple modified payloads, the script should updates cached_sizes accordingly
  • Run the script in latest commit, the script should not update any cached sizes
  • Make sure dynamic payloads stay dynamic

@msutovsky-r7 msutovsky-r7 added bug rn-fix release notes fix labels Jan 29, 2026
@msutovsky-r7 msutovsky-r7 marked this pull request as draft January 29, 2026 09:33
@msutovsky-r7 msutovsky-r7 moved this from Todo to In Progress in Metasploit Kanban Jan 29, 2026
# @return [Boolean]
def self.is_cached_size_accurate?(mod)
return true if mod.dynamic_size? && is_dynamic?(mod)
return true if mod.dynamic_size? || is_dynamic?(mod)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you remind me the reason to this logic switch?

# Initialize the simplified framework instance.
framework = Msf::Simple::Framework.create('DisableDatabase' => true)
exceptions = []
framework = Msf::Simple::Framework.create({'DeferModuleLoads' => true})
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this one the change we discussed to avoid having DATASTORE saved with save being fetched by the script?

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

Labels

bug rn-fix release notes fix

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

Payload Cache Size Update Script is Broken

2 participants