rapid7/metasploit-framework

View on GitHub

Showing 7,361 of 22,177 total issues

Method arkeia_info has 119 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def arkeia_info
    connect

    info = { }
    resp = ''
Severity: Major
Found in lib/msf/core/exploit/remote/arkeia.rb - About 4 hrs to fix

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

      def exploit
        # process standard options
        @username = datastore['USERNAME']
        @password = datastore['PASSWORD']
        file_name = datastore['SPLUNK_APP_FILE']
    Severity: Major
    Found in modules/exploits/multi/http/splunk_upload_app_exec.rb - About 4 hrs to fix

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

        def initialize(info = {})
          super(update_info(info,
            'Name'           => 'Cisco Linksys PlayerPT ActiveX Control SetSource sURL Argument Buffer Overflow',
            'Description'    => %q{
                This module exploits a vulnerability found in Cisco Linksys PlayerPT 1.0.0.15
      Severity: Major
      Found in modules/exploits/windows/browser/cisco_playerpt_setsource_surl.rb - About 4 hrs to fix

        Method cmd_execute_bof has 118 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                  def cmd_execute_bof(*args)
                    if args.empty?
                      cmd_execute_bof_help
                      return false
                    end
        Severity: Major
        Found in lib/rex/post/meterpreter/ui/console/command_dispatcher/bofloader.rb - About 4 hrs to fix

          Method cmd_route has 118 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def cmd_route(*args)
              begin
                args << 'print' if args.length == 0
          
                action = args.shift
          Severity: Major
          Found in lib/msf/ui/console/command_dispatcher/core.rb - About 4 hrs to fix

            Method import_nexpose_simplexml has 118 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def import_nexpose_simplexml(args={}, &block)
                bl = validate_ips(args[:blacklist]) ? args[:blacklist].split : []
                wspace = Msf::Util::DBManager.process_opts_workspace(args, framework).name
                if Rex::Parser.nokogiri_loaded
                  parser = "Nokogiri v#{::Nokogiri::VERSION}"
            Severity: Major
            Found in lib/msf/core/db_manager/import/nexpose/simple.rb - About 4 hrs to fix

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

                  content = %Q|<html>
              <object classid='clsid:#{clsid}' id='#{axobj}'></object>
              <script>
              #{j_shellcode}=unescape('#{shellcode}');
              #{j_nops}=unescape('#{nops}');
              Severity: Major
              Found in modules/exploits/windows/browser/aventail_epi_activex.rb and 1 other location - About 4 hrs to fix
              modules/exploits/windows/browser/ebook_flipviewer_fviewerloading.rb on lines 76..92

              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 158.

              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

                  content = %Q|<html>
              <object classid='clsid:BA83FD38-CE14-4DA3-BEF5-96050D55F78A' id='#{vname}'></object>
              <script language='javascript'>
              var #{rand1} = unescape('#{shellcode}');
              var #{randnop} = "#{nops}";
              modules/exploits/windows/browser/aventail_epi_activex.rb on lines 122..143

              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 158.

              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

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

                def exploit
                  def upload_and_compile(filename, file_path, file_content, compile=nil)
                    rm_f "#{file_path}"
                    if not compile.nil?
                      rm_f "#{file_path}.c"
              Severity: Major
              Found in modules/exploits/linux/local/ntfs3g_priv_esc.rb - About 4 hrs to fix

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

                  def run
                    version = get_az_version
                    if version.nil?
                      print_status('Unable to determine az cli version')
                    else
                Severity: Major
                Found in modules/post/multi/gather/azure_cli_creds.rb - About 4 hrs to fix

                  Method generate_malicious_tar has 116 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def generate_malicious_tar
                      mf_file = <<~EOF.strip
                        {
                            "CHECKSUMS": [
                                {
                  Severity: Major
                  Found in modules/exploits/linux/http/vmware_vrli_rce.rb - About 4 hrs to fix

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

                      def run
                        fail_with(Failure::NoAccess, 'Session isnt running as root') unless is_root?
                        case datastore['UseraddMethod']
                        when 'CUSTOM'
                          fail_with(Failure::NotFound, "Cannot find command on path given: #{datastore['UseraddBinary']}") unless check_command_exists?(datastore['UseraddBinary'])
                    Severity: Major
                    Found in modules/post/linux/manage/adduser.rb - About 4 hrs to fix

                      Method to_s has 116 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def to_s(headers_only: false)
                          # Start GET query string
                          qstr = opts['query'] ? opts['query'].dup : ""
                      
                          # Start POST data string
                      Severity: Major
                      Found in lib/rex/proto/http/client_request.rb - About 4 hrs to fix

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

                          def run_host(ip)
                            unless wordpress_and_online?
                              fail_with Failure::NotVulnerable, "#{ip} - Server not online or not detected as wordpress"
                            end
                        
                        
                        Severity: Major
                        Found in modules/auxiliary/scanner/http/wp_total_upkeep_downloader.rb - About 4 hrs to fix

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

                            def initialize(info = {})
                              super(
                                update_info(
                                  info,
                                  'Name' => 'Geutebruck Multiple Remote Command Execution',
                          Severity: Major
                          Found in modules/exploits/linux/http/geutebruck_cmdinject_cve_2021_335xx.rb - About 4 hrs to fix

                            Method import_netsparker_xml has 115 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              def import_netsparker_xml(args={}, &block)
                                data = args[:data]
                                wspace = Msf::Util::DBManager.process_opts_workspace(args, framework).name
                                bl = validate_ips(args[:blacklist]) ? args[:blacklist].split : []
                                addr = nil
                            Severity: Major
                            Found in lib/msf/core/db_manager/import/netsparker.rb - About 4 hrs to fix

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

                                          elif self.__dcomObject == 'ShellBrowserWindow':
                                              # ShellBrowserWindow CLSID (Windows 10, Windows Server 2012R2)
                                              iInterface = dcom.CoCreateInstanceEx(string_to_bin('C08AFD90-F2A1-11D1-8455-00A0C91F3880'), IID_IDispatch)
                                              iMMC = IDispatch(iInterface)
                                              resp = iMMC.GetIDsOfNames(('Document',))
                              Severity: Major
                              Found in modules/auxiliary/scanner/smb/impacket/dcomexec.py and 1 other location - About 4 hrs to fix
                              modules/auxiliary/scanner/smb/impacket/dcomexec.py on lines 150..155

                              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 81.

                              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

                                          elif self.__dcomObject == 'MMC20':
                                              iInterface = dcom.CoCreateInstanceEx(string_to_bin('49B2791A-B1AE-4C90-9B8E-E860BA07F889'), IID_IDispatch)
                                              iMMC = IDispatch(iInterface)
                                              resp = iMMC.GetIDsOfNames(('Document',))
                                              resp = iMMC.Invoke(resp[0], 0x409, DISPATCH_PROPERTYGET, dispParams, 0, [], [])
                              Severity: Major
                              Found in modules/auxiliary/scanner/smb/impacket/dcomexec.py and 1 other location - About 4 hrs to fix
                              modules/auxiliary/scanner/smb/impacket/dcomexec.py on lines 143..149

                              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 81.

                              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

                                def get_dtcs(bus, src_id, dst_id, opt = {})
                                  dtcs = []
                                  unless client.automotive
                                    print_error("Not an automotive hwbridge session")
                                    return {}
                              Severity: Major
                              Found in lib/msf/core/post/hardware/automotive/uds.rb and 1 other location - About 4 hrs to fix
                              lib/msf/core/post/hardware/automotive/uds.rb on lines 469..509

                              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 155.

                              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

                                def get_frozen_dtcs(bus, src_id, dst_id, opt = {})
                                  dtcs = []
                                  unless client.automotive
                                    print_error("Not an automotive hwbridge session")
                                    return {}
                              Severity: Major
                              Found in lib/msf/core/post/hardware/automotive/uds.rb and 1 other location - About 4 hrs to fix
                              lib/msf/core/post/hardware/automotive/uds.rb on lines 387..427

                              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 155.

                              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