rapid7/metasploit-framework

View on GitHub
modules/auxiliary/scanner/oracle/isqlplus_login.rb

Summary

Maintainability
D
1 day
Test Coverage

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

  def do_login(user='DBSNMP', pass='DBSNMP', version=9.0)
    uri = datastore['URI']

    vprint_status("#{msg} Trying username:'#{user}' with password:'#{pass}' with SID '#{sid}'")
    success = false
Severity: Minor
Found in modules/auxiliary/scanner/oracle/isqlplus_login.rb - About 2 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 do_login has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def do_login(user='DBSNMP', pass='DBSNMP', version=9.0)
    uri = datastore['URI']

    vprint_status("#{msg} Trying username:'#{user}' with password:'#{pass}' with SID '#{sid}'")
    success = false
Severity: Major
Found in modules/auxiliary/scanner/oracle/isqlplus_login.rb - About 2 hrs to fix

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

      def initialize
        super(
          'Name'        => 'Oracle iSQL*Plus Login Utility',
          'Description' => %q{
            This module attempts to authenticate against an Oracle ISQL*Plus
    Severity: Minor
    Found in modules/auxiliary/scanner/oracle/isqlplus_login.rb - About 1 hr to fix

      Method detect_oracle_version has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        def detect_oracle_version(res)
          m = res.body.match(/iSQL\*Plus Release (9\.0|9\.1|9\.2|10\.1|10\.2)/)
          oracle_ver = nil
          oracle_ver = 10 if m[1] && m[1] =~ /10/
            oracle_ver = m[1].to_f if m[1] && m[1] =~ /9\.[012]/
      Severity: Minor
      Found in modules/auxiliary/scanner/oracle/isqlplus_login.rb - About 35 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 too many return statements within this method.
      Open

            return :failed
      Severity: Major
      Found in modules/auxiliary/scanner/oracle/isqlplus_login.rb - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

              return :next_user
        Severity: Major
        Found in modules/auxiliary/scanner/oracle/isqlplus_login.rb - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return :abort
          Severity: Major
          Found in modules/auxiliary/scanner/oracle/isqlplus_login.rb - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                  return :abort
            Severity: Major
            Found in modules/auxiliary/scanner/oracle/isqlplus_login.rb - About 30 mins to fix

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

                def run_host(ip)
                  datastore['BLANK_PASSWORDS'] = false # Always
                  ver = get_oracle_version(ip)
                  if not check_oracle_version(ver)
                    print_error "#{msg} Unknown Oracle version, skipping."
              Severity: Minor
              Found in modules/auxiliary/scanner/oracle/isqlplus_login.rb - About 25 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_oracle_version has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                def get_oracle_version(ip)
                  begin
                    res = send_request_cgi({
                      'version' => '1.1',
                      'uri'     => uri,
              Severity: Minor
              Found in modules/auxiliary/scanner/oracle/isqlplus_login.rb - About 25 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

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

                def get_oracle_version(ip)
                  begin
                    res = send_request_cgi({
                      'version' => '1.1',
                      'uri'     => uri,
              Severity: Major
              Found in modules/auxiliary/scanner/oracle/isqlplus_login.rb and 1 other location - About 2 hrs to fix
              modules/auxiliary/scanner/oracle/isqlplus_sidbrute.rb on lines 85..108

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

              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

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

                def detect_oracle_version(res)
                  m = res.body.match(/iSQL\*Plus Release (9\.0|9\.1|9\.2|10\.1|10\.2)/)
                  oracle_ver = nil
                  oracle_ver = 10 if m[1] && m[1] =~ /10/
                    oracle_ver = m[1].to_f if m[1] && m[1] =~ /9\.[012]/
              Severity: Major
              Found in modules/auxiliary/scanner/oracle/isqlplus_login.rb and 1 other location - About 1 hr to fix
              modules/auxiliary/scanner/oracle/isqlplus_sidbrute.rb on lines 111..122

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

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

                def report_cred(opts)
                  service_data = {
                    address: opts[:ip],
                    port: opts[:port],
                    service_name: opts[:service_name],
              Severity: Major
              Found in modules/auxiliary/scanner/oracle/isqlplus_login.rb and 31 other locations - About 1 hr to fix
              modules/auxiliary/admin/misc/sercomm_dump_config.rb on lines 88..111
              modules/auxiliary/admin/scada/advantech_webaccess_dbvisitor_sqli.rb on lines 191..214
              modules/auxiliary/gather/apache_rave_creds.rb on lines 107..130
              modules/auxiliary/gather/d20pass.rb on lines 182..205
              modules/auxiliary/gather/doliwamp_traversal_creds.rb on lines 152..175
              modules/auxiliary/gather/hp_snac_domain_creds.rb on lines 90..113
              modules/auxiliary/gather/windows_deployment_services_shares.rb on lines 196..219
              modules/auxiliary/scanner/couchdb/couchdb_login.rb on lines 76..99
              modules/auxiliary/scanner/dcerpc/windows_deployment_services.rb on lines 214..237
              modules/auxiliary/scanner/http/openmind_messageos_login.rb on lines 72..95
              modules/auxiliary/scanner/http/radware_appdirector_enum.rb on lines 78..101
              modules/auxiliary/scanner/misc/dvr_config_disclosure.rb on lines 147..170
              modules/auxiliary/scanner/misc/dvr_config_disclosure.rb on lines 210..233
              modules/auxiliary/scanner/misc/raysharp_dvr_passwords.rb on lines 36..59
              modules/auxiliary/scanner/misc/rosewill_rxs3211_passwords.rb on lines 84..107
              modules/auxiliary/scanner/openvas/openvas_gsad_login.rb on lines 115..138
              modules/auxiliary/scanner/postgres/postgres_version.rb on lines 51..74
              modules/auxiliary/scanner/rservices/rsh_login.rb on lines 221..244
              modules/auxiliary/scanner/sap/sap_ctc_verb_tampering_user_mgmt.rb on lines 86..109
              modules/auxiliary/scanner/sap/sap_mgmt_con_brute_login.rb on lines 63..86
              modules/auxiliary/scanner/sap/sap_soap_bapi_user_create1.rb on lines 52..75
              modules/auxiliary/scanner/scada/koyo_login.rb on lines 127..150
              modules/auxiliary/server/capture/drda.rb on lines 237..260
              modules/auxiliary/server/capture/ftp.rb on lines 51..74
              modules/auxiliary/server/capture/http.rb on lines 107..130
              modules/auxiliary/server/capture/http_basic.rb on lines 57..80
              modules/auxiliary/server/capture/mysql.rb on lines 127..150
              modules/auxiliary/server/capture/pop3.rb on lines 53..76
              modules/auxiliary/server/capture/postgresql.rb on lines 41..64
              modules/auxiliary/server/capture/sip.rb on lines 105..128
              modules/exploits/linux/http/dlink_dir850l_unauth_exec.rb on lines 69..92

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

              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

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

                def report_isqlplus_service(ip,res)
                  sname = datastore['SSL'] ? 'https' : 'http'
                  report_service(
                    :host => ip,
                    :proto => 'tcp',
              Severity: Minor
              Found in modules/auxiliary/scanner/oracle/isqlplus_login.rb and 1 other location - About 15 mins to fix
              modules/auxiliary/scanner/oracle/isqlplus_sidbrute.rb on lines 176..184

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

              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

              There are no issues that match your filters.

              Category
              Status