rapid7/metasploit-framework

View on GitHub

Showing 7,361 of 22,177 total issues

Method cmd_load has 88 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def cmd_load(*args)
    if args.length == 0
      args.unshift('-h')
    end

Severity: Major
Found in lib/rex/post/meterpreter/ui/console/command_dispatcher/core.rb - About 3 hrs to fix

    Method login_1 has 88 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def login_1(user, pass, epmp_ver)
        res = send_request_cgi(
          {
            'uri' => '/cgi-bin/luci',
            'method' => 'POST',
    Severity: Major
    Found in lib/msf/core/auxiliary/epmp.rb - About 3 hrs to fix

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

              when /^\s*ppp.*username ([^\s]+) (secret|password) (\d+) ([^\s]+)/i
      
                suser = Regexp.last_match(1)
                stype = Regexp.last_match(3).to_i
                spass = Regexp.last_match(4)
      Severity: Major
      Found in lib/msf/core/auxiliary/cisco.rb and 1 other location - About 3 hrs to fix
      lib/msf/core/auxiliary/cisco.rb on lines 309..339

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

      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

              when /^\s*username ([^\s]+) (secret|password) (\d+) ([^\s]+)/i
                user = Regexp.last_match(1)
                stype = Regexp.last_match(3).to_i
                spass = Regexp.last_match(4)
      
      
      Severity: Major
      Found in lib/msf/core/auxiliary/cisco.rb and 1 other location - About 3 hrs to fix
      lib/msf/core/auxiliary/cisco.rb on lines 368..399

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

      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

        def check
          rversion = spip_version || spip_plugin_version('spip')
          return Exploit::CheckCode::Unknown('Unable to determine the version of SPIP') unless rversion
      
          print_status("SPIP Version detected: #{rversion}")
      Severity: Major
      Found in modules/exploits/multi/http/spip_bigup_unauth_rce.rb and 1 other location - About 3 hrs to fix
      modules/exploits/multi/http/spip_porte_plume_previsu_rce.rb on lines 74..105

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

      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

        def initialize(info = {})
          super(merge_info(info,
            'Name'          => 'Linux Command Shell, Find Port Inline',
            'Description'   => 'Spawn a shell on an established connection',
            'Author'        => 'Ramon de C Valle',
      Severity: Major
      Found in modules/payloads/singles/linux/ppc64/shell_find_port.rb and 1 other location - About 3 hrs to fix
      modules/payloads/singles/linux/ppc/shell_find_port.rb on lines 15..75

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

      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

      var #{j_shellcode} = unescape('#{shellcode}');
      var #{randnop} = "#{nops}";
      var #{j_nops} = unescape(#{randnop});
      var #{j_headersize} = 20;
      var #{j_slackspace} = #{j_headersize} + #{j_shellcode}.length;
      Severity: Major
      Found in modules/exploits/windows/browser/pcvue_func.rb and 1 other location - About 3 hrs to fix
      modules/exploits/windows/browser/novelliprint_callbackurl.rb on lines 115..134

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

      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

            case file.headers['Content-Type']
            when 'text/html'
              case file.body
              when 'jumpurl Secure: "' + datastore['RFILE'] + '" was not a valid file!'
                print_error("File #{datastore['RFILE']} does not exist.")
      Severity: Major
      Found in modules/auxiliary/admin/http/typo3_sa_2009_001.rb and 1 other location - About 3 hrs to fix
      modules/auxiliary/admin/http/typo3_winstaller_default_enc_keys.rb on lines 164..190

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

      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

            case file.headers['Content-Type']
            when 'text/html'
              case file.body
              when 'jumpurl Secure: "' + datastore['RFILE'] + '" was not a valid file!'
                print_error("File #{datastore['RFILE']} does not exist.")
      modules/auxiliary/admin/http/typo3_sa_2009_001.rb on lines 112..138

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

      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

        def check
          rversion = spip_version || spip_plugin_version('spip')
          return Exploit::CheckCode::Unknown('Unable to determine the version of SPIP') unless rversion
      
          print_status("SPIP Version detected: #{rversion}")
      Severity: Major
      Found in modules/exploits/multi/http/spip_porte_plume_previsu_rce.rb and 1 other location - About 3 hrs to fix
      modules/exploits/multi/http/spip_bigup_unauth_rce.rb on lines 85..116

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

      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

          html = %Q|<html>
      <script>
      var #{j_shellcode} = unescape('#{shellcode}');
      var #{randnop} = "#{nops}";
      var #{j_nops} = unescape(#{randnop});
      Severity: Major
      Found in modules/exploits/windows/browser/novelliprint_callbackurl.rb and 1 other location - About 3 hrs to fix
      modules/exploits/windows/browser/pcvue_func.rb on lines 101..121

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

      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

        def initialize(info = {})
          super(merge_info(info,
            'Name'          => 'Linux Command Shell, Find Port Inline',
            'Description'   => 'Spawn a shell on an established connection',
            'Author'        => 'Ramon de C Valle',
      Severity: Major
      Found in modules/payloads/singles/linux/ppc/shell_find_port.rb and 1 other location - About 3 hrs to fix
      modules/payloads/singles/linux/ppc64/shell_find_port.rb on lines 15..75

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

      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

      Method decoder_stub has 87 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def decoder_stub(state)
      
          # add one xor operation for the key (see comment below)
          number_of_passes=state.buf.length/4+1
          raise EncodingError.new("The payload being encoded is too long (#{state.buf.length} bytes)") if number_of_passes > 10240
      Severity: Major
      Found in modules/encoders/mipsbe/longxor.rb - About 3 hrs to fix

        Method decoder_stub has 87 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def decoder_stub(state)
        
            # add one xor operation for the key (see comment below)
            number_of_passes=state.buf.length/4+1
            raise EncodingError.new("The payload being encoded is too long (#{state.buf.length} bytes)") if number_of_passes > 10240
        Severity: Major
        Found in modules/encoders/mipsle/longxor.rb - About 3 hrs to fix

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

            def initialize(info = {})
              super(merge_info(info,
                'Name'          => 'Linux x64 Pingback, Bind TCP Inline',
                'Description'   => 'Accept a connection from attacker and report UUID (Linux x64)',
                'Author'        => [ 'bwatters-r7' ],
          Severity: Major
          Found in modules/payloads/singles/linux/x64/pingback_bind_tcp.rb - About 3 hrs to fix

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

              def initialize(info = {})
                super(
                  update_info(
                    info,
                    'Name' => 'Gitea Git Fetch Remote Code Execution',
            Severity: Major
            Found in modules/exploits/multi/http/gitea_git_fetch_rce.rb - About 3 hrs to fix

              Method upload_exec has 87 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def upload_exec(opts = {})
                  session = opts[:session]
                  app_base = opts[:app_base]
                  jsp_name = opts[:jsp_name]
                  war = opts[:war]
              Severity: Major
              Found in modules/exploits/multi/http/glassfish_deployer.rb - About 3 hrs to fix

                Method gen_resp has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def gen_resp
                    if target.name == 'Windows'
                      pwrshl = cmd_psh_payload(payload.encoded, payload_instance.arch.first, {remove_comspec: true})
                      tmp_dat = pwrshl.each_byte.map {|b| b.to_s(16)}.join
                    else
                Severity: Major
                Found in modules/exploits/multi/misc/weblogic_deserialize.rb - About 3 hrs to fix

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

                    def initialize(info = {})
                      super(
                        update_info(
                          info,
                          'Name' => 'SmarterTools SmarterMail less than build 6985 - .NET Deserialization Remote Code Execution',
                  Severity: Major
                  Found in modules/exploits/windows/http/smartermail_rce.rb - About 3 hrs to fix

                    Method make_js has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def make_js(cli, target_info)
                        # CreateFileMappingA + MapViewOfFile + memcpy rop chain
                        rop_10 = Rex::Text.to_unescape(generate_rop_payload('reader', '', { 'target' => '10' }))
                        rop_11 = Rex::Text.to_unescape(generate_rop_payload('reader', '', { 'target' => '11' }))
                        escaped_payload = Rex::Text.to_unescape(get_payload(cli, target_info))
                    Severity: Major
                    Found in modules/exploits/windows/browser/adobe_toolbutton.rb - About 3 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language