rapid7/metasploit-framework

View on GitHub

Showing 7,361 of 22,177 total issues

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

  def initialize(info={})
    super(update_info(info,
      'Name'                => 'Adobe Flash Player ShaderJob Buffer Overflow',
      'Description'         => %q{
        This module exploits a buffer overflow vulnerability related to the ShaderJob workings on
modules/exploits/multi/browser/adobe_flash_shader_drawing_fill.rb on lines 11..89

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

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'          => 'Reverse TCP Stager',
      'Description'   => 'Connect back to the attacker',
      'Author'        =>
Severity: Major
Found in modules/payloads/stagers/linux/mipsbe/reverse_tcp.rb and 1 other location - About 5 hrs to fix
modules/payloads/stagers/linux/mipsle/reverse_tcp.rb on lines 14..104

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

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 exploit has 132 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def exploit
    # Request using a non-existing table first, to retrieve the table prefix
    val = sqli(rand_text_alphanumeric(rand(10)+6), 'check')
    if val.nil?
      fail_with(Failure::Unknown, "#{peer} - Error retrieving table prefix")
Severity: Major
Found in modules/exploits/unix/webapp/joomla_comfields_sqli_rce.rb - About 5 hrs to fix

    Method run has 131 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def run
        if datastore['DEPTH'] < 5
          print_bad('A DEPTH of < 5 is unlikely to succeed as almost all observed installs require 5-11 depth.')
        end
    
    
    Severity: Major
    Found in modules/auxiliary/gather/gitlab_authenticated_subgroups_file_read.rb - About 5 hrs to fix

      Method send_payload_objdata has 131 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def send_payload_objdata
          # basic weblogic ClassTableEntry object (serialized)
          # TODO: WHAT DOES THIS DO?  CAN WE RANDOMIZE ANY OF IT?
          objdata = '056508000000010000001b0000005d0101007372017870737202787000000000'
          objdata << '00000000757203787000000000787400087765626c6f67696375720478700000'
      Severity: Major
      Found in modules/exploits/multi/misc/weblogic_deserialize_marshalledobject.rb - About 5 hrs to fix

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

          def exploit
            peer = "#{rhost}:#{rport}"
        
            if target.name =~ /WMI/
        
        
        Severity: Major
        Found in modules/exploits/windows/http/oracle_btm_writetofile.rb - About 5 hrs to fix

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

            def exploit
              jsp_name = datastore['JSP'] || rand_text_alpha(8+rand(8))
              app_base = datastore['APPBASE'] || rand_text_alpha(8+rand(8))
          
              mytarget = target
          Severity: Major
          Found in modules/exploits/multi/http/jboss_maindeployer.rb - About 5 hrs to fix

            Method send_payload_objdata has 130 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def send_payload_objdata
                shost = srvhost
                if ['0.0.0.0', '127.0.0.1', '::'].include?(shost)
                  shost = Rex::Socket.source_address
                end
            Severity: Major
            Found in modules/exploits/multi/misc/weblogic_deserialize_unicastref.rb - About 5 hrs to fix

              Method search has 130 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def search(args = nil)
                  args ||= {}
              
                  # filtering, scoping, search base
                  # filter: https://tools.ietf.org/html/rfc4511#section-4.5.1.7
              Severity: Major
              Found in lib/rex/proto/ldap.rb - About 5 hrs to fix

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

                  def make_js(encoded_payload)
                
                    # The following executes a ret2lib using BIB.dll
                    # The effect is to bypass DEP and execute the shellcode in an indirect way
                    stack_data = [
                Severity: Major
                Found in modules/exploits/windows/fileformat/adobe_flashplayer_button.rb - About 5 hrs to fix

                  Method run has 128 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def run
                      def check_results(passwords, results, hash_type, method)
                        passwords.each do |password_line|
                          password_line.chomp!
                          next if password_line.blank?
                  Severity: Major
                  Found in modules/auxiliary/analyze/crack_linux.rb - About 5 hrs to fix

                    Method sap_port_info has 128 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def sap_port_info(port)
                    
                        case port.to_s
                    
                        when /^3299$/
                    Severity: Major
                    Found in modules/auxiliary/scanner/sap/sap_router_portscanner.rb - About 5 hrs to fix

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

                        def initialize(info = {})
                          super(
                            update_info(
                              info,
                              'Name' => 'SpamTitan Unauthenticated RCE',
                      Severity: Major
                      Found in modules/exploits/freebsd/webapp/spamtitan_unauth_rce.rb - About 5 hrs to fix

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

                          swagger_path '/api/v1/hosts/{id}' do
                            # Swagger documentation for api/v1/hosts/:id GET
                            operation :get do
                              key :description, 'Return specific host that is stored in the database.'
                              key :tags, [ 'host' ]
                        lib/msf/core/web_services/documentation/api/v1/vuln_api_doc.rb on lines 173..249

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

                        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

                          swagger_path '/api/v1/vulns/{id}' do
                            # Swagger documentation for api/v1/vulns/:id GET
                            operation :get do
                              key :description, 'Return specific vuln that is stored in the database.'
                              key :tags, [ 'vuln' ]
                        lib/msf/core/web_services/documentation/api/v1/host_api_doc.rb on lines 228..304

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

                        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 exploit
                        
                            peer = "#{rhost}:#{rport}"
                        
                            print_status "Ping host..."
                        Severity: Major
                        Found in modules/exploits/windows/misc/hp_operations_agent_coda_8c.rb and 1 other location - About 5 hrs to fix
                        modules/exploits/windows/misc/hp_operations_agent_coda_34.rb on lines 131..204

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

                        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 exploit
                        
                            peer = "#{rhost}:#{rport}"
                        
                            print_status "Ping host..."
                        Severity: Major
                        Found in modules/exploits/windows/misc/hp_operations_agent_coda_34.rb and 1 other location - About 5 hrs to fix
                        modules/exploits/windows/misc/hp_operations_agent_coda_8c.rb on lines 133..206

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

                        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 run has 127 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def run
                            fake_host = datastore['FAKEHOST'] || datastore['HOST']
                            fake_port = datastore['FAKEPORT'] || datastore['PORT']
                            host = datastore['HOST']
                            local_host = datastore['SRVHOST']
                        Severity: Major
                        Found in modules/auxiliary/server/jsse_skiptls_mitm_proxy.rb - About 5 hrs to fix

                          Method arp_poisoning has 127 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def arp_poisoning
                              lsmac = datastore['LOCALSMAC'] || @smac
                              raise 'Local Source Mac is not in correct format' unless is_mac?(lsmac)
                          
                              dhosts_range = Rex::Socket::RangeWalker.new(datastore['DHOSTS'])
                          Severity: Major
                          Found in modules/auxiliary/spoof/arp/arp_poisoning.rb - About 5 hrs to fix

                            Method run_host has 127 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              def run_host(ip)
                                if datastore['RPORT'].blank? || datastore['RPORT'] == 0
                                  smb_services = [
                                    { port: 445, direct: true },
                                    { port: 139, direct: false }
                            Severity: Major
                            Found in modules/auxiliary/scanner/smb/smb_version.rb - About 5 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language