rapid7/metasploit-framework

View on GitHub

Showing 22,177 of 22,177 total issues

Method smtp_recv has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
Open

  def smtp_recv(expected_code = nil, expected_data = nil)
    fail_with(Failure::BadConfig, "state is #{@smtp_state}") if @smtp_state != :recv
    @smtp_state = :recving

    failure = catch(:failure) do
Severity: Minor
Found in modules/exploits/linux/smtp/exim_gethostbyname_bof.rb - About 6 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 40 (exceeds 5 allowed). Consider refactoring.
Open

  def run
    opt = {}
    opt['PADDING'] = datastore['PADDING'] if datastore['PADDING']
    opt['FC'] = datastore['FC'] if datastore['FC']
    pids = get_current_data_pids(datastore['CANBUS'], datastore['SRCID'], datastore['DSTID'], opt)
Severity: Minor
Found in modules/post/hardware/automotive/getvinfo.rb - About 6 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 relay has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
Open

      def relay( relay_client, relay_sock )
        @relay_client = relay_client
        @relay_sock   = relay_sock
        # start the relay thread (modified from Rex::IO::StreamAbstraction)
        @relay_thread = Rex::ThreadFactory.spawn("SOCKS4AProxyServerRelay", false) do
Severity: Minor
Found in lib/rex/proto/proxy/socks4a.rb - About 6 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 arista_eos_config_eater has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
Open

    def arista_eos_config_eater(thost, tport, config)

      if framework.db.active
        credential_data = {
          address: thost,
Severity: Minor
Found in lib/msf/core/auxiliary/arista.rb - About 6 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 import_nikto_xml has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
Open

  def import_nikto_xml(args={}, &block)
    data = args[:data]
    wspace = Msf::Util::DBManager.process_opts_workspace(args, framework).name
    bl = validate_ips(args[:blacklist]) ? args[:blacklist].split : []
    doc = rexmlify(data)
Severity: Minor
Found in lib/msf/core/db_manager/import/nikto.rb - About 6 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 ping6 has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
Open

  def ping6(dhost, opts={})
    check_pcaprub_loaded

    dhost_intf = dhost + '%' + ipv6_interface(opts)

Severity: Minor
Found in lib/msf/core/exploit/remote/ipv6.rb - About 6 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 send_request_tgt has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
Open

          def send_request_tgt(options = {})
            realm = options[:realm]
            server_name = options[:server_name] || "krbtgt/#{realm}"
            client_name = options[:client_name]
            client_name = client_name.dup.force_encoding('utf-8') if client_name
Severity: Minor
Found in lib/msf/core/exploit/remote/kerberos/client.rb - About 6 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 asm_reverse_winhttp has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
Open

  def asm_reverse_winhttp(opts={})

    retry_count       = [opts[:retry_count].to_i, 1].max
    verify_ssl        = nil
    encoded_cert_hash = nil
Severity: Minor
Found in lib/msf/core/payload/windows/x64/reverse_win_http_x64.rb - About 6 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 exploit has 152 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def exploit
    target_endpoint = normalize_uri(target_uri.path, datastore['CONFLUENCE_TARGET_ENDPOINT'])

    print_status("Setting the application configuration's setupComplete to false via endpoint: #{target_endpoint}")

    File jenkins_gather.rb has 420 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'nokogiri'
    require 'base64'
    require 'digest'
    require 'openssl'
    require 'sshkey'
    Severity: Minor
    Found in modules/post/multi/gather/jenkins_gather.rb - About 6 hrs to fix

      File reverse_http_x64.rb has 419 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      module Msf
      
      ###
      #
      # Complex payload generation for Windows ARCH_X86 that speak HTTP(S)
      Severity: Minor
      Found in lib/msf/core/payload/windows/x64/reverse_http_x64.rb - About 6 hrs to fix

        Function Signaler has 151 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function Signaler(root, socketURL) {
                var self = this;
        
                root.startBroadcasting = function () {
                    if(!root.MediaStream) throw 'Offerer must have media stream.';
        Severity: Major
        Found in data/webcam/api.js - About 6 hrs to fix

          Method prometheus_config_eater has 151 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def prometheus_config_eater(yamlconf)
                @table_creds = Rex::Text::Table.new(
                  'Header' => 'Credentials',
                  'Indent' => 2,
                  'Columns' =>
          Severity: Major
          Found in lib/msf/core/auxiliary/prometheus.rb - About 6 hrs to fix

            Method asm_reverse_named_pipe has 151 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def asm_reverse_named_pipe(opts={})
            
                #reliable       = opts[:reliable]
                reliable       = false
                retry_count    = [opts[:retry_count].to_i, 1].max
            Severity: Major
            Found in lib/msf/core/payload/windows/x64/reverse_named_pipe_x64.rb - About 6 hrs to fix

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

                def run
                  case session.type
                  when 'meterpreter'
                    meterpreter = true
                  else
              Severity: Major
              Found in modules/post/multi/sap/smdagent_get_properties.rb - About 6 hrs to fix

                Class Sys has 44 methods (exceeds 20 allowed). Consider refactoring.
                Open

                class Console::CommandDispatcher::Stdapi::Sys
                
                  Klass = Console::CommandDispatcher::Stdapi::Sys
                
                  include Console::CommandDispatcher
                Severity: Minor
                Found in lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/sys.rb - About 6 hrs to fix

                  Method cmd_connect has 150 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def cmd_connect(*args)
                      if args.length < 2 or args.include?("-h") or args.include?("--help")
                        cmd_connect_help
                        return false
                      end
                  Severity: Major
                  Found in lib/msf/ui/console/command_dispatcher/core.rb - About 6 hrs to fix

                    Class CommandShell has 44 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                    class CommandShell
                    
                      #
                      # This interface supports basic interaction.
                      #
                    Severity: Minor
                    Found in lib/msf/base/sessions/command_shell.rb - About 6 hrs to fix

                      File lab.rb has 416 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      $LOAD_PATH.unshift(File.join(__dir__, '..', 'lib', 'lab'))
                      
                      require 'yaml'
                      
                      module Msf
                      Severity: Minor
                      Found in plugins/lab.rb - About 6 hrs to fix

                        File splunk_upload_app_exec.rb has 416 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        class MetasploitModule < Msf::Exploit::Remote
                          Rank = GoodRanking
                        
                          include Msf::Exploit::Remote::HttpClient
                        
                        
                        Severity: Minor
                        Found in modules/exploits/multi/http/splunk_upload_app_exec.rb - About 6 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language