rapid7/metasploit-framework

View on GitHub
modules/exploits/linux/http/goautodial_3_rce_command_injection.rb

Summary

Maintainability
A
2 hrs
Test Coverage

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

  def initialize(info = {})
    super(update_info(info,
      'Name'            => 'GoAutoDial 3.3 Authentication Bypass / Command Injection',
      'Description'     => %q{
        This module exploits a SQL injection flaw in the login functionality for GoAutoDial version 3.3-1406088000 and below, and attempts to perform command injection. This also attempts to retrieve the admin user details, including the cleartext password stored in the underlying database. Command injection will be performed with root privileges.
Severity: Minor
Found in modules/exploits/linux/http/goautodial_3_rce_command_injection.rb - About 1 hr to fix

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

      def exploit
        print_status("#{peer} - Trying SQL injection...")
        res = sqli_auth_bypass
    
        unless res
    Severity: Minor
    Found in modules/exploits/linux/http/goautodial_3_rce_command_injection.rb - About 55 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 check has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

      def check
        res = check_version
    
        unless res
          vprint_error "#{peer} Connection failed"
    Severity: Minor
    Found in modules/exploits/linux/http/goautodial_3_rce_command_injection.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