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
merged 1 commit into from Oct 5, 2018

Conversation

Projects
None yet
2 participants
@mkienow-r7
Contributor

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.

Metrics

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

Verification

  • Start msfrpcd: ./msfrpcd -P <password> -f
  • Start msfrpc: ./msfrpc -P <password> -a 127.0.0.1
  • Run rpc.call('module.payloads')
  • Verify the call returns a list of payload module names
  • Run rpc.call('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 rpc.call('module.payloads', 'name,rank') is greatly improved

@busterb busterb self-assigned this Oct 5, 2018

@busterb

This comment has been minimized.

Show comment
Hide comment
@busterb

busterb Oct 5, 2018

Contributor

Clever fix!

Contributor

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.
Details
Metasploit Automation - Test Execution Successfully completed all tests.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

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