rapid7/metasploit-framework

View on GitHub
modules/exploits/multi/http/qdpm_upload_exec.rb

Summary

Maintainability
C
7 hrs
Test Coverage

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

  def initialize(info={})
    super(update_info(info,
      'Name'           => "qdPM v7 Arbitrary PHP File Upload Vulnerability",
      'Description'    => %q{
        This module exploits a vulnerability found in qdPM - a web-based project management
Severity: Minor
Found in modules/exploits/multi/http/qdpm_upload_exec.rb - About 1 hr to fix

    Method login has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def login(base, username, password)
        # Login
        res = send_request_cgi({
          'method'    => 'POST',
          'uri'       => normalize_uri("#{base}/index.php/home/login"),
    Severity: Minor
    Found in modules/exploits/multi/http/qdpm_upload_exec.rb - About 1 hr to fix

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

        def exploit
          uri = normalize_uri(target_uri.path)
          uri << '/' if uri[-1,1] != '/'
          base = File.dirname("#{uri}.")
      
      
      Severity: Minor
      Found in modules/exploits/multi/http/qdpm_upload_exec.rb - About 1 hr to fix

        Method upload_php has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def upload_php(base, opts)
            fname       = opts['filename']
            php_payload = opts['data']
            user_id     = opts['user_id']
            group_id    = opts['group_id']
        Severity: Minor
        Found in modules/exploits/multi/http/qdpm_upload_exec.rb - About 1 hr to fix

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

            def on_new_session(cli)
              if cli.type == "meterpreter"
                cli.core.use("stdapi") if not cli.ext.aliases.include?("stdapi")
              end
          
          
          Severity: Minor
          Found in modules/exploits/multi/http/qdpm_upload_exec.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 login has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

            def login(base, username, password)
              # Login
              res = send_request_cgi({
                'method'    => 'POST',
                'uri'       => normalize_uri("#{base}/index.php/home/login"),
          Severity: Minor
          Found in modules/exploits/multi/http/qdpm_upload_exec.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

          There are no issues that match your filters.

          Category
          Status