rapid7/metasploit-framework

View on GitHub

Showing 21,960 of 21,960 total issues

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

  def process_propfind(cli, request)
    path = request.uri
    vprint_status("PROPFIND #{path}")

    if path !~ /\/$/
Severity: Major
Found in modules/exploits/windows/http/sap_host_control_cmd_exec.rb - About 4 hrs to fix

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

      def exploit
        print_status('Obtaining credentails...')
    
        resp = send_request_cgi({
          'uri'      => '/cslog_export.php',
    Severity: Major
    Found in modules/exploits/linux/http/samsung_srv_1670d_upload_exec.rb - About 4 hrs to fix

      File jobs.rb has 336 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      module Msf
        module Ui
          module Console
            module CommandDispatcher
              #
      Severity: Minor
      Found in lib/msf/ui/console/command_dispatcher/jobs.rb - About 4 hrs to fix

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

            for (var i=0; i < nprocs.length; i++) {
                var found = false;
                for (var x=0; x < procs.length; x++) {
                    if (nprocs[i] == procs[x]) {
                        found = true;
        Severity: Major
        Found in external/source/DLLHijackAuditKit/audit.js and 1 other location - About 4 hrs to fix
        external/source/DLLHijackAuditKit/analyze.js on lines 172..182

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

        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

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

                    for (var i=0; i < nprocs.length; i++) {
                        var found = false;
                        for (var x=0; x < procs.length; x++) {
                            if (nprocs[i] == procs[x]) {
                                found = true;
        Severity: Major
        Found in external/source/DLLHijackAuditKit/analyze.js and 1 other location - About 4 hrs to fix
        external/source/DLLHijackAuditKit/audit.js on lines 134..144

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

        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

            sq_bit = Integer(response_data[6].unpack('C').first) & 0b10000000
            response_data = response_data[11..-1] # cut out acpi data
            if sq_bit.eql?(0b10000000)
              ioa = response_data[0..3]
              response_data = response_data[3..-1]
        Severity: Major
        Found in modules/auxiliary/client/iec104/iec104.rb and 1 other location - About 4 hrs to fix
        modules/auxiliary/client/iec104/iec104.rb on lines 277..297

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

        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

                  matches1.each_key do |xref|
                    if masstop
                      print_error('STOPPED.')
                      return
                    end
        Severity: Major
        Found in plugins/wmap.rb and 1 other location - About 4 hrs to fix
        plugins/wmap.rb on lines 565..616

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

        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 send_transform(transform)
            assertion_id = "_#{SecureRandom.uuid}"
            saml = <<~EOS
              <?xml version="1.0" encoding="UTF-8"?>
              <samlp:Response
        modules/exploits/multi/http/manageengine_servicedesk_plus_saml_rce_cve_2022_47966.rb on lines 234..285

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

        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

                  matches3.each_key do |xref|
                    if masstop
                      print_error('STOPPED.')
                      return
                    end
        Severity: Major
        Found in plugins/wmap.rb and 1 other location - About 4 hrs to fix
        plugins/wmap.rb on lines 628..680

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

        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 send_transform(transform)
            assertion_id = "_#{SecureRandom.uuid}"
            saml = <<~EOS
              <?xml version="1.0" encoding="UTF-8"?>
              <samlp:Response
        modules/exploits/windows/http/manageengine_endpoint_central_saml_rce_cve_2022_47966.rb on lines 208..259

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

        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

            sq_bit = Integer(response_data[6].unpack('C').first) & 0b10000000
            response_data = response_data[11..-1] # cut out acpi data
            if sq_bit.eql?(0b10000000)
              ioa = response_data[0..3]
              response_data = response_data[3..-1]
        Severity: Major
        Found in modules/auxiliary/client/iec104/iec104.rb and 1 other location - About 4 hrs to fix
        modules/auxiliary/client/iec104/iec104.rb on lines 252..272

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

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

          def start_exploit_modules()
            @lhost = (datastore['LHOST'] || "0.0.0.0")
        
            @noscript_tests = {}
            @all_tests = {}
        Severity: Major
        Found in modules/auxiliary/server/browser_autopwn.rb - About 4 hrs to fix

          Method process_hash has 101 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def process_hash(entry, attr)
              service_details = {
                workspace_id: myworkspace_id,
                module_fullname: fullname,
                origin_type: :service,
          Severity: Major
          Found in modules/auxiliary/gather/ldap_hashdump.rb - About 4 hrs to fix

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

              def run_host(ip)
                begin
                  snmp = connect_snmp
            
                  epmp_info = ''
            Severity: Major
            Found in modules/auxiliary/scanner/snmp/epmp1000_snmp_loot.rb - About 4 hrs to fix

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

                def run_host(ip)
              
                  data = '<?xml version="1.0" encoding="utf-8" ?>'
                  data << '<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">'
                  data << '<env:Body>'
              Severity: Major
              Found in modules/auxiliary/scanner/sap/sap_soap_th_saprel_disclosure.rb - About 4 hrs to fix

                Method accessfile has 101 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def accessfile
                    print_status("Retrieving the target hostname")
                
                    data = "<?xml version='1.0' encoding='UTF-8'?>" + "\r\n"
                    data << "<wsns0:Envelope" + "\r\n"

                  File xdb_sid_brute.rb has 335 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  class MetasploitModule < Msf::Auxiliary
                    include Msf::Auxiliary::Report
                    include Msf::Exploit::Remote::HttpClient
                    include Msf::Auxiliary::Scanner
                  
                  
                  Severity: Minor
                  Found in modules/auxiliary/scanner/oracle/xdb_sid_brute.rb - About 4 hrs to fix

                    Method get_files_info has 101 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def get_files_info(ip, shares)
                        # Creating a separate file for each IP address's results.
                        detailed_tbl = Rex::Text::Table.new(
                          'Header' => "Spidered results for #{ip}.",
                          'Indent' => 1,
                    Severity: Major
                    Found in modules/auxiliary/scanner/smb/smb_enumshares.rb - About 4 hrs to fix

                      Method upload_xml has 101 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def upload_xml(payload_b64, rand_text, cookies, is_check)
                      
                          if is_check
                            timeout = 20
                          else
                      Severity: Major
                      Found in modules/exploits/multi/http/mantisbt_php_exec.rb - About 4 hrs to fix

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

                          def on_request_uri(cli, request)
                        
                            my_target = ''
                            agent = request.headers['User-Agent']
                        
                        
                        Severity: Major
                        Found in modules/exploits/windows/scada/iconics_webhmi_setactivexguid.rb - About 4 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language