Update checkcode usage in aux modules#21268
Merged
adfoster-r7 merged 2 commits intorapid7:masterfrom Apr 13, 2026
Merged
Conversation
c4ac782 to
3aa0194
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes runtime NameError crashes in non-exploit Metasploit modules by ensuring CheckCode references are properly namespaced, and adds a RuboCop lint to prevent reintroducing the issue.
Changes:
- Replaced bare
CheckCode::*usages withExploit::CheckCode::*in affected auxiliary modules. - Added a new RuboCop cop (
Lint/BareCheckCodeInNonExploit) to detect/autocorrect bareCheckCodeusage in auxiliary/post/evasion modules. - Added RSpec coverage for the new RuboCop cop and enabled it via
.rubocop.yml.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| spec/rubocop/cop/lint/bare_check_code_in_non_exploit_spec.rb | Adds tests validating offenses/autocorrections for bare CheckCode in non-exploit modules. |
| lib/rubocop/cop/lint/bare_check_code_in_non_exploit.rb | Implements the new RuboCop cop to flag/autocorrect bare CheckCode in auxiliary/post/evasion. |
| .rubocop.yml | Requires/enables the new cop and scopes it to modules directories. |
| modules/auxiliary/scanner/http/elasticsearch_memory_disclosure.rb | Fixes CheckCode::Unknown to Exploit::CheckCode::Unknown. |
| modules/auxiliary/gather/upsmon_traversal.rb | Prefixes CheckCode returns with Exploit::CheckCode. |
| modules/auxiliary/gather/solarwinds_webhelpdesk_backdoor.rb | Prefixes CheckCode returns with Exploit::CheckCode. |
| modules/auxiliary/gather/pacsserver_traversal.rb | Prefixes CheckCode returns with Exploit::CheckCode. |
| modules/auxiliary/gather/onedev_arbitrary_file_read.rb | Prefixes CheckCode returns with Exploit::CheckCode. |
| modules/auxiliary/gather/magento_xxe_cve_2024_34102.rb | Prefixes CheckCode returns with Exploit::CheckCode. |
| modules/auxiliary/gather/glpi_inventory_plugin_unauth_sqli.rb | Prefixes CheckCode::Unknown return with Exploit::CheckCode::Unknown. |
| modules/auxiliary/gather/gitlab_authenticated_subgroups_file_read.rb | Prefixes CheckCode::Safe return with Exploit::CheckCode::Safe. |
| modules/auxiliary/admin/scada/mypro_mgr_creds.rb | Prefixes CheckCode returns with Exploit::CheckCode. |
| modules/auxiliary/admin/http/whatsup_gold_sqli.rb | Prefixes CheckCode::Unknown returns with Exploit::CheckCode::Unknown. |
| modules/auxiliary/admin/http/idsecure_auth_bypass.rb | Prefixes CheckCode returns with Exploit::CheckCode. |
| modules/auxiliary/admin/http/fortinet_fortiweb_create_admin.rb | Prefixes CheckCode::Unknown return with Exploit::CheckCode::Unknown. |
| modules/auxiliary/admin/dcerpc/cve_2020_1472_zerologon.rb | Prefixes CheckCode returns/comparisons with Exploit::CheckCode. |
sjanusz-r7
approved these changes
Apr 13, 2026
Contributor
Author
Release NotesFixes a crash with a small number of auxiliary modules when the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 a crash when running auxiliary modules that incorrectly reference checkcodes
Specifically it explicitly uses the correct module namespace for the checkcode usage in aux modules, to avoid issues like this:
Local msfconsole usage:
Verification