rapid7/metasploit-framework

View on GitHub

Showing 7,361 of 22,177 total issues

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

  def run
    print_status('Prefetch Gathering started.')

    # Check to see what Windows Version is running.
    # Needed for offsets.
Severity: Major
Found in modules/post/windows/gather/enum_prefetch.rb - About 2 hrs to fix

    Method cmd_testerpresent has 70 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def cmd_testerpresent(*args)
        bus = ''
        id = ''
        stop = false
        stopid = 0
    Severity: Major
    Found in lib/rex/post/hwbridge/ui/console/command_dispatcher/automotive.rb - About 2 hrs to fix

      Method cmd_channel has 70 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def cmd_channel(*args)
          if args.empty? || args.include?('-h')
            cmd_channel_help
            return
          end
      Severity: Major
      Found in lib/rex/post/meterpreter/ui/console/command_dispatcher/core.rb - About 2 hrs to fix

        Method cmd_analyze has 70 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def cmd_analyze(*args)
            unless active?
              print_error "Not currently connected to a data service for analysis."
              return []
            end
        Severity: Major
        Found in lib/msf/ui/console/command_dispatcher/db/analyze.rb - About 2 hrs to fix

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

            def initialize(info={})
              super(update_info(info,
                'Name'                => 'Adobe Flash Player ByteArray With Workers Use After Free',
                'Description'         => %q{
                  This module exploits a use-after-free vulnerability in Adobe Flash Player. The
          modules/exploits/windows/browser/adobe_flash_uncompress_zlib_uninitialized.rb on lines 11..58

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

          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 initialize(info={})
              super(update_info(info,
                'Name'                => 'Adobe Flash Player UncompressViaZlibVariant Uninitialized Memory',
                'Description'         => %q{
                  This module exploits an uninitialized memory vulnerability in Adobe Flash Player. The
          modules/exploits/windows/browser/adobe_flash_worker_byte_array_uaf.rb on lines 11..57

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

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

            def run
          
              print_status("Get a valid session cookie...")
              res = send_request_cgi({
                'uri' => normalize_uri(target_uri.path, 'ossim', 'session', 'login.php')
          Severity: Major
          Found in modules/auxiliary/gather/alienvault_newpolicyform_sqli.rb - About 2 hrs to fix

            Method run_host has 69 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def run_host(ip)
                ports = datastore['PORTS']
            
                # if port definition has NN then we require INSTANCES
                if ports.include? 'NN' and datastore['INSTANCES'].nil?
            Severity: Major
            Found in modules/auxiliary/scanner/sap/sap_router_portscanner.rb - About 2 hrs to fix

              Method run_host has 69 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def run_host(ip)
                  begin
                    connect
                    version, motd = rsync_negotiate
                    unless version
              Severity: Major
              Found in modules/auxiliary/scanner/rsync/modules_list.rb - About 2 hrs to fix

                Method run_service has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def run_service(port, direct)
                    @rport = port
                    @smb_direct = direct
                
                    ipc_tree = connect_ipc
                Severity: Major
                Found in modules/auxiliary/scanner/smb/smb_lookupsid.rb - About 2 hrs to fix

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

                    def initialize(info = {})
                      super(merge_info(info,
                        'Name'          => 'Linux Command Shell, Reverse TCP Inline',
                        'Description'   => 'Connect back to attacker and spawn a command shell',
                        'Author'        => 'civ',
                  Severity: Major
                  Found in modules/payloads/singles/linux/armle/shell_reverse_tcp.rb - About 2 hrs to fix

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

                      def initialize(info = {})
                        super(
                          update_info(
                            info,
                            'Name' => 'Maltrail Unauthenticated Command Injection',
                    Severity: Major
                    Found in modules/exploits/unix/http/maltrail_rce.rb - About 2 hrs to fix

                      Method install_product has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def install_product(token_info)
                      
                          xml_product = <<-EOF
                      <?xml version="1.0" encoding="ISO-8859-1"?>
                      
                      
                      Severity: Major
                      Found in modules/exploits/unix/webapp/vbulletin_vote_sqli_exec.rb - About 2 hrs to fix

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

                          def initialize(info = {})
                            super(update_info(info,
                              'Name'           => 'Gitlab-shell Code Execution',
                              'Description'    => %q(
                                This module takes advantage of the addition of authorized
                        Severity: Major
                        Found in modules/exploits/multi/http/gitlab_shell_exec.rb - About 2 hrs to fix

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

                            def initialize(info = {})
                              super(update_info(info,
                                'Name'           => 'Maple Maplet File Creation and Command Execution',
                                'Description'    => %q{
                                    This module harnesses Maple's ability to create files and execute commands
                          Severity: Major
                          Found in modules/exploits/multi/fileformat/maple_maplet.rb - About 2 hrs to fix

                            Method req_teamcity_9 has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              def req_teamcity_9(script_content)
                                build_id = Rex::Text.rand_text_numeric(8)
                                xml_payload = %(
                            <?xml version="1.0" encoding="UTF-8"?>
                            <methodCall>
                            Severity: Major
                            Found in modules/exploits/multi/misc/teamcity_agent_xmlrpc_exec.rb - About 2 hrs to fix

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

                                def on_request_uri(cli, request)
                              
                                  if (request.uri.match(/\.gif/i))
                                    data = "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==".unpack("m*")[0]
                                    send_response(cli, data, { 'Content-Type' => 'image/gif' })
                              Severity: Major
                              Found in modules/exploits/windows/browser/ms10_002_aurora.rb - About 2 hrs to fix

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

                                  def initialize(info = {})
                                    super(
                                      update_info(
                                        info,
                                        'Name'            => 'LNK Code Execution Vulnerability',
                                Severity: Major
                                Found in modules/exploits/windows/fileformat/cve_2017_8464_lnk_rce.rb - About 2 hrs to fix

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

                                    def initialize(info = {})
                                      super(
                                        update_info(
                                          info,
                                          'Name' => 'Local Privilege Escalation in polkits pkexec',
                                  Severity: Major
                                  Found in modules/exploits/linux/local/cve_2021_4034_pwnkit_lpe_pkexec.rb - About 2 hrs to fix

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

                                      def initialize(info = {})
                                        super(
                                          update_info(
                                            info,
                                            'Name' => 'Linear eMerge E3-Series Access Controller Command Injection',
                                    Severity: Major
                                    Found in modules/exploits/linux/http/linear_emerge_unauth_rce_cve_2019_7256.rb - About 2 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language