New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix RPC module.payloads method performance #10746

merged 1 commit into from Oct 5, 2018


None yet
2 participants

mkienow-r7 commented Oct 5, 2018

Fix performance issue observed with the RPC module.payloads method enhancements introduced in #10735. This modifies the generate method for the module instance in order to skip payload generation when the size method is called by Msf::Serializer::Json.dump_module, thus reducing the processing time.


The metrics were computed on system with a 2.9 GHz Intel Core i7.
Total payload module count: 539

Before Fix

Average module instance creation time (s): 0.00303975572047
Average dump_module time (s): 0.023072578849722

After Fix

Average module instance creation time (s): 0.002767567099567
Average dump_module time (s): 0.000430071119357


  • Start msfrpcd: ./msfrpcd -P <password> -f
  • Start msfrpc: ./msfrpc -P <password> -a
  • Run'module.payloads')
  • Verify the call returns a list of payload module names
  • Run'module.payloads', 'name,rank')
  • Verify the call returns a hash of module names as keys to hashes that contain the requested module information fields (key-value pairs)
  • Verify the performance of'module.payloads', 'name,rank') is greatly improved

@busterb busterb self-assigned this Oct 5, 2018


This comment has been minimized.

Show comment
Hide comment

busterb Oct 5, 2018


Clever fix!


busterb commented Oct 5, 2018

Clever fix!

@busterb busterb merged commit 06700ef into rapid7:master Oct 5, 2018

3 checks passed

Metasploit Automation - Sanity Test Execution Successfully completed all tests.
Metasploit Automation - Test Execution Successfully completed all tests.
continuous-integration/travis-ci/pr The Travis CI build passed

busterb added a commit that referenced this pull request Oct 5, 2018

@mkienow-r7 mkienow-r7 deleted the mkienow-r7:fix-rpc-payloads-performance branch Oct 5, 2018

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