rapid7/metasploit-framework

View on GitHub

Showing 16,065 of 22,177 total issues

Method upload_file has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  def upload_file
    entity = Rex::Text.rand_text_alpha_lower(3)
    @file_name = Rex::Text.rand_text_alpha_lower(4)
    svg_file = %Q|
    <!DOCTYPE svg [<!ENTITY #{entity} SYSTEM "file://#{datastore['RFILE']}">]>
Severity: Minor
Found in modules/auxiliary/scanner/http/mediawiki_svg_fileaccess.rb - About 45 mins 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 do_request has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  def do_request(after)
    graphql_query = '{"query": "query { users'
    unless after.empty?
      graphql_query += "(after:\\\"#{after}\\\")"
    end
Severity: Minor
Found in modules/auxiliary/scanner/http/gitlab_graphql_user_enum.rb - About 45 mins 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 enum_user has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  def enum_user(user, pass)
    vprint_status("#{rhost}:#{rport} - Trying username:'#{user}' password: '#{pass}'")
    success = false
    data = 'isFromLogonPage=true&cms=127.0.1%3A6400'
    data << "&username=#{Rex::Text.uri_encode(user.to_s)}"
Severity: Minor
Found in modules/auxiliary/scanner/http/sap_businessobjects_user_brute_web.rb - About 45 mins 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 8 (exceeds 5 allowed). Consider refactoring.
Open

  def run_host(ip)
    cred_collection = build_credential_collection(
        username: datastore['USERNAME'],
        password: datastore['PASSWORD']
    )
Severity: Minor
Found in modules/auxiliary/scanner/http/ipboard_login.rb - About 45 mins 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

Avoid deeply nested control flow statements.
Open

                service_name: (ssl ? 'https' : 'http'),
Severity: Major
Found in modules/auxiliary/scanner/http/wordpress_scanner.rb - About 45 mins to fix

    Method do_login has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      def do_login(user, pass)
        #
        # Get a new session ID/token.  That way if we get a successful login,
        # we won't get a false positive due to reusing the same sid/token.
        #
    Severity: Minor
    Found in modules/auxiliary/scanner/http/dolibarr_login.rb - About 45 mins 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 8 (exceeds 5 allowed). Consider refactoring.
    Open

      def run_host(ip)
        # No point to continue if no filename is specified
        if datastore['FILEPATH'].nil? or datastore['FILEPATH'].empty?
          print_error("#{rhost}:#{rport} - Please supply FILEPATH")
          return
    Severity: Minor
    Found in modules/auxiliary/scanner/http/apache_activemq_traversal.rb - About 45 mins 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 accessfile has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      def accessfile(rhost)
        uri = normalize_uri(target_uri.path)
        print_status("#{rhost}:#{rport} Connecting to Crowd SOAP Interface")
    
        soapenv = 'http://schemas.xmlsoap.org/soap/envelope/'
    Severity: Minor
    Found in modules/auxiliary/scanner/http/atlassian_crowd_fileaccess.rb - About 45 mins 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 8 (exceeds 5 allowed). Consider refactoring.
    Open

      def run_host(ip)
        ignored_headers = datastore['IGN_HEADER'].split(',')
    
        uri = normalize_uri(target_uri.path)
        method = datastore['HTTP_METHOD']
    Severity: Minor
    Found in modules/auxiliary/scanner/http/http_header.rb - About 45 mins 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 8 (exceeds 5 allowed). Consider refactoring.
    Open

      def run_host(ip)
        check_code = check
        return unless check_code == Exploit::CheckCode::Appears
    
        f = File.open(datastore['PLUGINS_FILE'], 'rb')
    Severity: Minor
    Found in modules/auxiliary/scanner/http/grafana_plugin_traversal.rb - About 45 mins 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 get_login_cookie has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      def get_login_cookie
        res = send_request_raw({'uri' => datastore['URI']})
    
        uid             = ''
        session_id_port = ''
    Severity: Minor
    Found in modules/auxiliary/scanner/http/splunk_web_login.rb - About 45 mins 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 bruteforce has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      def bruteforce(ip)
        @scanner.scan! do |result|
          case result.status
          when Metasploit::Model::Login::Status::SUCCESSFUL
            print_brute :level => :good, :ip => ip, :msg => "Success: '#{result.credential}'"
    Severity: Minor
    Found in modules/auxiliary/scanner/http/hp_sys_mgmt_login.rb - About 45 mins 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 bruteforce has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      def bruteforce(ip)
        @scanner.scan! do |result|
          case result.status
            when Metasploit::Model::Login::Status::SUCCESSFUL
              print_brute :level => :good, :ip => ip, :msg => "Success: '#{result.credential}'"
    Severity: Minor
    Found in modules/auxiliary/scanner/http/chef_webui_login.rb - About 45 mins 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 8 (exceeds 5 allowed). Consider refactoring.
    Open

      def run_host(ip)
        ports = Rex::Socket.portspec_crack(datastore['PORTS'])
    
        if ports.empty?
          print_error('PORTS options is invalid')
    Severity: Minor
    Found in modules/auxiliary/scanner/http/f5_bigip_virtual_server.rb - About 45 mins 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 rce_check has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      def rce_check(version, real_target: false)
        version_type, clean_version = parse_version(version)
        if version_type == 'unsupported'
          print_error("Invalid version format: `#{version}`. Please provide an existing Nagios XI version or use `unset VERSION` to cancel")
          return
    Severity: Minor
    Found in modules/auxiliary/scanner/http/nagios_xi_scanner.rb - About 45 mins 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 8 (exceeds 5 allowed). Consider refactoring.
    Open

      def run_host(ip)
        vprint_status('Checking if target is online and running Wordpress...')
        fail_with(Failure::BadConfig, 'The target is not online and running Wordpress') unless wordpress_and_online?
        vprint_status('Checking plugin installed and vulnerable')
        checkcode = check_plugin_version_from_readme('bulletproof-security', '5.2')
    Severity: Minor
    Found in modules/auxiliary/scanner/http/wp_bulletproofsecurity_backups.rb - About 45 mins 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 8 (exceeds 5 allowed). Consider refactoring.
    Open

      def run_host(ip)
        uri = target_uri.path
        traversal = "../" * datastore['DEPTH']
        filename = datastore['FILE']
        filename = filename[1, filename.length] if filename =~ /^\//
    Severity: Minor
    Found in modules/auxiliary/scanner/http/servicedesk_plus_traversal.rb - About 45 mins 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 get_version has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      def get_version
        vprint_status('Querying version information...')
        request = {
          'uri' => normalize_uri(target_uri.path),
          'method' => 'GET'
    Severity: Minor
    Found in modules/auxiliary/scanner/http/elasticsearch_memory_disclosure.rb - About 45 mins 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 8 (exceeds 5 allowed). Consider refactoring.
    Open

      def run_host(target_host)
    
        begin
          res = send_request_raw({
            'uri'          => '/<script>alert(1337)</script>', #XST Payload
    Severity: Minor
    Found in modules/auxiliary/scanner/http/trace.rb - About 45 mins 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 8 (exceeds 5 allowed). Consider refactoring.
    Open

      def run_host(ip)
        res = send_request_cgi(
          {
            'uri'       => "/" + Rex::Text.rand_text_alpha(12),
            'method'    => 'GET',
    Severity: Minor
    Found in modules/auxiliary/scanner/http/jboss_vulnscan.rb - About 45 mins 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