rapid7/metasploit-framework

View on GitHub
modules/exploits/windows/http/moveit_cve_2023_34362.rb

Summary

Maintainability
D
2 days
Test Coverage

File moveit_cve_2023_34362.rb has 395 lines of code (exceeds 250 allowed). Consider refactoring.
Open

class MetasploitModule < Msf::Exploit::Remote
  Rank = ExcellentRanking

  prepend Msf::Exploit::Remote::AutoCheck
  include Msf::Exploit::Remote::HttpClient
Severity: Minor
Found in modules/exploits/windows/http/moveit_cve_2023_34362.rb - About 5 hrs to fix

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

      def initialize(info = {})
        super(
          update_info(
            info,
            'Name' => 'MOVEit SQL Injection vulnerability',
    Severity: Major
    Found in modules/exploits/windows/http/moveit_cve_2023_34362.rb - About 2 hrs to fix

      Class MetasploitModule has 22 methods (exceeds 20 allowed). Consider refactoring.
      Open

      class MetasploitModule < Msf::Exploit::Remote
        Rank = ExcellentRanking
      
        prepend Msf::Exploit::Remote::AutoCheck
        include Msf::Exploit::Remote::HttpClient
      Severity: Minor
      Found in modules/exploits/windows/http/moveit_cve_2023_34362.rb - About 2 hrs to fix

        Method check has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

          def check
            res = send_request_cgi({
              'method' => 'GET',
              'uri' => normalize_uri('moveitisapi/moveitisapi.dll?action=capa'),
              'connection' => 'close',
        Severity: Minor
        Found in modules/exploits/windows/http/moveit_cve_2023_34362.rb - About 1 hr 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 moveitv2encrypt has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def moveitv2encrypt(data, org_key, iv = nil, tag = '@%!')
            fail_with(Msf::Exploit::Failure::BadConfig, 'org_key must be 16 bytyes') if org_key.length != 16
        
            if iv.nil?
              iv = Rex::Text.rand_text_alphanumeric(4)
        Severity: Minor
        Found in modules/exploits/windows/http/moveit_cve_2023_34362.rb - About 1 hr to fix

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

            def exploit
              # Get the sessionID and siLockLongTermInstID
              print_status('[01/11] Get the sessionID and siLockLongTermInstID')
              populate_token_instid
              # Allow Remote Access and Create new sysAd
          Severity: Minor
          Found in modules/exploits/windows/http/moveit_cve_2023_34362.rb - About 1 hr to fix

            Avoid too many return statements within this method.
            Open

                return Exploit::CheckCode::Unknown
            Severity: Major
            Found in modules/exploits/windows/http/moveit_cve_2023_34362.rb - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                    return Exploit::CheckCode::Appears if version >= Rex::Version.new('14.1.0') && version < Rex::Version.new('14.1.7')
              Severity: Major
              Found in modules/exploits/windows/http/moveit_cve_2023_34362.rb - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                      return Exploit::CheckCode::Appears if version >= Rex::Version.new('15.0.0') && version < Rex::Version.new('15.0.3')
                Severity: Major
                Found in modules/exploits/windows/http/moveit_cve_2023_34362.rb - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                        return Exploit::CheckCode::Safe
                  Severity: Major
                  Found in modules/exploits/windows/http/moveit_cve_2023_34362.rb - About 30 mins to fix

                    There are no issues that match your filters.

                    Category
                    Status