rapid7/metasploit-framework

View on GitHub

Showing 7,361 of 22,177 total issues

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

  def run
    host = session.session_host
    screenshot = Msf::Config.config_directory + '/logs/' + host + '.jpg'

    # If no PID is specified, don't migrate.
Severity: Major
Found in modules/post/windows/gather/screen_spy.rb - About 2 hrs to fix

    Method gather_upstream_passwords has 67 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def gather_upstream_passwords
        print_status('Gathering upstream passwords from MCP')
    
        vprint_status('Trying to fetch LDAP / Active Directory configuration')
        ldap_config = mcp_simple_query('auth_ldap_config') || []
    Severity: Major
    Found in modules/post/linux/gather/f5_loot_mcp.rb - About 2 hrs to fix

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

        def run
          # Opens memory access into the host process
          mypid = client.sys.process.getpid
          @host_process = client.sys.process.open(mypid, PROCESS_ALL_ACCESS)
          @wlanapi = client.railgun.wlanapi
      Severity: Major
      Found in modules/post/windows/wlan/wlan_disconnect.rb - About 2 hrs to fix

        Method send_data has 67 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def send_data(host,port)
            self.status = {:write_allowed => true}
            data_blocks = blockify_file_or_data()
            if data_blocks.empty?
              yield "Closing down since there is no data to send." if block_given?
        Severity: Major
        Found in lib/rex/proto/tftp/client.rb - About 2 hrs to fix

          Method cmd_search has 67 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def cmd_search(*args)
          
              root    = nil
              recurse = true
              globs   = []
          Severity: Major
          Found in lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/fs.rb - About 2 hrs to fix

            Method commands has 67 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def commands
                all = {
                  'clearev'     => 'Clear the event log',
                  'drop_token'  => 'Relinquishes any active impersonation token.',
                  'execute'     => 'Execute a command',
            Severity: Major
            Found in lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/sys.rb - About 2 hrs to fix

              Method migrate has 67 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def migrate(target_pid, writable_dir = nil, opts = {})
                  keepalive              = client.send_keepalives
                  client.send_keepalives = false
                  target_process         = nil
                  current_process        = nil
              Severity: Major
              Found in lib/rex/post/meterpreter/client_core.rb - About 2 hrs to fix

                Method smb_fingerprint_windows_sp has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      def smb_fingerprint_windows_sp(os)
                        sp = ''
                
                        if (os == 'Windows XP')
                          # SRVSVC was blocked in SP2
                Severity: Major
                Found in lib/msf/core/exploit/remote/smb/client.rb - About 2 hrs to fix

                  Method generate_mof has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  def generate_mof(mofname, exe)
                  
                    classname = rand(0xffff).to_s
                  
                    # From Ivan's decompressed version
                  Severity: Major
                  Found in lib/msf/core/exploit/wbem_exec.rb - About 2 hrs to fix

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

                          begin
                            res = send_request_cgi(
                              {
                                'method' => 'POST',
                                'uri'    => normalize_uri(rpath, '/axis2-admin/login'),
                    Severity: Major
                    Found in modules/exploits/multi/http/axis2_deployer.rb and 1 other location - About 2 hrs to fix
                    modules/exploits/multi/http/axis2_deployer.rb on lines 248..278

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

                    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

                        begin
                          res = send_request_cgi(
                            {
                              'method' => 'POST',
                              'uri'    => normalize_uri(rpath, '/axis2-admin/login'),
                    Severity: Major
                    Found in modules/exploits/multi/http/axis2_deployer.rb and 1 other location - About 2 hrs to fix
                    modules/exploits/multi/http/axis2_deployer.rb on lines 284..314

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

                    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 3 locations. Consider refactoring.
                    Open

                      def initialize(info = {})
                        super(update_info(info,
                          'Name'        => 'D-Link DIR615h OS Command Injection',
                          'Description' => %q{
                              Some D-Link Routers are vulnerable to an authenticated OS command injection on
                    Severity: Major
                    Found in modules/exploits/linux/http/dlink_dir615_up_exec.rb and 2 other locations - About 2 hrs to fix
                    modules/exploits/linux/http/linksys_e1500_apply_exec.rb on lines 14..69
                    modules/exploits/linux/http/netgear_dgn1000b_setup_exec.rb on lines 14..71

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

                    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 3 locations. Consider refactoring.
                    Open

                      def initialize(info = {})
                        super(update_info(info,
                          'Name'        => 'Linksys E1500/E2500 apply.cgi Remote Command Injection',
                          'Description' => %q{
                              Some Linksys Routers are vulnerable to an authenticated OS command injection.
                    Severity: Major
                    Found in modules/exploits/linux/http/linksys_e1500_apply_exec.rb and 2 other locations - About 2 hrs to fix
                    modules/exploits/linux/http/dlink_dir615_up_exec.rb on lines 14..72
                    modules/exploits/linux/http/netgear_dgn1000b_setup_exec.rb on lines 14..71

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

                    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 3 locations. Consider refactoring.
                    Open

                      def initialize(info = {})
                        super(update_info(info,
                          'Name'        => 'Netgear DGN1000B setup.cgi Remote Command Execution',
                          'Description' => %q{
                              Some Netgear Routers are vulnerable to authenticated OS Command injection. The
                    Severity: Major
                    Found in modules/exploits/linux/http/netgear_dgn1000b_setup_exec.rb and 2 other locations - About 2 hrs to fix
                    modules/exploits/linux/http/dlink_dir615_up_exec.rb on lines 14..72
                    modules/exploits/linux/http/linksys_e1500_apply_exec.rb on lines 14..69

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

                    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
                        # Sanity check
                        if is_root?
                          fail_with(Failure::None, 'Session already has root privileges')
                        end
                    Severity: Major
                    Found in modules/exploits/linux/local/zimbra_postfix_priv_esc.rb and 1 other location - About 2 hrs to fix
                    modules/exploits/linux/local/zimbra_slapper_priv_esc.rb on lines 67..99

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

                    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
                        res = send_request_cgi({
                                                   'uri' => normalize_uri("configurations.do"),
                                                   'method' => 'GET'
                                               })
                    modules/exploits/windows/http/desktopcentral_file_upload.rb on lines 71..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 97.

                    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
                        # Sanity check
                        if is_root?
                          fail_with(Failure::None, 'Session already has root privileges')
                        end
                    Severity: Major
                    Found in modules/exploits/linux/local/zimbra_slapper_priv_esc.rb and 1 other location - About 2 hrs to fix
                    modules/exploits/linux/local/zimbra_postfix_priv_esc.rb on lines 62..94

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

                    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
                        res = send_request_cgi({
                          'uri' => normalize_uri("configurations.do"),
                          'method' => 'GET'
                        })
                    Severity: Major
                    Found in modules/exploits/windows/http/desktopcentral_file_upload.rb and 1 other location - About 2 hrs to fix
                    modules/exploits/windows/http/desktopcentral_statusupdate_upload.rb on lines 50..86

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

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

                      def initialize(info = {})
                        super(
                          update_info(
                            info,
                            'Name' => 'Microsoft Exchange ProxyLogon Collector',
                    Severity: Major
                    Found in modules/auxiliary/gather/exchange_proxylogon_collector.rb - About 2 hrs to fix

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

                        def run
                          # Check connection and issue initial query
                          print_status("Attempting to connect to the database server at #{rhost}:#{rport} as #{datastore['USERNAME']}...")
                          if mssql_login_datastore
                            print_good('Connected.')
                      Severity: Major
                      Found in modules/auxiliary/admin/mssql/mssql_enum_domain_accounts.rb - About 2 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language