rapid7/metasploit-framework

View on GitHub

Showing 7,361 of 22,177 total issues

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

  def run
    if !datastore['SSLServerNameIndication'].nil?
      sni = datastore['SSLServerNameIndication']
      print_status("Connecting to #{rhost}:#{rport} SNI:#{sni}")
    else
Severity: Major
Found in modules/auxiliary/gather/impersonate_ssl.rb - About 5 hrs to fix

    Method run has 126 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_webapps.rb - About 5 hrs to fix

      Method run has 126 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_osx.rb - About 5 hrs to fix

        Method add_constants has 126 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def self.add_constants(const_mgr)
            const_mgr.add_const('MAP_FILE',       0x00)
            const_mgr.add_const('MAP_SHARED',     0x01)
            const_mgr.add_const('MAP_PRIVATE',    0x02)
            const_mgr.add_const('MAP_FIXED',      0x10)

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

            def run
              packet = prepare_packet(true)
          
              sock = connect
              if sock.nil?
          Severity: Major
          Found in modules/auxiliary/gather/trackit_sql_domain_creds.rb - About 5 hrs to fix

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

              def exploit
            
                # Request using a non-existing table first, to retrieve the table prefix
                res = sqli(rand_text_alphanumeric(rand(10)+6))
            
            
            Severity: Major
            Found in modules/exploits/unix/webapp/joomla_contenthistory_sqli_rce.rb - About 5 hrs to fix

              Method make_js has 125 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/browser/adobe_flashplayer_newfunction.rb - About 5 hrs to fix

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

                  def exploit
                    data = fake_login
                
                    print_status("Sending fake login request...")
                    res = send_request_cgi(
                Severity: Major
                Found in modules/exploits/windows/novell/netiq_pum_eval.rb - About 5 hrs to fix

                  Method make_js has 125 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_newfunction.rb - About 5 hrs to fix

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

                            for i in sorted(docs):
                                if i in modules:
                                    print_or_write('+ [x] %s' %(make_link(i.split('metasploit-framework')[1])))
                                else:
                                    print_or_write('+ [ ] %s' %(make_link(i.split('metasploit-framework')[1])))
                    Severity: Major
                    Found in tools/docs/issue_finder.py and 1 other location - About 5 hrs to fix
                    tools/docs/issue_finder.py on lines 93..98

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

                    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

                            for i in sorted(modules):
                                if i in docs:
                                    print_or_write('+ [x] %s' %(make_link(i.split('metasploit-framework')[1])))
                                else:
                                    print_or_write('+ [ ] %s' %(make_link(i.split('metasploit-framework')[1])))
                    Severity: Major
                    Found in tools/docs/issue_finder.py and 1 other location - About 5 hrs to fix
                    tools/docs/issue_finder.py on lines 102..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 86.

                    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

                    <object classid='clsid:22ACD16F-99EB-11D2-9BB3-00400561D975' id='#{pvcalendar}'></object>
                    <script language='javascript'>
                    #{j_shellcode} = unescape('#{shellcode}');
                    #{randnop} = "#{nops}";
                    #{j_nops} = unescape(#{randnop});
                    modules/exploits/windows/browser/autodesk_idrop.rb on lines 89..122

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

                    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

                    module MetasploitModule
                      include Msf::Sessions::MeterpreterOptions
                      include Msf::Sessions::MettleConfig
                    
                      def initialize(info = {})
                    Severity: Major
                    Found in modules/payloads/stages/linux/mipsle/meterpreter.rb and 1 other location - About 5 hrs to fix
                    modules/payloads/stages/linux/mipsbe/meterpreter.rb on lines 8..95

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

                    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>
                    <head>
                    <script language='javascript' defer>
                    function #{j_function}() {
                      #{j_shellcode}=unescape('#{shellcode}');
                    Severity: Major
                    Found in modules/exploits/windows/browser/autodesk_idrop.rb and 1 other location - About 5 hrs to fix
                    modules/exploits/windows/browser/symantec_backupexec_pvcalendar.rb on lines 88..108

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

                    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

                    module MetasploitModule
                      include Msf::Sessions::MeterpreterOptions
                      include Msf::Sessions::MettleConfig
                    
                      def initialize(info = {})
                    Severity: Major
                    Found in modules/payloads/stages/linux/mipsbe/meterpreter.rb and 1 other location - About 5 hrs to fix
                    modules/payloads/stages/linux/mipsle/meterpreter.rb on lines 8..95

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

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

                      def run_host(ip)
                        print_brute(level: :vstatus, ip: ip, msg: 'Starting SMB login bruteforce')
                    
                        domain = datastore['SMBDomain'] || ''
                    
                    
                    Severity: Major
                    Found in modules/auxiliary/scanner/smb/smb_login.rb - About 4 hrs to fix

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

                        def initialize(info = {})
                          super(
                            merge_info(
                              info,
                              'Name' => 'Windows x86 Pingback, Reverse TCP Inline',
                      Severity: Major
                      Found in modules/payloads/singles/windows/pingback_reverse_tcp.rb - About 4 hrs to fix

                        Method generate_rop_chain has 124 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def generate_rop_chain
                            # RAX -> HMODULE GetModuleHandleA(
                            #   ( RCX == *module ) LPCSTR lpModuleName,
                            # );
                            rop_gadgets = [0x0000000140018c42] * 15 # ret
                        Severity: Major
                        Found in modules/exploits/windows/nimsoft/nimcontroller_bof.rb - About 4 hrs to fix

                          Method is_match has 124 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def is_match(params, module_metadata)
                              return true if params.empty?
                          
                              param_hash = params
                          
                          
                          Severity: Major
                          Found in lib/msf/core/modules/metadata/search.rb - About 4 hrs to fix

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

                              def exploit
                                if datastore["NetlinkPID"] and datastore["NetlinkPID"] != 0
                                  netlink_pid = datastore["NetlinkPID"]
                                else
                                  print_status("Attempting to autodetect netlink pid...")
                            Severity: Major
                            Found in modules/exploits/linux/local/udev_netlink.rb - About 4 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language