rapid7/metasploit-framework

View on GitHub

Showing 7,361 of 22,177 total issues

Method start_handler has 95 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def start_handler
        # Maximum number of seconds to run the handler
        ctimeout = 150

        if (exploit_config and exploit_config['active_timeout'])
Severity: Major
Found in lib/msf/core/handler/bind_named_pipe.rb - About 3 hrs to fix

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

        sq_bit = Integer(response_data[6].unpack('C').first) & 0b10000000
        response_data = response_data[11..-1] # cut out acpi data
        if sq_bit.eql?(0b10000000)
          ioa = response_data[0..3]
          response_data = response_data[3..-1]
    Severity: Major
    Found in modules/auxiliary/client/iec104/iec104.rb and 3 other locations - About 3 hrs to fix
    modules/auxiliary/client/iec104/iec104.rb on lines 137..155
    modules/auxiliary/client/iec104/iec104.rb on lines 183..201
    modules/auxiliary/client/iec104/iec104.rb on lines 302..320

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

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

        sq_bit = Integer(response_data[6].unpack('C').first) & 0b10000000 # this bit determines the object addressing structure
        response_data = response_data[11..-1] # cut out acpi data
        if sq_bit.eql?(0b10000000)
          ioa = response_data[0..3] # extract ioa value
          response_data = response_data[3..-1] # cut ioa from message
    Severity: Major
    Found in modules/auxiliary/client/iec104/iec104.rb and 3 other locations - About 3 hrs to fix
    modules/auxiliary/client/iec104/iec104.rb on lines 183..201
    modules/auxiliary/client/iec104/iec104.rb on lines 206..224
    modules/auxiliary/client/iec104/iec104.rb on lines 302..320

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

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

        sq_bit = Integer(response_data[6].unpack('C').first) & 0b10000000
        response_data = response_data[11..-1] # cut out acpi data
        if sq_bit.eql?(0b10000000)
          ioa = response_data[0..3]
          response_data = response_data[3..-1]
    Severity: Major
    Found in modules/auxiliary/client/iec104/iec104.rb and 3 other locations - About 3 hrs to fix
    modules/auxiliary/client/iec104/iec104.rb on lines 137..155
    modules/auxiliary/client/iec104/iec104.rb on lines 206..224
    modules/auxiliary/client/iec104/iec104.rb on lines 302..320

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

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

        sq_bit = Integer(response_data[6].unpack('C').first) & 0b10000000
        response_data = response_data[11..-1] # cut out acpi data
        if sq_bit.eql?(0b10000000)
          ioa = response_data[0..3]
          response_data = response_data[3..-1]
    Severity: Major
    Found in modules/auxiliary/client/iec104/iec104.rb and 3 other locations - About 3 hrs to fix
    modules/auxiliary/client/iec104/iec104.rb on lines 137..155
    modules/auxiliary/client/iec104/iec104.rb on lines 183..201
    modules/auxiliary/client/iec104/iec104.rb on lines 206..224

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

    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 decrypt_password(data)
        pid = client.sys.process.getpid
        process = client.sys.process.open(pid, PROCESS_ALL_ACCESS)
    
        mem = process.memory.allocate(512)
    Severity: Major
    Found in modules/post/windows/gather/credentials/enum_picasa_pwds.rb and 1 other location - About 3 hrs to fix
    modules/post/windows/gather/credentials/tortoisesvn.rb on lines 55..77

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

    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 decrypt_password(data)
        pid = client.sys.process.getpid
        process = client.sys.process.open(pid, PROCESS_ALL_ACCESS)
    
        mem = process.memory.allocate(128)
    Severity: Major
    Found in modules/post/windows/gather/credentials/tortoisesvn.rb and 1 other location - About 3 hrs to fix
    modules/post/windows/gather/credentials/enum_picasa_pwds.rb on lines 51..73

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

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

      def dispatch_request(packet, rhost, src_port)
        rhost = ::IPAddr.new(rhost)
    
        # `recvfrom` (on Linux at least) will give us an ipv6/ipv4 mapped
        # addr like "::ffff:192.168.0.1" when the interface we're listening
    Severity: Major
    Found in modules/auxiliary/spoof/mdns/mdns_response.rb - About 3 hrs to fix

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

        def run_host(ip)
          client = datastore['CLIENT']
          data = '<?xml version="1.0" encoding="utf-8" ?>'
          data << '<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">'
          data << '<env:Body>'
      Severity: Major
      Found in modules/auxiliary/scanner/sap/sap_soap_rfc_system_info.rb - About 3 hrs to fix

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

          def run_host(ip)
            print_status("#{ip}:#{rport} SSH - Testing Cleartext Keys")
        
            if datastore["USER_FILE"].blank? && datastore["USERNAME"].blank?
              validation_reason = "At least one of USER_FILE or USERNAME must be given"
        Severity: Major
        Found in modules/auxiliary/scanner/ssh/ssh_login_pubkey.rb - About 3 hrs to fix

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

            def on_request_uri(cli, request)
              print_status("Sending #{request.uri} to #{request['User-Agent']}")
              shellcode = Rex::Text.to_num(payload.encoded).gsub(/\r\n/, '')
              jscript = <<~JS
                var wasm_code = new Uint8Array([0,97,115,109,1,0,0,0,1,133,128,128,128,0,1,96,0,1,127,3,130,128,128,128,0,1,0,4,132,128,128,128,0,1,112,0,0,5,131,128,128,128,0,1,0,1,6,129,128,128,128,0,0,7,145,128,128,128,0,2,6,109,101,109,111,114,121,2,0,4,109,97,105,110,0,0,10,138,128,128,128,0,1,132,128,128,128,0,0,65,42,11])
          Severity: Major
          Found in modules/exploits/multi/browser/chrome_simplifiedlowering_overflow.rb - About 3 hrs to fix

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

              def on_request_uri(cli, request)
            
                # Set target manually or automatically
                my_target = target
                if my_target.name == 'Automatic'
            Severity: Major
            Found in modules/exploits/windows/browser/viscom_movieplayer_drawtext.rb - About 3 hrs to fix

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

                def initialize(info = {})
                  super(
                    update_info(
                      info,
                      'Name' => 'Craft CMS unauthenticated Remote Code Execution (RCE)',
              Severity: Major
              Found in modules/exploits/linux/http/craftcms_unauth_rce_cve_2023_41892.rb - About 3 hrs to fix

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

                  def do_login(user)
                    opt_hash = ssh_client_defaults.merge({
                      auth_methods: ['publickey'],
                      port: rport,
                      key_data: [ key_data ]
                modules/exploits/linux/ssh/ceragon_fibeair_known_privkey.rb on lines 83..119
                modules/exploits/linux/ssh/quantum_dxi_known_privkey.rb on lines 78..115

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

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

                  def do_login(user)
                    opt_hash = ssh_client_defaults.merge({
                      auth_methods: ['publickey'],
                      port: rport,
                      key_data: [ key_data ]
                Severity: Major
                Found in modules/exploits/linux/ssh/ceragon_fibeair_known_privkey.rb and 2 other locations - About 3 hrs to fix
                modules/exploits/linux/ssh/loadbalancerorg_enterprise_known_privkey.rb on lines 79..116
                modules/exploits/linux/ssh/quantum_dxi_known_privkey.rb on lines 78..115

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

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

                  def do_login(user)
                    opt_hash = ssh_client_defaults.merge({
                      auth_methods: ['publickey'],
                      port: rport,
                      key_data: [ key_data ]
                Severity: Major
                Found in modules/exploits/linux/ssh/quantum_dxi_known_privkey.rb and 2 other locations - About 3 hrs to fix
                modules/exploits/linux/ssh/ceragon_fibeair_known_privkey.rb on lines 83..119
                modules/exploits/linux/ssh/loadbalancerorg_enterprise_known_privkey.rb on lines 79..116

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

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

                  def run
                    # 1) Obtain the serial and passwordRandom
                    res = send_request_cgi(
                      'method' => 'GET',
                      'uri' => normalize_uri(target_uri.path, 'api/login/unlockGetData')
                Severity: Major
                Found in modules/auxiliary/admin/http/idsecure_auth_bypass.rb - About 3 hrs to fix

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

                    def initialize(info = {})
                      super(update_info(info,
                        'Name'           => 'Novell eDirectory eMBox Unauthenticated File Access',
                        'Description'    => %q{
                            This module will access Novell eDirectory's eMBox service and can run the
                  Severity: Major
                  Found in modules/auxiliary/admin/edirectory/edirectory_edirutil.rb - About 3 hrs to fix

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

                      def run_host(ip)
                        begin
                          snmp = connect_snmp
                    
                          vprint_status("Connecting to #{ip}")
                    Severity: Major
                    Found in modules/auxiliary/scanner/snmp/snmp_enum_hp_laserjet.rb - About 3 hrs to fix

                      Method initialize_tables has 93 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def initialize_tables
                      
                          @computer_table = Msf::Ui::Console::Table.new(
                            Msf::Ui::Console::Table::Style::Default,
                            'Header' => "Remote Computer Listing",
                      Severity: Major
                      Found in modules/auxiliary/scanner/sap/sap_hostctrl_getcomputersystem.rb - About 3 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language