rapid7/metasploit-framework

View on GitHub
modules/exploits/multi/misc/ibm_tm1_unauth_rce.rb

Summary

Maintainability
F
3 days
Test Coverage

File ibm_tm1_unauth_rce.rb has 462 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'openssl'

class MetasploitModule < Msf::Exploit::Remote
  Rank = ExcellentRanking

Severity: Minor
Found in modules/exploits/multi/misc/ibm_tm1_unauth_rce.rb - About 7 hrs to fix

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

      def exploit
        # first let's check if SRVHOST is valid
        if datastore['SRVHOST'] == '0.0.0.0'
          fail_with(Failure::Unknown, 'Please enter a valid IP address for SRVHOST')
        end
    Severity: Minor
    Found in modules/exploits/multi/misc/ibm_tm1_unauth_rce.rb - About 6 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

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

      def exploit
        # first let's check if SRVHOST is valid
        if datastore['SRVHOST'] == '0.0.0.0'
          fail_with(Failure::Unknown, 'Please enter a valid IP address for SRVHOST')
        end
    Severity: Major
    Found in modules/exploits/multi/misc/ibm_tm1_unauth_rce.rb - About 6 hrs to fix

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

        def initialize(info = {})
          super(
            update_info(
              info,
              'Name' => 'IBM TM1 / Planning Analytics Unauthenticated Remote Code Execution',
      Severity: Major
      Found in modules/exploits/multi/misc/ibm_tm1_unauth_rce.rb - About 4 hrs to fix

        Method on_request_uri has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def on_request_uri(cli, request)
            xml_res = %(<?xml version="1.0" encoding="UTF-8"?>
            <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://developer.cognos.com/schemas/dataSourceCommandBlock/1/" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:cm="http://developer.cognos.com/schemas/contentManagerService/1" xmlns:ns10="http://developer.cognos.com/schemas/indexUpdateService/1" xmlns:ns11="http://developer.cognos.com/schemas/jobService/1" xmlns:ns12="http://developer.cognos.com/schemas/metadataService/1" xmlns:ns13="http://developer.cognos.com/schemas/mobileService/1" xmlns:ns14="http://developer.cognos.com/schemas/monitorService/1" xmlns:ns15="http://developer.cognos.com/schemas/planningAdministrationConsoleService/1" xmlns:ns16="http://developer.cognos.com/schemas/planningRuntimeService/1" xmlns:ns17="http://developer.cognos.com/schemas/planningTaskService/1" xmlns:ns18="http://developer.cognos.com/schemas/reportService/1" xmlns:ns19="http://developer.cognos.com/schemas/systemService/1" xmlns:ns2="http://developer.cognos.com/schemas/agentService/1" xmlns:ns3="http://developer.cognos.com/schemas/batchReportService/1" xmlns:ns4="http://developer.cognos.com/schemas/dataIntegrationService/1" xmlns:ns5="http://developer.cognos.com/schemas/dataMovementService/1" xmlns:ns6="http://developer.cognos.com/schemas/deliveryService/1" xmlns:ns7="http://developer.cognos.com/schemas/dispatcher/1" xmlns:ns8="http://developer.cognos.com/schemas/eventManagementService/1" xmlns:ns9="http://developer.cognos.com/schemas/indexSearchService/1">
            <SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
              <cm:queryResponse>
        Severity: Minor
        Found in modules/exploits/multi/misc/ibm_tm1_unauth_rce.rb - About 1 hr to fix

          There are no issues that match your filters.

          Category
          Status