rapid7/metasploit-framework

View on GitHub

Showing 22,177 of 22,177 total issues

File task_scheduler.rb has 354 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module Msf
  class Post
    module Windows
      #
      # Post module mixin for dealing with Windows Task Scheduler
Severity: Minor
Found in lib/msf/core/post/windows/task_scheduler.rb - About 4 hrs to fix

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

      def run
        found = false
        roots.each do |root|
          break if found
    
    
    Severity: Major
    Found in modules/auxiliary/gather/owncloud_phpinfo_reader.rb - About 4 hrs to fix

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

        def exploit
          version = get_version
      
          # 1: get the cookies, the login_url and the password_form and username form names (they varies between versions)
          res = send_request_cgi({
      Severity: Major
      Found in modules/exploits/multi/http/novell_servicedesk_rce.rb - About 4 hrs to fix

        Method on_request_uri has 112 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def on_request_uri(cli, request)
        
            return if ((p = regenerate_payload(cli)) == nil)
        
            print_status("Sending exploit HTML")
        Severity: Major
        Found in modules/exploits/windows/browser/java_docbase_bof.rb - About 4 hrs to fix

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

            def initialize(info = {})
              super(
                update_info(
                  info,
                  'Name' => 'MS08-068 Microsoft Windows SMB Relay Code Execution',
          Severity: Major
          Found in modules/exploits/windows/smb/smb_relay.rb - About 4 hrs to fix

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

              def exploit
            
                if check != CheckCode::Appears
                  fail_with(Failure::NotVulnerable, 'Target not vulnerable! punt!')
                end
            Severity: Major
            Found in modules/exploits/linux/local/overlayfs_priv_esc.rb - About 4 hrs to fix

              Method token_generation_endpoints has 112 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def token_generation_endpoints
                  %w[
                    /access/file-path-manager/indexing
                    /cm/autodeploy/cluster-software-images/indexing
                    /cm/autodeploy/qkview/indexing
              Severity: Major
              Found in modules/exploits/linux/http/f5_icontrol_rest_ssrf_rce.rb - About 4 hrs to fix

                File session_notifier.rb has 353 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                require 'net/https'
                require 'net/http'
                require 'uri'
                module Msf
                  class Plugin::SessionNotifier < Msf::Plugin
                Severity: Minor
                Found in plugins/session_notifier.rb - About 4 hrs to fix

                  File chaos_rat_xss_to_rce.rb has 353 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  class MetasploitModule < Msf::Exploit::Remote
                    Rank = ExcellentRanking
                  
                    prepend Msf::Exploit::Remote::AutoCheck
                    include Msf::Exploit::Remote::HttpClient
                  Severity: Minor
                  Found in modules/exploits/linux/http/chaos_rat_xss_to_rce.rb - About 4 hrs to fix

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

                      def initialize(info = {})
                        super(update_info(info,
                          'Name'        => 'Borland InterBase isc_create_database() Buffer Overflow',
                          'Description'    => %q{
                            This module exploits a stack buffer overflow in Borland InterBase
                    Severity: Major
                    Found in modules/exploits/windows/misc/ib_isc_create_database.rb and 2 other locations - About 4 hrs to fix
                    modules/exploits/windows/misc/ib_isc_attach_database.rb on lines 12..103
                    modules/exploits/windows/misc/ib_svc_attach.rb on lines 12..103

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

                    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 3 locations. Consider refactoring.
                    Open

                      def initialize(info = {})
                        super(update_info(info,
                          'Name'        => 'Borland InterBase isc_attach_database() Buffer Overflow',
                          'Description'    => %q{
                            This module exploits a stack buffer overflow in Borland InterBase
                    Severity: Major
                    Found in modules/exploits/windows/misc/ib_isc_attach_database.rb and 2 other locations - About 4 hrs to fix
                    modules/exploits/windows/misc/ib_isc_create_database.rb on lines 12..103
                    modules/exploits/windows/misc/ib_svc_attach.rb on lines 12..103

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

                    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 3 locations. Consider refactoring.
                    Open

                      def initialize(info = {})
                        super(update_info(info,
                          'Name'        => 'Borland InterBase SVC_attach() Buffer Overflow',
                          'Description'    => %q{
                            This module exploits a stack buffer overflow in Borland InterBase
                    Severity: Major
                    Found in modules/exploits/windows/misc/ib_svc_attach.rb and 2 other locations - About 4 hrs to fix
                    modules/exploits/windows/misc/ib_isc_attach_database.rb on lines 12..103
                    modules/exploits/windows/misc/ib_isc_create_database.rb on lines 12..103

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

                    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

                    File getcountermeasure.rb has 352 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    session = client
                    @@exec_opts = Rex::Parser::Arguments.new(
                      "-h" => [ false, "Help menu." ],
                      "-k" => [ false, "Kill any AV, HIPS and Third Party Firewall process found." ],
                      "-d" => [ false, "Disable built in Firewall" ]
                    Severity: Minor
                    Found in scripts/meterpreter/getcountermeasure.rb - About 4 hrs to fix

                      File empire_skywalker.rb has 352 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      class MetasploitModule < Msf::Exploit::Remote
                        Rank = ExcellentRanking
                      
                        include Msf::Exploit::Remote::HttpClient
                        include Msf::Exploit::FileDropper
                      Severity: Minor
                      Found in modules/exploits/linux/http/empire_skywalker.rb - About 4 hrs to fix

                        File cisco.rb has 352 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        module Msf
                          ###
                          #
                          # This module provides methods for working with Cisco equipment
                          #
                        Severity: Minor
                        Found in lib/msf/core/auxiliary/cisco.rb - About 4 hrs to fix

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

                            def initialize(info = {})
                              super(merge_info(info,
                                'Name'          => 'Windows x86 Pingback, Bind TCP Inline',
                                'Description'   => 'Open a socket and report UUID when a connection is received (Windows x86)',
                                'Author'        => [ 'bwatters-r7' ],
                          Severity: Major
                          Found in modules/payloads/singles/windows/pingback_bind_tcp.rb - About 4 hrs to fix

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

                              def initialize(info = {})
                                super(
                                  update_info(
                                    info,
                                    'Name' => 'Wordpress File Manager Advanced Shortcode 2.3.2 - Unauthenticated Remote Code Execution through shortcode',
                            Severity: Major
                            Found in modules/exploits/multi/http/wp_plugin_fma_shortcode_unauth_rce.rb - About 4 hrs to fix

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

                                def exploit
                                  return unless check == Exploit::CheckCode::Appears
                              
                                  uri = target_uri.path
                                  vprint_status("#{peer} - Grabbing CSRF token...")
                              Severity: Major
                              Found in modules/exploits/multi/http/phpmyadmin_null_termination_exec.rb - About 4 hrs to fix

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

                                  def exploit
                                      init = send_request_cgi({
                                        'uri' => normalize_uri(target_uri.path, 'index.php')
                                      })
                                
                                
                                Severity: Major
                                Found in modules/exploits/linux/http/sophos_wpa_iface_exec.rb - About 4 hrs to fix

                                  Method win32_rwx_exec_thread has 111 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    def self.win32_rwx_exec_thread(code, block_offset, which_offset='start')
                                      stub_block = Rex::Payloads::Shuffle.from_graphml_file(
                                        File.join(Msf::Config.install_root, 'data', 'shellcode', 'block_api.x86.graphml'),
                                        arch: ARCH_X86,
                                        name: 'api_call'
                                  Severity: Major
                                  Found in lib/msf/util/exe.rb - About 4 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language