rapid7/metasploit-framework

View on GitHub

Showing 7,287 of 21,960 total issues

Method run has 241 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def run
    vprint_status("#{peer} - Checking ")
    # since we will check res to see if auth was a success, make sure to capture the return
    res = send_request_cgi(
      'uri' => normalize_uri(target_uri.path),
Severity: Major
Found in modules/auxiliary/gather/prometheus_node_exporter_gather.rb - About 1 day to fix

    Method run_host has 240 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def run_host(ip)
        # Force http verb to be upper-case, because otherwise some web servers such as
        # Apache might throw you a 501
        http_method = datastore['METHOD'].upcase
    
    
    Severity: Major
    Found in modules/auxiliary/scanner/http/blind_sql_query.rb - About 1 day to fix

      File message.rb has 566 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      require 'postgres_msf'
      require 'postgres/buffer'
      require 'rex/io/stream'
      
      # Monkeypatch to preserve original code intent
      Severity: Major
      Found in lib/postgres/postgres-pr/message.rb - About 1 day to fix

        File userspec_generic.py has 564 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        #!/usr/bin/python
        '''
        Exploit for CVE-2021-3156 with struct userspec overwrite by sleepya
        
        From https://github.com/worawit/CVE-2021-3156
        Severity: Major
        Found in data/exploits/CVE-2021-3156/userspec_generic.py - About 1 day to fix

          Method initialize has 238 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def initialize(info = {})
              super(
                update_info(
                  info,
                  'Name' => 'Cisco RV110W/RV130(W)/RV215W Routers Management Interface Remote Command Execution',
          Severity: Major
          Found in modules/exploits/linux/http/cve_2019_1663_cisco_rmi_rce.rb - About 1 day to fix

            File client_core.rb has 562 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            require 'rex/post/meterpreter/packet'
            require 'rex/post/meterpreter/core_ids'
            require 'rex/post/meterpreter/extension'
            require 'rex/post/meterpreter/extension_mapper'
            require 'rex/post/meterpreter/client'
            Severity: Major
            Found in lib/rex/post/meterpreter/client_core.rb - About 1 day to fix

              Method run has 237 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def run
                  if ! @telephony_loaded
                    print_error("The Telephony module is not available: #{@telephony_error}")
                    raise RuntimeError, "Telephony not available"
                  end
              Severity: Major
              Found in modules/auxiliary/scanner/telephony/wardial.rb - About 1 day to fix

                File Program.cs has 559 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                using System;
                using System.IO;
                using System.Runtime.InteropServices;
                using System.Text;
                

                  File weblogic_deserialize_unicastref.rb has 558 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  class MetasploitModule < Msf::Exploit::Remote
                    Rank = ExcellentRanking
                  
                    include Msf::Exploit::Remote::Tcp
                    include Msf::Exploit::Remote::TcpServer
                  Severity: Major
                  Found in modules/exploits/multi/misc/weblogic_deserialize_unicastref.rb - About 1 day to fix

                    Method exploit has 234 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def exploit
                        main = %q^
                    /*
                    * Exploit Title: pkexec Race condition (CVE-2011-1485) exploit
                    * Author: xi4oyu
                    Severity: Major
                    Found in modules/exploits/linux/local/pkexec.rb - About 1 day to fix

                      Class Core has 64 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                      class Console::CommandDispatcher::Core
                      
                        include Console::CommandDispatcher
                      
                        #
                      Severity: Major
                      Found in lib/rex/post/meterpreter/ui/console/command_dispatcher/core.rb - About 1 day to fix

                        Class Config has 64 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                        class Config < Hash
                        
                          # The installation's root directory for the distribution
                          InstallRoot = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..'))
                        
                        
                        Severity: Major
                        Found in lib/msf/base/config.rb - About 1 day to fix

                          File nexpose.rb has 553 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          require 'English'
                          require 'nexpose'
                          
                          module Msf
                            Nexpose_yaml = "#{Msf::Config.config_directory}/nexpose.yaml".freeze # location of the nexpose.yml containing saved nexpose creds
                          Severity: Major
                          Found in plugins/nexpose.rb - About 1 day to fix

                            File nexpose_raw_document.rb has 553 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            require "rex/parser/nokogiri_doc_mixin"
                            require "date"
                            
                            module Rex
                              module Parser
                            Severity: Major
                            Found in lib/rex/parser/nexpose_raw_document.rb - About 1 day to fix

                              File weblogic_deserialize_badattr_extcomp.rb has 551 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              class MetasploitModule < Msf::Exploit::Remote
                                Rank = NormalRanking
                              
                                include Msf::Exploit::Remote::Tcp
                                include Msf::Exploit::CmdStager
                              Severity: Major
                              Found in modules/exploits/multi/misc/weblogic_deserialize_badattr_extcomp.rb - About 1 day to fix

                                File client_mixin.rb has 548 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                module Rex
                                module Proto
                                module MSSQL
                                # A base mixin of useful mssql methods for parsing structures etc
                                module ClientMixin
                                Severity: Major
                                Found in lib/rex/proto/mssql/client_mixin.rb - About 1 day to fix

                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                    def make_pdf(js)
                                  
                                      xref = []
                                      eol = "\x0d\x0a"
                                      endobj = "endobj" << eol
                                  modules/exploits/windows/fileformat/adobe_flatedecode_predictor02.rb on lines 172..233

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 292.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                    def make_pdf(js)
                                  
                                      xref = []
                                      eol = "\x0d\x0a"
                                      endobj = "endobj" << eol
                                  modules/exploits/windows/browser/adobe_flatedecode_predictor02.rb on lines 175..236

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 292.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                  class MetasploitModule < Msf::Exploit::Remote
                                    Rank = ExcellentRanking
                                  
                                    include Msf::Exploit::Remote::SSH
                                  
                                  
                                  Severity: Major
                                  Found in modules/exploits/linux/ssh/microfocus_obr_shrboadmin.rb and 1 other location - About 1 day to fix
                                  modules/exploits/linux/ssh/cisco_ucs_scpuser.rb on lines 9..133

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 292.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                  class MetasploitModule < Msf::Exploit::Remote
                                    Rank = ExcellentRanking
                                  
                                    include Msf::Exploit::Remote::SSH
                                  
                                  
                                  Severity: Major
                                  Found in modules/exploits/linux/ssh/cisco_ucs_scpuser.rb and 1 other location - About 1 day to fix
                                  modules/exploits/linux/ssh/microfocus_obr_shrboadmin.rb on lines 9..132

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 292.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language