File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -613,12 +613,21 @@ def check_print_debug
613
613
# Check for modules registering the DEBUG datastore option
614
614
#
615
615
# @see https://github.com/rapid7/metasploit-framework/issues/3816
616
- def check_datastore_debug
616
+ def check_register_datastore_debug
617
617
if @source =~ /Opt.*\. new\( ["'](?i)DEBUG(?-i)["']/
618
618
error ( 'Please don\'t register a DEBUG datastore option, it has an special meaning and is used for development' )
619
619
end
620
620
end
621
621
622
+ # Check for modules using the DEBUG datastore option
623
+ #
624
+ # @see https://github.com/rapid7/metasploit-framework/issues/3816
625
+ def check_use_datastore_debug
626
+ if @source =~ /datastore\[ ["'](?i)DEBUG(?-i)["']\] /
627
+ error ( 'Please don\'t use the DEBUG datastore option in production, it has an special meaning and is used for development' )
628
+ end
629
+ end
630
+
622
631
private
623
632
624
633
def load_file ( file )
@@ -669,7 +678,8 @@ def run_checks(full_filepath)
669
678
tidy . check_udp_sock_get
670
679
tidy . check_invalid_url_scheme
671
680
tidy . check_print_debug
672
- tidy . check_datastore_debug
681
+ tidy . check_register_datastore_debug
682
+ tidy . check_use_datastore_debug
673
683
return tidy
674
684
end
675
685
You can’t perform that action at this time.
0 commit comments