rapid7/metasploit-framework

View on GitHub

Showing 7,301 of 22,004 total issues

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

  def exploit
    #
    # Connect and grab the banner
    #
    ehlo = datastore['EHLO_NAME']
Severity: Major
Found in modules/exploits/unix/smtp/exim4_string_format.rb - About 7 hrs to fix

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

      def generate_link(unc)
        uni_unc = unc.unpack('C*').pack('v*')
        path = ''
        path << [
          0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x00,
    modules/exploits/windows/browser/ms10_046_shortcut_icon_dllloader.rb on lines 373..415
    modules/exploits/windows/fileformat/ms15_020_shortcut_icon_dllloader.rb on lines 115..158
    modules/exploits/windows/smb/ms15_020_shortcut_icon_dllloader.rb on lines 93..135

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

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

      def generate_link(unc)
        uni_unc = unc.unpack('C*').pack('v*')
        path = ''
        path << [
          0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x00,
    modules/exploits/windows/browser/ms10_046_shortcut_icon_dllloader.rb on lines 373..415
    modules/exploits/windows/fileformat/ms15_020_shortcut_icon_dllloader.rb on lines 115..158
    modules/exploits/windows/smb/ms10_046_shortcut_icon_dllloader.rb on lines 80..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 230.

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

      def generate_link(unc)
        uni_unc = unc.unpack("C*").pack("v*")
        path = ''
        path << [
          0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x00,
    modules/exploits/windows/fileformat/ms15_020_shortcut_icon_dllloader.rb on lines 115..158
    modules/exploits/windows/smb/ms10_046_shortcut_icon_dllloader.rb on lines 80..122
    modules/exploits/windows/smb/ms15_020_shortcut_icon_dllloader.rb on lines 93..135

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

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

      def generate_link(unc)
        uni_unc = unc.unpack('C*').pack('v*')
        path = ''
        path << [
          0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x00,
    modules/exploits/windows/browser/ms10_046_shortcut_icon_dllloader.rb on lines 373..415
    modules/exploits/windows/smb/ms10_046_shortcut_icon_dllloader.rb on lines 80..122
    modules/exploits/windows/smb/ms15_020_shortcut_icon_dllloader.rb on lines 93..135

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

    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

    class MetasploitModule < Msf::Encoder::Xor
      Rank = NormalRanking
    
      def initialize
        super(
    Severity: Major
    Found in modules/encoders/mipsle/byte_xori.rb and 1 other location - About 7 hrs to fix
    modules/encoders/mipsbe/byte_xori.rb on lines 8..146

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

    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

    class MetasploitModule < Msf::Encoder::Xor
      Rank = NormalRanking
    
      def initialize
        super(
    Severity: Major
    Found in modules/encoders/mipsbe/byte_xori.rb and 1 other location - About 7 hrs to fix
    modules/encoders/mipsle/byte_xori.rb on lines 8..146

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

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

      def initialize(info = {})
        super(update_info(info,
          'Name'           => 'PHP 4 unserialize() ZVAL Reference Counter Overflow (Cookie)',
          'Description'    => %q{
              This module exploits an integer overflow vulnerability in the unserialize()
    Severity: Major
    Found in modules/exploits/multi/php/php_unserialize_zval_cookie.rb - About 7 hrs to fix

      Method creds_search has 177 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def creds_search(*args)
          host_ranges   = []
          origin_ranges = []
          port_ranges   = []
          svcs          = []
      Severity: Major
      Found in lib/msf/ui/console/command_dispatcher/creds.rb - About 7 hrs to fix

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

          def make_pdf(js)
        
            xref = []
            eol = "\x0d\x0a"
            endobj = "endobj" << eol
        modules/exploits/windows/browser/adobe_geticon.rb on lines 166..202
        modules/exploits/windows/browser/adobe_media_newplayer.rb on lines 181..218
        modules/exploits/windows/browser/adobe_utilprintf.rb on lines 145..182
        modules/exploits/windows/fileformat/adobe_collectemailinfo.rb on lines 139..176
        modules/exploits/windows/fileformat/adobe_utilprintf.rb on lines 136..173

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

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

          def make_pdf(js)
        
            xref = []
            eol = "\x0d\x0a"
            endobj = "endobj" << eol
        Severity: Major
        Found in modules/exploits/windows/fileformat/adobe_utilprintf.rb and 5 other locations - About 7 hrs to fix
        modules/exploits/windows/browser/adobe_geticon.rb on lines 166..202
        modules/exploits/windows/browser/adobe_media_newplayer.rb on lines 181..218
        modules/exploits/windows/browser/adobe_utilprintf.rb on lines 145..182
        modules/exploits/windows/fileformat/adobe_collectemailinfo.rb on lines 139..176
        modules/exploits/windows/fileformat/adobe_media_newplayer.rb on lines 184..220

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

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

          def make_pdf(js)
        
            xref = []
            eol = "\x0d\x0a"
            endobj = "endobj" << eol
        Severity: Major
        Found in modules/exploits/windows/browser/adobe_geticon.rb and 5 other locations - About 7 hrs to fix
        modules/exploits/windows/browser/adobe_media_newplayer.rb on lines 181..218
        modules/exploits/windows/browser/adobe_utilprintf.rb on lines 145..182
        modules/exploits/windows/fileformat/adobe_collectemailinfo.rb on lines 139..176
        modules/exploits/windows/fileformat/adobe_media_newplayer.rb on lines 184..220
        modules/exploits/windows/fileformat/adobe_utilprintf.rb on lines 136..173

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

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

          def make_pdf(js)
        
            xref = []
            eol = "\x0d\x0a"
            endobj = "endobj" << eol
        Severity: Major
        Found in modules/exploits/windows/browser/adobe_media_newplayer.rb and 5 other locations - About 7 hrs to fix
        modules/exploits/windows/browser/adobe_geticon.rb on lines 166..202
        modules/exploits/windows/browser/adobe_utilprintf.rb on lines 145..182
        modules/exploits/windows/fileformat/adobe_collectemailinfo.rb on lines 139..176
        modules/exploits/windows/fileformat/adobe_media_newplayer.rb on lines 184..220
        modules/exploits/windows/fileformat/adobe_utilprintf.rb on lines 136..173

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

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

          def make_pdf(js)
        
            xref = []
            eol = "\x0d\x0a"
            endobj = "endobj" << eol
        modules/exploits/windows/browser/adobe_geticon.rb on lines 166..202
        modules/exploits/windows/browser/adobe_media_newplayer.rb on lines 181..218
        modules/exploits/windows/browser/adobe_utilprintf.rb on lines 145..182
        modules/exploits/windows/fileformat/adobe_media_newplayer.rb on lines 184..220
        modules/exploits/windows/fileformat/adobe_utilprintf.rb on lines 136..173

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

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

          def make_pdf(js)
        
            xref = []
            eol = "\x0d\x0a"
            endobj = "endobj" << eol
        Severity: Major
        Found in modules/exploits/windows/browser/adobe_utilprintf.rb and 5 other locations - About 7 hrs to fix
        modules/exploits/windows/browser/adobe_geticon.rb on lines 166..202
        modules/exploits/windows/browser/adobe_media_newplayer.rb on lines 181..218
        modules/exploits/windows/fileformat/adobe_collectemailinfo.rb on lines 139..176
        modules/exploits/windows/fileformat/adobe_media_newplayer.rb on lines 184..220
        modules/exploits/windows/fileformat/adobe_utilprintf.rb on lines 136..173

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

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

          def exploit
            vprint_status('Trying to login...')
            # Application Login
            res_auth = send_request_cgi(
              'method' => 'POST',
        Severity: Major
        Found in modules/exploits/multi/http/uptime_file_upload_2.rb - About 7 hrs to fix

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

            def run
              @peer = "#{session.session_host}:#{session.session_port}"
          
              @creds = []
              @ssh_keys = []
          Severity: Major
          Found in modules/post/linux/gather/enum_nagios_xi.rb - About 7 hrs to fix

            Method asm_bind_named_pipe has 176 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def asm_bind_named_pipe(opts={})
            
                reliable       = opts[:reliable]
                timeout        = opts[:timeout] * 1000 # convert to millisecs
                retry_wait     = 500
            Severity: Major
            Found in lib/msf/core/payload/windows/bind_named_pipe.rb - About 7 hrs to fix

              Method to_executable_fmt has 175 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def self.to_executable_fmt(framework, arch, plat, code, fmt, exeopts)
                  # For backwards compatibility with the way this gets called when
                  # generating from Msf::Simple::Payload.generate_simple
                  if arch.kind_of? Array
                    output = nil
              Severity: Major
              Found in lib/msf/util/exe.rb - About 7 hrs to fix

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

                  def run
                    # If we have a session make use of it
                    if session
                      print_status("Using existing session #{session.sid}")
                      self.mysql_conn = session.client
                Severity: Major
                Found in modules/auxiliary/admin/mysql/mysql_enum.rb - About 6 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language