rapid7/metasploit-framework

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

Summary

Maintainability
B
5 hrs
Test Coverage

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

  def initialize(info={})
    super(update_info(info,
      'Name'           => "WikkaWiki 1.3.2 Spam Logging PHP Injection",
      'Description'    => %q{
          This module exploits a vulnerability found in WikkaWiki.  When the spam logging
Severity: Minor
Found in modules/exploits/multi/http/wikka_spam_exec.rb - About 1 hr to fix

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

      def login(cookie)
        # Send a request to the login page so we can obtain some hidden values needed for login
        uri = normalize_uri(@base, "wikka.php") + "?wakka=UserSettings"
        res = send_request_raw({
          'method'  => 'GET',
    Severity: Minor
    Found in modules/exploits/multi/http/wikka_spam_exec.rb - About 1 hr to fix

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

        def inject_exec(cookie)
          # Get the necessary fields in order to post a comment
          res = send_request_raw({
            'method' => 'GET',
            'uri'    => normalize_uri(@base, "wikka.php") + "?wakka=#{datastore['PAGE']}&show_comments=1",
      Severity: Minor
      Found in modules/exploits/multi/http/wikka_spam_exec.rb - About 1 hr to fix

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

          def login(cookie)
            # Send a request to the login page so we can obtain some hidden values needed for login
            uri = normalize_uri(@base, "wikka.php") + "?wakka=UserSettings"
            res = send_request_raw({
              'method'  => 'GET',
        Severity: Minor
        Found in modules/exploits/multi/http/wikka_spam_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

        There are no issues that match your filters.

        Category
        Status