rapid7/metasploit-framework

View on GitHub

Showing 7,361 of 22,177 total issues

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

  def on_request_uri(cli, request)

    if target['Method'] == 'automatic'
      mytarget = auto_target(cli, request)
      if (not mytarget)
Severity: Major
Found in modules/exploits/windows/browser/ms10_018_ie_behaviors.rb - About 2 hrs to fix

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

      def exploit
    
        print_status("Retrieving JSESSION ID")
        res = send_request_cgi({
          'method' => 'GET',
    Severity: Major
    Found in modules/exploits/windows/misc/manageengine_eventlog_analyzer_rce.rb - About 2 hrs to fix

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

        def initialize(info = {})
          super(
            update_info(
              info,
              'Name' => 'Linux BPF doubleput UAF Privilege Escalation',
      Severity: Major
      Found in modules/exploits/linux/local/bpf_priv_esc.rb - About 2 hrs to fix

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

          def initialize(info = {})
            super(
              update_info(
                info,
                'Name' => 'Apache OFBiz XML-RPC Java Deserialization',
        Severity: Major
        Found in modules/exploits/linux/http/apache_ofbiz_deserialization.rb - About 2 hrs to fix

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

            def initialize(info = {})
              super(
                update_info(
                  info,
                  'Name' => 'Grandstream UCM62xx IP PBX sendPasswordEmail RCE',
          Severity: Major
          Found in modules/exploits/linux/http/grandstream_ucm62xx_sendemail_rce.rb - About 2 hrs to fix

            Method brute_force_ids has 71 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def brute_force_ids
                # perform a sanity check first
                if @host_id
                  host_ids = [@host_id]
                else
            Severity: Major
            Found in modules/exploits/linux/http/cacti_unauthenticated_cmd_injection.rb - About 2 hrs to fix

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

                def initialize(info = {})
                  super(
                    update_info(
                      info,
                      'Name' => 'Rocket Software Unidata udadmin_server Authentication Bypass',
              Severity: Major
              Found in modules/exploits/linux/misc/unidata_udadmin_auth_bypass.rb - About 2 hrs to fix

                Method smart_hash_dump has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def smart_hash_dump(migrate_system, pwdfile)
                    domain_controller = domain_controller?
                    print_good('Host is a Domain Controller') if domain_controller
                
                    if !is_uac_enabled? || is_admin?
                Severity: Major
                Found in modules/post/windows/gather/smart_hashdump.rb - About 2 hrs to fix

                  Method decrypt_pref has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def decrypt_pref(file_name)
                      file_contents = read_file(file_name)
                      if file_contents.nil? || file_contents.empty?
                        print_status "Skipping empty file: #{file_name}"
                        return []
                  Severity: Major
                  Found in modules/post/windows/gather/credentials/plsql_developer.rb - About 2 hrs to fix

                    Method decrypt_orion_db has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def decrypt_orion_db(csv_dataset)
                        fail_with(Msf::Exploit::Failure::Unknown, 'Dataset contains no column values') unless csv_dataset
                    
                        current_row = 0
                        decrypted_rows = 0
                    Severity: Major
                    Found in modules/post/windows/gather/credentials/solarwinds_orion_dump.rb - About 2 hrs to fix

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

                        def run
                          # Registry key to manipulate
                          reg_key = 'HKLM\\SAM\\SAM\\Domains\\Account\\Users'
                      
                          # Checks privileges of the session, and tries to get SYSTEM privileges if needed.
                      Severity: Major
                      Found in modules/post/windows/manage/rid_hijack.rb - About 2 hrs to fix

                        Method check_ref_identifiers has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def check_ref_identifiers
                            in_super     = false
                            in_refs      = false
                            in_notes     = false
                            cve_assigned = false
                        Severity: Major
                        Found in tools/dev/msftidy.rb - About 2 hrs to fix

                          Method cmd_dump_sms has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def cmd_dump_sms(*args)
                              path = "sms_dump_#{::Time.new.strftime('%Y%m%d%H%M%S')}.txt"
                              dump_sms_opts = Rex::Parser::Arguments.new(
                                '-h' => [ false, 'Help Banner' ],
                                '-o' => [ true, 'Output path for sms list']
                          Severity: Major
                          Found in lib/rex/post/meterpreter/ui/console/command_dispatcher/android.rb - About 2 hrs to fix

                            Method match_processes has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              def match_processes(processes, args, quiet: false)
                            
                                search_proc = nil
                                search_user = nil
                                exact_match = false
                            Severity: Major
                            Found in lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/sys.rb - About 2 hrs to fix

                              Method asm_bind_tcp has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                def asm_bind_tcp(opts={})
                              
                                  reliable      = opts[:reliable]
                                  addr_fam      = 2
                                  sockaddr_size = 16
                              Severity: Major
                              Found in lib/msf/core/payload/windows/bind_tcp.rb - About 2 hrs to fix

                                Method dot154_packet_decode has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  def dot154_packet_decode(packet)
                                    result = {}
                                    offset = 0
                                    pktchop = ['', '', '', '', '', '', [], '']
                                    pktchop[0] = packet[0,2]
                                Severity: Major
                                Found in lib/msf/core/post/hardware/zigbee/utils.rb - About 2 hrs to fix

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

                                      if res && res.code == 303 && res.headers['Location']
                                        location = res.headers['Location']
                                        print_status("#{peer} - Following redirect to [ #{location} ]")
                                        res = send_request_cgi(
                                          'uri'    => location,
                                  Severity: Major
                                  Found in modules/exploits/unix/webapp/joomla_comfields_sqli_rce.rb and 1 other location - About 2 hrs to fix
                                  modules/exploits/unix/webapp/joomla_contenthistory_sqli_rce.rb on lines 197..223

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

                                  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

                                      if sport.to_i == 0
                                        req = Resolv::DNS::Message.new
                                        txt = "spoofprobe-#{$$}#{(rand()*1000000).to_i}.red.metasploit.com"
                                        req.add_question(txt, Resolv::DNS::Resource::IN::TXT)
                                        req.rd = 1
                                  Severity: Major
                                  Found in modules/auxiliary/spoof/dns/bailiwicked_host.rb and 1 other location - About 2 hrs to fix
                                  modules/auxiliary/spoof/dns/bailiwicked_domain.rb on lines 173..195

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

                                  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

                                    def login
                                      login_uri = normalize_uri(target_uri.path, 'login')
                                      res = send_request_cgi('method' =>  'GET', 'uri'  =>  login_uri)
                                      fail_with(Failure::NotFound, 'Failed to access the login page') unless res && res.code == 200
                                  
                                  
                                  Severity: Major
                                  Found in modules/exploits/linux/http/librenms_addhost_cmd_inject.rb and 1 other location - About 2 hrs to fix
                                  modules/exploits/linux/http/librenms_collectd_cmd_inject.rb on lines 78..107

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

                                  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

                                      if res && res.code == 303 && res.headers['Location']
                                        location = res.headers['Location']
                                        print_status("#{peer} - Following redirect to [ #{location} ]")
                                        res = send_request_cgi(
                                          'uri'    => location,
                                  modules/exploits/unix/webapp/joomla_comfields_sqli_rce.rb on lines 203..229

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

                                  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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language