rapid7/metasploit-framework

View on GitHub

Showing 7,361 of 22,177 total issues

Method initialize has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def initialize(year=0, month=0, day=0, hour=0, minute=0, second=0, neg=false, second_part=0)
Severity: Major
Found in lib/rbmysql.rb - About 1 hr to fix

    Method initialize has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            def initialize(host, port = 21, ssl = nil, ssl_version = nil, proxies = nil, username = '', password = '', verbose = false)
    Severity: Major
    Found in lib/rex/proto/ftp/client.rb - About 1 hr to fix

      Method initialize has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def initialize(host, port = 80, context = {}, ssl = nil, ssl_version = nil, proxies = nil, username = '', password = '', kerberos_authenticator: nil, comm: nil, subscriber: nil)
      Severity: Major
      Found in lib/rex/proto/http/client.rb - About 1 hr to fix

        Method map_port has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          def map_port(udp_sock, host, port, int_port, ext_port, protocol, lifetime, timeout=1)
        Severity: Major
        Found in lib/rex/proto/natpmp/packet.rb - About 1 hr to fix

          Method trans_maxzero has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            def trans_maxzero(pipe, param = '', body = '', setup_count = 0, setup_data = '', no_response = false, do_recv = true, ignore_errors = false)
          Severity: Major
          Found in lib/rex/proto/smb/client.rb - About 1 hr to fix

            Method list_path has 8 arguments (exceeds 4 allowed). Consider refactoring.
            Open

              def list_path(path, columns, sort, order, short, recursive = false, depth = 0, search_term = nil)
            Severity: Major
            Found in lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/fs.rb - About 1 hr to fix

              Method initialize has 8 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                def initialize(recnum, timegen, timewri, id, type, cat, strs, data)

                Method store_loot has 8 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                  def store_loot(ltype, ctype, host, data, filename=nil, info=nil, service=nil, &block)
                Severity: Major
                Found in lib/msf/core/auxiliary/report.rb - About 1 hr to fix

                  Method handle_nessus has 8 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                    def handle_nessus(wspace, hobj, port, nasl, plugin_name, severity, data,task=nil)
                  Severity: Major
                  Found in lib/msf/core/db_manager/import/nessus.rb - About 1 hr to fix

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

                            if user == DIE:
                                in_q.task_done()
                                msg = "check_users thread dying"
                                if MSF:
                                    module.log(msg, "debug")
                    Severity: Major
                    Found in modules/auxiliary/gather/office365userenum.py and 1 other location - About 1 hr to fix
                    modules/auxiliary/gather/office365userenum.py on lines 274..281

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

                    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

                            if result == DIE:
                                out_q.task_done()
                                msg = "report thread dying."
                                if MSF:
                                    module.log(msg, "debug")
                    Severity: Major
                    Found in modules/auxiliary/gather/office365userenum.py and 1 other location - About 1 hr to fix
                    modules/auxiliary/gather/office365userenum.py on lines 202..209

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

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

                      def rid_to_key(rid)
                        s1 = [rid].pack('V')
                        s1 << s1[0, 3]
                    
                        s2b = [rid].pack('V').unpack('C4')
                    Severity: Major
                    Found in modules/post/windows/gather/smart_hashdump.rb and 4 other locations - About 1 hr to fix
                    lib/msf/util/windows_crypto_helpers.rb on lines 123..132
                    modules/post/windows/gather/hashdump.rb on lines 249..257
                    modules/post/windows/manage/hashcarve.rb on lines 158..164
                    scripts/meterpreter/hashdump.rb on lines 199..208

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

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

                    def rid_to_key(rid)
                    
                      s1 = [rid].pack("V")
                      s1 << s1[0,3]
                    
                    
                    Severity: Major
                    Found in scripts/meterpreter/hashdump.rb and 4 other locations - About 1 hr to fix
                    lib/msf/util/windows_crypto_helpers.rb on lines 123..132
                    modules/post/windows/gather/hashdump.rb on lines 249..257
                    modules/post/windows/gather/smart_hashdump.rb on lines 176..184
                    modules/post/windows/manage/hashcarve.rb on lines 158..164

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

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

                      def rid_to_key(rid)
                        s1 = [rid].pack('V')
                        s1 << s1[0, 3]
                    
                        s2b = [rid].pack('V').unpack('C4')
                    Severity: Major
                    Found in modules/post/windows/gather/hashdump.rb and 4 other locations - About 1 hr to fix
                    lib/msf/util/windows_crypto_helpers.rb on lines 123..132
                    modules/post/windows/gather/smart_hashdump.rb on lines 176..184
                    modules/post/windows/manage/hashcarve.rb on lines 158..164
                    scripts/meterpreter/hashdump.rb on lines 199..208

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

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

                      def rid_to_key(rid)
                        s1 = [rid].pack('V')
                        s1 << s1[0, 3]
                        s2b = [rid].pack('V').unpack('C4')
                        s2 = [s2b[3], s2b[0], s2b[1], s2b[2]].pack('C4')
                    Severity: Major
                    Found in modules/post/windows/manage/hashcarve.rb and 4 other locations - About 1 hr to fix
                    lib/msf/util/windows_crypto_helpers.rb on lines 123..132
                    modules/post/windows/gather/hashdump.rb on lines 249..257
                    modules/post/windows/gather/smart_hashdump.rb on lines 176..184
                    scripts/meterpreter/hashdump.rb on lines 199..208

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

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

                      def rid_to_key(rid)
                        # See [2.2.11.1.3 Deriving Key1 and Key2 from a Little-Endian, Unsigned Integer Key](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-samr/b1b0094f-2546-431f-b06d-582158a9f2bb)
                        s1 = [rid].pack('V')
                        s1 << s1[0, 3]
                    
                    
                    Severity: Major
                    Found in lib/msf/util/windows_crypto_helpers.rb and 4 other locations - About 1 hr to fix
                    modules/post/windows/gather/hashdump.rb on lines 249..257
                    modules/post/windows/gather/smart_hashdump.rb on lines 176..184
                    modules/post/windows/manage/hashcarve.rb on lines 158..164
                    scripts/meterpreter/hashdump.rb on lines 199..208

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

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

                      def initialize(info = {})
                        super(merge_info(info,
                         'Name'        => 'Unix Command Shell, Reverse TCP (via Ruby)',
                         'Description' => 'Connect back and create a command shell via Ruby',
                         'Author'      => 'kris katterjohn',
                    Severity: Major
                    Found in modules/payloads/singles/cmd/unix/reverse_ruby.rb and 11 other locations - About 1 hr to fix
                    modules/payloads/singles/cmd/unix/bind_ruby.rb on lines 14..31
                    modules/payloads/singles/cmd/unix/bind_ruby_ipv6.rb on lines 14..31
                    modules/payloads/singles/cmd/unix/reverse_bash_telnet_ssl.rb on lines 14..40
                    modules/payloads/singles/cmd/unix/reverse_ksh.rb on lines 14..34
                    modules/payloads/singles/cmd/unix/reverse_perl.rb on lines 14..35
                    modules/payloads/singles/cmd/unix/reverse_perl_ssl.rb on lines 14..35
                    modules/payloads/singles/cmd/unix/reverse_php_ssl.rb on lines 14..35
                    modules/payloads/singles/cmd/unix/reverse_python_ssl.rb on lines 15..36
                    modules/payloads/singles/cmd/unix/reverse_ruby_ssl.rb on lines 14..31
                    modules/payloads/singles/cmd/windows/bind_ruby.rb on lines 14..31
                    modules/payloads/singles/cmd/windows/reverse_ruby.rb on lines 14..31

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

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

                      def initialize(info = {})
                        super(merge_info(info,
                         'Name'        => 'Unix Command Shell, Reverse TCP (via Ksh)',
                         'Description' => %q{
                            Connect back and create a command shell via Ksh.  Note: Although Ksh is often
                    Severity: Major
                    Found in modules/payloads/singles/cmd/unix/reverse_ksh.rb and 11 other locations - About 1 hr to fix
                    modules/payloads/singles/cmd/unix/bind_ruby.rb on lines 14..31
                    modules/payloads/singles/cmd/unix/bind_ruby_ipv6.rb on lines 14..31
                    modules/payloads/singles/cmd/unix/reverse_bash_telnet_ssl.rb on lines 14..40
                    modules/payloads/singles/cmd/unix/reverse_perl.rb on lines 14..35
                    modules/payloads/singles/cmd/unix/reverse_perl_ssl.rb on lines 14..35
                    modules/payloads/singles/cmd/unix/reverse_php_ssl.rb on lines 14..35
                    modules/payloads/singles/cmd/unix/reverse_python_ssl.rb on lines 15..36
                    modules/payloads/singles/cmd/unix/reverse_ruby.rb on lines 14..31
                    modules/payloads/singles/cmd/unix/reverse_ruby_ssl.rb on lines 14..31
                    modules/payloads/singles/cmd/windows/bind_ruby.rb on lines 14..31
                    modules/payloads/singles/cmd/windows/reverse_ruby.rb on lines 14..31

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

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

                      def initialize(info = {})
                        super(merge_info(info,
                         'Name'          => 'Unix Command Shell, Reverse TCP SSL (via python)',
                         'Description'   => 'Creates an interactive shell via python, uses SSL, encodes with base64 by design.',
                         'Author'        => 'RageLtMan <rageltman[at]sempervictus>',
                    Severity: Major
                    Found in modules/payloads/singles/cmd/unix/reverse_python_ssl.rb and 11 other locations - About 1 hr to fix
                    modules/payloads/singles/cmd/unix/bind_ruby.rb on lines 14..31
                    modules/payloads/singles/cmd/unix/bind_ruby_ipv6.rb on lines 14..31
                    modules/payloads/singles/cmd/unix/reverse_bash_telnet_ssl.rb on lines 14..40
                    modules/payloads/singles/cmd/unix/reverse_ksh.rb on lines 14..34
                    modules/payloads/singles/cmd/unix/reverse_perl.rb on lines 14..35
                    modules/payloads/singles/cmd/unix/reverse_perl_ssl.rb on lines 14..35
                    modules/payloads/singles/cmd/unix/reverse_php_ssl.rb on lines 14..35
                    modules/payloads/singles/cmd/unix/reverse_ruby.rb on lines 14..31
                    modules/payloads/singles/cmd/unix/reverse_ruby_ssl.rb on lines 14..31
                    modules/payloads/singles/cmd/windows/bind_ruby.rb on lines 14..31
                    modules/payloads/singles/cmd/windows/reverse_ruby.rb on lines 14..31

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

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

                      def initialize(info = {})
                        super(merge_info(info,
                         'Name'        => 'Windows Command Shell, Bind TCP (via Ruby)',
                         'Description' => 'Continually listen for a connection and spawn a command shell via Ruby',
                         'Author'      => 'kris katterjohn',
                    Severity: Major
                    Found in modules/payloads/singles/cmd/windows/bind_ruby.rb and 11 other locations - About 1 hr to fix
                    modules/payloads/singles/cmd/unix/bind_ruby.rb on lines 14..31
                    modules/payloads/singles/cmd/unix/bind_ruby_ipv6.rb on lines 14..31
                    modules/payloads/singles/cmd/unix/reverse_bash_telnet_ssl.rb on lines 14..40
                    modules/payloads/singles/cmd/unix/reverse_ksh.rb on lines 14..34
                    modules/payloads/singles/cmd/unix/reverse_perl.rb on lines 14..35
                    modules/payloads/singles/cmd/unix/reverse_perl_ssl.rb on lines 14..35
                    modules/payloads/singles/cmd/unix/reverse_php_ssl.rb on lines 14..35
                    modules/payloads/singles/cmd/unix/reverse_python_ssl.rb on lines 15..36
                    modules/payloads/singles/cmd/unix/reverse_ruby.rb on lines 14..31
                    modules/payloads/singles/cmd/unix/reverse_ruby_ssl.rb on lines 14..31
                    modules/payloads/singles/cmd/windows/reverse_ruby.rb on lines 14..31

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

                    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