rapid7/metasploit-framework

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

Summary

Maintainability
C
1 day
Test Coverage

Method upload_php has 66 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']
    email = opts['email']
Severity: Major
Found in modules/exploits/multi/http/qdpm_authenticated_rce.rb - About 2 hrs to fix

    File qdpm_authenticated_rce.rb has 256 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

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

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

        def initialize(info = {})
          super(
            update_info(
              info,
              'Name' => 'qdPM 9.1 Authenticated Arbitrary PHP File Upload (RCE)',
      Severity: Major
      Found in modules/exploits/multi/http/qdpm_authenticated_rce.rb - About 2 hrs to fix

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

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

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

            def exploit
              uri = normalize_uri(target_uri.path)
              user = datastore['EMAIL']
              pass = datastore['PASSWORD']
              print_status("Attempt to login with '#{user}:#{pass}'")
          Severity: Minor
          Found in modules/exploits/multi/http/qdpm_authenticated_rce.rb - About 1 hr to fix

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

                data = [
                  { 'name' => 'sf_method', 'data' => 'put' },
                  { 'name' => 'users[id]', 'data' => user_id },
                  { 'name' => 'users[photo_preview]', 'data' => '../.htaccess' },
                  { 'name' => 'users[_csrf_token]', 'data' => csrf_token },
            Severity: Minor
            Found in modules/exploits/multi/http/qdpm_authenticated_rce.rb and 1 other location - About 50 mins to fix
            modules/exploits/multi/http/qdpm_authenticated_rce.rb on lines 160..169

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

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

                data = [
                  { 'name' => 'sf_method', 'data' => 'put' },
                  { 'name' => 'users[id]', 'data' => user_id },
                  { 'name' => 'users[photo_preview]', 'data' => '.htaccess' },
                  { 'name' => 'users[_csrf_token]', 'data' => csrf_token },
            Severity: Minor
            Found in modules/exploits/multi/http/qdpm_authenticated_rce.rb and 1 other location - About 50 mins to fix
            modules/exploits/multi/http/qdpm_authenticated_rce.rb on lines 182..191

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

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

              def get_write_exec_payload_win(fname, _data)
                p = Rex::Text.encode_base64(generate_payload_exe)
                php = %|
                <?php
                $f = fopen("#{fname}", "wb");
            Severity: Minor
            Found in modules/exploits/multi/http/qdpm_authenticated_rce.rb and 2 other locations - About 20 mins to fix
            modules/exploits/windows/http/cyclope_ess_sqli.rb on lines 110..121
            modules/exploits/windows/mysql/scrutinizer_upload_exec.rb on lines 85..96

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

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

                send_request_cgi(
                  'method' => 'POST',
                  'uri' => normalize_uri("#{base}/index.php/myAccount/update"),
                  'vars_form_data' => data,
                  'keep_cookies' => true,
            Severity: Minor
            Found in modules/exploits/multi/http/qdpm_authenticated_rce.rb and 2 other locations - About 20 mins to fix
            modules/exploits/multi/http/qdpm_authenticated_rce.rb on lines 193..202
            modules/exploits/multi/http/qdpm_authenticated_rce.rb on lines 215..222

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

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

                send_request_cgi(
                  'method' => 'POST',
                  'uri' => normalize_uri("#{base}/index.php/myAccount/update"),
                  'vars_form_data' => data,
                  'keep_cookies' => true,
            Severity: Minor
            Found in modules/exploits/multi/http/qdpm_authenticated_rce.rb and 2 other locations - About 20 mins to fix
            modules/exploits/multi/http/qdpm_authenticated_rce.rb on lines 171..180
            modules/exploits/multi/http/qdpm_authenticated_rce.rb on lines 215..222

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

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

                res = send_request_cgi({
                  'method' => 'POST',
                  'uri' => normalize_uri("#{base}/index.php/myAccount/update"),
                  'vars_form_data' => data,
                  'keep_cookies' => true,
            Severity: Minor
            Found in modules/exploits/multi/http/qdpm_authenticated_rce.rb and 2 other locations - About 20 mins to fix
            modules/exploits/multi/http/qdpm_authenticated_rce.rb on lines 171..180
            modules/exploits/multi/http/qdpm_authenticated_rce.rb on lines 193..202

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

            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