rapid7/metasploit-framework

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

Summary

Maintainability
D
2 days
Test Coverage

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

  def exploit
    vprint_status('Trying to login...')
    # Application Login
    res_auth = send_request_cgi(
      'method' => 'POST',
Severity: Major
Found in modules/exploits/multi/http/uptime_file_upload_2.rb - About 7 hrs to fix

    Method exploit has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
    Open

      def exploit
        vprint_status('Trying to login...')
        # Application Login
        res_auth = send_request_cgi(
          'method' => 'POST',
    Severity: Minor
    Found in modules/exploits/multi/http/uptime_file_upload_2.rb - About 5 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

    File uptime_file_upload_2.rb has 344 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'nokogiri'
    
    class MetasploitModule < Msf::Exploit::Remote
      Rank = ExcellentRanking
    
    
    Severity: Minor
    Found in modules/exploits/multi/http/uptime_file_upload_2.rb - About 4 hrs to fix

      Method create_exec_service has 85 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def create_exec_service(*args)
          cookie_split, rhost, uploadpath, phppath, phpfile_name, cmd, cmdargs = *args
          res_service = send_request_cgi(
            'method' => 'POST',
            'uri'    => normalize_uri(target_uri.path, 'main.php'),
      Severity: Major
      Found in modules/exploits/multi/http/uptime_file_upload_2.rb - About 3 hrs to fix

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

          def initialize(info = {})
            super(update_info(info,
              'Name'            => 'Idera Up.Time Monitoring Station 7.4 post2file.php Arbitrary File Upload',
              'Description'     => %q{
                This module exploits a vulnerability found in Uptime version 7.4.0 and 7.5.0.
        Severity: Minor
        Found in modules/exploits/multi/http/uptime_file_upload_2.rb - About 1 hr to fix

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

            def check
              res = send_request_cgi(
                'method' => 'GET',
                'uri'    => normalize_uri(target_uri.path)
              )
          Severity: Minor
          Found in modules/exploits/multi/http/uptime_file_upload_2.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

          There are no issues that match your filters.

          Category
          Status