rapid7/metasploit-framework

View on GitHub

Showing 21,960 of 21,960 total issues

Method process_propfind has 98 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def process_propfind(cli, request)
    path = request.uri
    print_status("PROPFIND #{path}")
    body = ''

Severity: Major
Found in modules/auxiliary/gather/ie_sandbox_findfiles.rb - About 3 hrs to fix

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

      def run_host(ip)
        vprint_status('Attempting user enumeration')
        res = send_request_cgi(
          'uri' => normalize_uri(target_uri.path, 'api', 'index.php', 'v1', 'users'),
          'headers' => {
    Severity: Major
    Found in modules/auxiliary/scanner/http/joomla_api_improper_access_checks.rb - About 3 hrs to fix

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

        def initialize(info = {})
          super(
            update_info(
              info,
              'Name' => 'Atlassian Confluence WebWork OGNL Injection',

        Method upload_payload has 98 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def upload_payload
            uri = target_uri.path
        
            @filename = rand_text_alpha(8+rand(8)) + ".cfm" #numbers is a bad idea
            taskname = rand_text_alpha(8+rand(8)) #numbers is a bad idea
        Severity: Major
        Found in modules/exploits/multi/http/coldfusion_rds_auth_bypass.rb - About 3 hrs to fix

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

            def initialize(info = {})
              super(
                update_info(
                  info,
                  'Name' => 'FreeBSD ip6_setpktopt Use-After-Free Privilege Escalation',
          Severity: Major
          Found in modules/exploits/freebsd/local/ip6_setpktopt_uaf_priv_esc.rb - About 3 hrs to fix

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

              def initialize(info={})
                super(update_info(info,
                  'Name'           => "Aladdin Knowledge System Ltd ChooseFilePath Buffer Overflow",
                  'Description'    => %q{
                      This module exploits a vulnerability found in Aladdin Knowledge System's
            Severity: Major
            Found in modules/exploits/windows/browser/aladdin_choosefilepath_bof.rb - About 3 hrs to fix

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

                def on_request_uri(cli, request)
              
                  agent = request['User-Agent']
                  case request['User-Agent']
                    when /MSIE.*Windows NT 5\.1.*\.NET CLR .*/
              Severity: Major
              Found in modules/exploits/windows/browser/ms10_026_avi_nsamplespersec.rb - About 3 hrs to fix

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

                  def exploit
                
                    overflow = rand_text(target["Offset"])
                    overflow << generate_seh_record(target.ret)
                    overflow << payload.encoded
                Severity: Major
                Found in modules/exploits/windows/fileformat/acdsee_fotoslate_string.rb - About 3 hrs to fix

                  File execute_dotnet_assembly.rb has 330 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  class MetasploitModule < Msf::Post
                  
                    include Msf::Post::File
                    include Msf::Exploit::Retry
                    include Msf::Post::Windows::Priv
                  Severity: Minor
                  Found in modules/post/windows/manage/execute_dotnet_assembly.rb - About 3 hrs to fix

                    Method create_session_key has 98 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        def self.create_session_key(ntlmssp_flags, server_ntlmssp_flags, user, pass, domain, challenge_key,
                                client_challenge = '', ntlm_cli_challenge = '' , opt = {} )
                    
                          usentlm2_session     = opt[:usentlm2_session]    != nil ? opt[:usentlm2_session] : true
                          use_ntlmv2         = opt[:use_ntlmv2]         != nil ? opt[:use_ntlmv2] : false
                    Severity: Major
                    Found in lib/rex/proto/ntlm/utils.rb - About 3 hrs to fix

                      File charset.rb has 330 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      class RbMysql
                        # @!attribute [r] number
                        #   @private
                        # @!attribute [r] name
                        #   @return [String] charset name
                      Severity: Minor
                      Found in lib/rbmysql/charset.rb - About 3 hrs to fix

                        Method cmd_creds_help has 98 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def cmd_creds_help
                            print_line
                            print_line "With no sub-command, list credentials. If an address range is"
                            print_line "given, show only credentials with logins on hosts within that"
                            print_line "range."
                        Severity: Major
                        Found in lib/msf/ui/console/command_dispatcher/creds.rb - About 3 hrs to fix

                          Method f5_config_eater has 98 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              def f5_config_eater(thost, tport, config, store = true)
                          
                                credential_data = {
                                  address: thost,
                                  port: tport,
                          Severity: Major
                          Found in lib/msf/core/auxiliary/f5.rb - About 3 hrs to fix

                            Method asm_reverse_tcp has 98 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              def asm_reverse_tcp(opts={})
                                # TODO: reliability is coming
                                retry_count  = opts[:retry_count]
                                encoded_port = "0x%.8x" % [opts[:port].to_i, 2].pack("vn").unpack("N").first
                                encoded_host = "0x%.8x" % Rex::Socket.addr_aton(opts[:host]||"127.127.127.127").unpack("V").first
                            Severity: Major
                            Found in lib/msf/core/payload/linux/reverse_tcp_x86.rb - About 3 hrs to fix

                              Method asm_bind_tcp has 98 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                def asm_bind_tcp(opts={})
                              
                                  #reliable     = opts[:reliable]
                                  af_inet = 2
                              
                              
                              Severity: Major
                              Found in lib/msf/core/payload/linux/bind_tcp.rb - About 3 hrs to fix

                                Method wmicexec has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                                Open

                                def wmicexec(wmiccmds= nil)
                                  print_status("Running WMIC Commands ....")
                                  i, a = 0, []
                                  @client.response_timeout=120
                                
                                
                                Severity: Minor
                                Found in scripts/meterpreter/winenum.rb - About 3 hrs to fix

                                Cognitive Complexity

                                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                A method's cognitive complexity is based on a few simple rules:

                                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                • Code is considered more complex for each "break in the linear flow of the code"
                                • Code is considered more complex when "flow breaking structures are nested"

                                Further reading

                                Method load_settings_from_config has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                                Open

                                      def load_settings_from_config
                                        config_file = Msf::Config.config_file
                                        ini = Rex::Parser::Ini.new(config_file)
                                        group = ini[name]
                                        if group
                                Severity: Minor
                                Found in plugins/session_notifier.rb - About 3 hrs to fix

                                Cognitive Complexity

                                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                A method's cognitive complexity is based on a few simple rules:

                                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                • Code is considered more complex for each "break in the linear flow of the code"
                                • Code is considered more complex when "flow breaking structures are nested"

                                Further reading

                                Method run has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  def run
                                    sid, cookies = authenticate
                                
                                    left_marker = Rex::Text.rand_text_alpha(5)
                                    right_marker = Rex::Text.rand_text_alpha(5)
                                Severity: Minor
                                Found in modules/auxiliary/gather/zabbix_toggleids_sqli.rb - About 3 hrs to fix

                                Cognitive Complexity

                                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                A method's cognitive complexity is based on a few simple rules:

                                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                • Code is considered more complex for each "break in the linear flow of the code"
                                • Code is considered more complex when "flow breaking structures are nested"

                                Further reading

                                Method scanner_process has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  def scanner_process(data, shost, sport)
                                
                                    head = data.slice!(0,12)
                                
                                    xid, flags, quests, answers, auths, adds = head.unpack('n6')
                                Severity: Minor
                                Found in modules/auxiliary/scanner/netbios/nbname.rb - About 3 hrs to fix

                                Cognitive Complexity

                                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                A method's cognitive complexity is based on a few simple rules:

                                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                • Code is considered more complex for each "break in the linear flow of the code"
                                • Code is considered more complex when "flow breaking structures are nested"

                                Further reading

                                Method run_host has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def run_host(ip)
                                      if datastore['SUBDOM_LIST'] and ::File.file?(datastore['SUBDOM_LIST'])
                                        valstr = IO.readlines(datastore['SUBDOM_LIST']).map {
                                          |e| e.gsub(".#{datastore['DOMAIN']}", "").chomp
                                        }
                                Severity: Minor
                                Found in modules/auxiliary/scanner/http/vhost_scanner.rb - About 3 hrs to fix

                                Cognitive Complexity

                                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                A method's cognitive complexity is based on a few simple rules:

                                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                • Code is considered more complex for each "break in the linear flow of the code"
                                • Code is considered more complex when "flow breaking structures are nested"

                                Further reading

                                Severity
                                Category
                                Status
                                Source
                                Language