rapid7/metasploit-framework

View on GitHub

Showing 22,004 of 22,004 total issues

Method crawler_process_page has 109 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def crawler_process_page(t, page, cnt)
    return if page.nil? # Skip over pages that don't contain any info aka page is nil. We can't process these types of pages since there is no data to process.
    msg = "[#{"%.5d" % cnt}/#{"%.5d" % max_page_count}]    #{page ? page.code || "ERR" : "ERR"} - #{t[:vhost]} - #{page.url}"
    if page.error
      print_error("Error accessing page #{page.error.to_s}")
Severity: Major
Found in modules/auxiliary/scanner/http/crawler.rb - About 4 hrs to fix

    Method stage2_html has 109 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def stage2_html(req_uri)
    
        template = <<-EOF
        <html>
        <head>
    Severity: Major
    Found in modules/exploits/windows/browser/ms16_051_vbscript.rb - About 4 hrs to fix

      Method make_js has 109 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def make_js(encoded_payload)
      
          # The following executes a ret2lib using icucnv36.dll
          # The effect is to bypass DEP and execute the shellcode in an indirect way
          stack_data = [
      Severity: Major
      Found in modules/exploits/windows/browser/adobe_cooltype_sing.rb - About 4 hrs to fix

        Method make_js has 109 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def make_js(encoded_payload)
        
            # The following executes a ret2lib using icucnv36.dll
            # The effect is to bypass DEP and execute the shellcode in an indirect way
            stack_data = [
        Severity: Major
        Found in modules/exploits/windows/fileformat/adobe_cooltype_sing.rb - About 4 hrs to fix

          Method system_v has 109 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def system_v(backdoor_path, backdoor_file, runlevel, has_updatercd)
              if has_updatercd
                print_status('Utilizing update-rc.d')
              else
                print_status('Utilizing chkconfig')
          Severity: Major
          Found in modules/exploits/linux/local/service_persistence.rb - About 4 hrs to fix

            Method parse_decrypted_cache has 109 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def parse_decrypted_cache(dec_data, s)
                i = 0
                hash = dec_data[i, 0x10]
                i += 72
            
            
            Severity: Major
            Found in modules/post/windows/gather/cachedump.rb - About 4 hrs to fix

              Method session_setup_with_ntlmssp has 109 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def session_setup_with_ntlmssp(user = '', pass = '', domain = '', name = nil, do_recv = true)
              
                  ntlm_options = {
                      :signing          => self.require_signing,
                      :usentlm2_session => self.usentlm2_session,
              Severity: Major
              Found in lib/rex/proto/smb/client.rb - About 4 hrs to fix

                File cisco_playerpt_setsource_surl.rb has 348 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                class MetasploitModule < Msf::Exploit::Remote
                  Rank = NormalRanking
                
                  include Msf::Exploit::Remote::HttpServer::HTML
                  include Msf::Exploit::Remote::Seh
                Severity: Minor
                Found in modules/exploits/windows/browser/cisco_playerpt_setsource_surl.rb - About 4 hrs to fix

                  File polkit_dbus_auth_bypass.rb has 348 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  require 'unix_crypt'
                  
                  class MetasploitModule < Msf::Exploit::Local
                    Rank = ExcellentRanking
                  
                  
                  Severity: Minor
                  Found in modules/exploits/linux/local/polkit_dbus_auth_bypass.rb - About 4 hrs to fix

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

                      def initialize(info = {})
                        super(merge_info(info,
                          'Name'          => 'Linux Command Shell, Bind TCP Inline',
                          'Description'   => 'Listen for a connection and spawn a command shell',
                          'Author'        => 'Ramon de C Valle',
                    Severity: Major
                    Found in modules/payloads/singles/linux/ppc/shell_bind_tcp.rb and 1 other location - About 4 hrs to fix
                    modules/payloads/singles/linux/ppc64/shell_bind_tcp.rb on lines 15..88

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

                    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 initialize(info = {})
                        super(merge_info(info,
                          'Name'          => 'Linux Command Shell, Bind TCP Inline',
                          'Description'   => 'Listen for a connection and spawn a command shell',
                          'Author'        => 'Ramon de C Valle',
                    Severity: Major
                    Found in modules/payloads/singles/linux/ppc64/shell_bind_tcp.rb and 1 other location - About 4 hrs to fix
                    modules/payloads/singles/linux/ppc/shell_bind_tcp.rb on lines 15..88

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

                    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

                    Class Kiwi has 34 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                    class Console::CommandDispatcher::Kiwi
                    
                      Klass = Console::CommandDispatcher::Kiwi
                    
                      include Console::CommandDispatcher
                    Severity: Minor
                    Found in lib/rex/post/meterpreter/ui/console/command_dispatcher/kiwi.rb - About 4 hrs to fix

                      Class DataStoreWithFallbacks has 34 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                      class DataStoreWithFallbacks
                      
                        # The global framework datastore doesn't currently import options
                        # For now, store an ad-hoc list of keys that the shell handles
                        #
                      Severity: Minor
                      Found in lib/msf/core/data_store_with_fallbacks.rb - About 4 hrs to fix

                        File docker_runc_escape.rb has 347 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        class MetasploitModule < Msf::Exploit::Local
                        
                          Rank = ManualRanking
                        
                          include Msf::Post::Linux::Priv
                        Severity: Minor
                        Found in modules/exploits/linux/local/docker_runc_escape.rb - About 4 hrs to fix

                          File tplink_archer_a7_c7_lan_rce.rb has 347 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          require 'openssl'
                          
                          class MetasploitModule < Msf::Exploit::Remote
                            Rank = ExcellentRanking
                          
                          
                          Severity: Minor
                          Found in modules/exploits/linux/misc/tplink_archer_a7_c7_lan_rce.rb - About 4 hrs to fix

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

                              def run_host(ip)
                                conn = false
                                usecode = datastore['ForceCode']
                            
                                tpath = normalize_uri(datastore['PATH'])
                            Severity: Major
                            Found in modules/auxiliary/scanner/http/web_vulndb.rb - About 4 hrs to fix

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

                                def exploit
                                  unless datastore['AutoCheck']
                                    cookie_jar.clear
                                    res = authenticate
                                    fail_with(Failure::NoAccess, 'Authentication failed') if res&.body =~ %r{<title>ZM - Login</title>}
                              Severity: Major
                              Found in modules/exploits/unix/webapp/zoneminder_lang_exec.rb - About 4 hrs to fix

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

                                  def initialize(info = {})
                                    super(
                                      update_info(
                                        info,
                                        'Name' => 'Gibbon School Platform Authenticated PHP Deserialization Vulnerability',
                                Severity: Major
                                Found in modules/exploits/multi/http/gibbon_auth_rce_cve_2024_24725.rb - About 4 hrs to fix

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

                                    def initialize(info = {})
                                      super(
                                        update_info(
                                          info,
                                          'Name' => 'D-Link Unauthenticated Remote Command Execution using UPnP via a special crafted M-SEARCH packet.',
                                  Severity: Major
                                  Found in modules/exploits/linux/upnp/dlink_upnp_msearch_exec.rb - About 4 hrs to fix

                                    Method report_vuln has 108 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      def report_vuln(opts)
                                        return if not active
                                        raise ArgumentError.new("Missing required option :host") if opts[:host].nil?
                                        raise ArgumentError.new("Deprecated data column for vuln, use .info instead") if opts[:data]
                                        name = opts[:name] || return
                                    Severity: Major
                                    Found in lib/msf/core/db_manager/vuln.rb - About 4 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language