rapid7/metasploit-framework

View on GitHub

Showing 6,027 of 21,757 total issues

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

          [ 'EDB', '15285' ],
          [ 'CVE', '2010-3904' ],
          [ 'BID', '44219' ],
          [ 'URL', 'https://securitytracker.com/id?1024613' ],
          [ 'URL', 'https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=799c10559d60f159ab2232203f222f18fa3c4a5f' ],
modules/auxiliary/admin/http/cisco_ios_xe_os_exec_cve_2023_20273.rb on lines 54..65
modules/auxiliary/dos/windows/rdp/ms12_020_maxchannelids.rb on lines 22..29
modules/auxiliary/scanner/ssh/ssh_enumusers.rb on lines 37..44
modules/exploits/android/browser/stagefright_mp4_tx3g_64bit.rb on lines 53..61
modules/exploits/freebsd/local/ip6_setpktopt_uaf_priv_esc.rb on lines 48..55
modules/exploits/linux/http/fritzbox_echo_exec.rb on lines 31..38
modules/exploits/linux/http/klog_server_authenticate_user_unauth_command_injection.rb on lines 40..47
modules/exploits/linux/http/vmware_vcenter_vsan_health_rce.rb on lines 32..40
modules/exploits/linux/local/af_packet_packet_set_ring_priv_esc.rb on lines 61..68
modules/exploits/linux/local/blueman_set_dhcp_handler_dbus_priv_esc.rb on lines 39..46
modules/exploits/linux/local/ptrace_sudo_token_priv_esc.rb on lines 43..50
modules/exploits/linux/local/servu_ftp_server_prepareinstallation_priv_esc.rb on lines 41..48
modules/exploits/linux/local/sudoedit_bypass_priv_esc.rb on lines 47..54
modules/exploits/multi/browser/java_atomicreferencearray.rb on lines 35..42
modules/exploits/multi/browser/java_jre17_jmxbean_2.rb on lines 35..42
modules/exploits/multi/browser/java_verifier_field_access.rb on lines 35..42
modules/exploits/multi/http/hp_sitescope_uploadfileshandler.rb on lines 34..41
modules/exploits/multi/http/struts2_multi_eval_ognl.rb on lines 33..40
modules/exploits/multi/http/vmware_vcenter_uploadova_rce.rb on lines 43..50
modules/exploits/unix/dhcp/rhel_dhcp_client_command_injection.rb on lines 35..42
modules/exploits/unix/fileformat/imagemagick_delegate.rb on lines 39..46
modules/exploits/unix/webapp/vicidial_manager_send_cmd_exec.rb on lines 37..44
modules/exploits/windows/browser/adobe_flash_otf_font.rb on lines 34..41
modules/exploits/windows/browser/adobe_flash_regex_value.rb on lines 33..40
modules/exploits/windows/browser/adobe_flashplayer_flash10o.rb on lines 30..37
modules/exploits/windows/browser/java_docbase_bof.rb on lines 46..53
modules/exploits/windows/browser/mozilla_firefox_onreadystatechange.rb on lines 32..39
modules/exploits/windows/browser/ms06_013_createtextrange.rb on lines 34..41
modules/exploits/windows/fileformat/winamp_maki_bof.rb on lines 33..40
modules/exploits/windows/local/ms15_078_atmfd_bof.rb on lines 64..71

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 25.

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

          def decode(input)
            case input
            when String
              decode_string(input)
            when OpenSSL::ASN1::ASN1Data
Severity: Major
Found in lib/rex/proto/kerberos/model/pre_auth_pac_options.rb and 24 other locations - About 15 mins to fix
lib/rex/proto/kerberos/model/ap_rep.rb on lines 25..35
lib/rex/proto/kerberos/model/authenticator.rb on lines 47..57
lib/rex/proto/kerberos/model/authorization_data.rb on lines 21..31
lib/rex/proto/kerberos/model/checksum.rb on lines 22..32
lib/rex/proto/kerberos/model/enc_ap_rep_part.rb on lines 32..42
lib/rex/proto/kerberos/model/enc_kdc_response.rb on lines 75..85
lib/rex/proto/kerberos/model/enc_krb_cred_part.rb on lines 19..29
lib/rex/proto/kerberos/model/encrypted_data.rb on lines 30..40
lib/rex/proto/kerberos/model/encryption_key.rb on lines 28..38
lib/rex/proto/kerberos/model/host_address.rb on lines 23..33
lib/rex/proto/kerberos/model/kdc_request.rb on lines 29..39
lib/rex/proto/kerberos/model/kdc_request_body.rb on lines 73..83
lib/rex/proto/kerberos/model/kdc_response.rb on lines 37..47
lib/rex/proto/kerberos/model/krb_cred.rb on lines 35..45
lib/rex/proto/kerberos/model/krb_cred_info.rb on lines 66..76
lib/rex/proto/kerberos/model/krb_error.rb on lines 55..65
lib/rex/proto/kerberos/model/last_request.rb on lines 22..32
lib/rex/proto/kerberos/model/pre_auth_etype_info2.rb on lines 20..30
lib/rex/proto/kerberos/model/pre_auth_etype_info2_entry.rb on lines 26..36
lib/rex/proto/kerberos/model/pre_auth_for_user.rb on lines 32..42
lib/rex/proto/kerberos/model/principal_name.rb on lines 28..38
lib/rex/proto/kerberos/model/ticket.rb on lines 35..45
lib/rex/proto/kerberos/model/ticket_enc_part.rb on lines 26..36
lib/rex/proto/kerberos/model/transited_encoding.rb on lines 19..29

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

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

        %w{CVE 2016-3714},
        %w{CVE 2016-7976},
        %w{URL https://imagetragick.com/},
        %w{URL https://seclists.org/oss-sec/2016/q2/205},
        %w{URL https://seclists.org/oss-sec/2016/q3/682},
Severity: Major
Found in modules/exploits/unix/fileformat/imagemagick_delegate.rb and 30 other locations - About 15 mins to fix
modules/auxiliary/admin/http/cisco_ios_xe_os_exec_cve_2023_20273.rb on lines 54..65
modules/auxiliary/dos/windows/rdp/ms12_020_maxchannelids.rb on lines 22..29
modules/auxiliary/scanner/ssh/ssh_enumusers.rb on lines 37..44
modules/exploits/android/browser/stagefright_mp4_tx3g_64bit.rb on lines 53..61
modules/exploits/freebsd/local/ip6_setpktopt_uaf_priv_esc.rb on lines 48..55
modules/exploits/linux/http/fritzbox_echo_exec.rb on lines 31..38
modules/exploits/linux/http/klog_server_authenticate_user_unauth_command_injection.rb on lines 40..47
modules/exploits/linux/http/vmware_vcenter_vsan_health_rce.rb on lines 32..40
modules/exploits/linux/local/af_packet_packet_set_ring_priv_esc.rb on lines 61..68
modules/exploits/linux/local/blueman_set_dhcp_handler_dbus_priv_esc.rb on lines 39..46
modules/exploits/linux/local/ptrace_sudo_token_priv_esc.rb on lines 43..50
modules/exploits/linux/local/rds_rds_page_copy_user_priv_esc.rb on lines 48..55
modules/exploits/linux/local/servu_ftp_server_prepareinstallation_priv_esc.rb on lines 41..48
modules/exploits/linux/local/sudoedit_bypass_priv_esc.rb on lines 47..54
modules/exploits/multi/browser/java_atomicreferencearray.rb on lines 35..42
modules/exploits/multi/browser/java_jre17_jmxbean_2.rb on lines 35..42
modules/exploits/multi/browser/java_verifier_field_access.rb on lines 35..42
modules/exploits/multi/http/hp_sitescope_uploadfileshandler.rb on lines 34..41
modules/exploits/multi/http/struts2_multi_eval_ognl.rb on lines 33..40
modules/exploits/multi/http/vmware_vcenter_uploadova_rce.rb on lines 43..50
modules/exploits/unix/dhcp/rhel_dhcp_client_command_injection.rb on lines 35..42
modules/exploits/unix/webapp/vicidial_manager_send_cmd_exec.rb on lines 37..44
modules/exploits/windows/browser/adobe_flash_otf_font.rb on lines 34..41
modules/exploits/windows/browser/adobe_flash_regex_value.rb on lines 33..40
modules/exploits/windows/browser/adobe_flashplayer_flash10o.rb on lines 30..37
modules/exploits/windows/browser/java_docbase_bof.rb on lines 46..53
modules/exploits/windows/browser/mozilla_firefox_onreadystatechange.rb on lines 32..39
modules/exploits/windows/browser/ms06_013_createtextrange.rb on lines 34..41
modules/exploits/windows/fileformat/winamp_maki_bof.rb on lines 33..40
modules/exploits/windows/local/ms15_078_atmfd_bof.rb on lines 64..71

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 25.

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

          ['CVE', '2012-0507'],
          ['OSVDB', '80724'],
          ['BID', '52161'],
          ['URL', 'http://weblog.ikvm.net/PermaLink.aspx?guid=cd48169a-9405-4f63-9087-798c4a1866d3'],
          ['URL', 'http://blogs.technet.com/b/mmpc/archive/2012/03/20/an-interesting-case-of-jre-sandbox-breach-cve-2012-0507.aspx'],
Severity: Major
Found in modules/exploits/multi/browser/java_atomicreferencearray.rb and 30 other locations - About 15 mins to fix
modules/auxiliary/admin/http/cisco_ios_xe_os_exec_cve_2023_20273.rb on lines 54..65
modules/auxiliary/dos/windows/rdp/ms12_020_maxchannelids.rb on lines 22..29
modules/auxiliary/scanner/ssh/ssh_enumusers.rb on lines 37..44
modules/exploits/android/browser/stagefright_mp4_tx3g_64bit.rb on lines 53..61
modules/exploits/freebsd/local/ip6_setpktopt_uaf_priv_esc.rb on lines 48..55
modules/exploits/linux/http/fritzbox_echo_exec.rb on lines 31..38
modules/exploits/linux/http/klog_server_authenticate_user_unauth_command_injection.rb on lines 40..47
modules/exploits/linux/http/vmware_vcenter_vsan_health_rce.rb on lines 32..40
modules/exploits/linux/local/af_packet_packet_set_ring_priv_esc.rb on lines 61..68
modules/exploits/linux/local/blueman_set_dhcp_handler_dbus_priv_esc.rb on lines 39..46
modules/exploits/linux/local/ptrace_sudo_token_priv_esc.rb on lines 43..50
modules/exploits/linux/local/rds_rds_page_copy_user_priv_esc.rb on lines 48..55
modules/exploits/linux/local/servu_ftp_server_prepareinstallation_priv_esc.rb on lines 41..48
modules/exploits/linux/local/sudoedit_bypass_priv_esc.rb on lines 47..54
modules/exploits/multi/browser/java_jre17_jmxbean_2.rb on lines 35..42
modules/exploits/multi/browser/java_verifier_field_access.rb on lines 35..42
modules/exploits/multi/http/hp_sitescope_uploadfileshandler.rb on lines 34..41
modules/exploits/multi/http/struts2_multi_eval_ognl.rb on lines 33..40
modules/exploits/multi/http/vmware_vcenter_uploadova_rce.rb on lines 43..50
modules/exploits/unix/dhcp/rhel_dhcp_client_command_injection.rb on lines 35..42
modules/exploits/unix/fileformat/imagemagick_delegate.rb on lines 39..46
modules/exploits/unix/webapp/vicidial_manager_send_cmd_exec.rb on lines 37..44
modules/exploits/windows/browser/adobe_flash_otf_font.rb on lines 34..41
modules/exploits/windows/browser/adobe_flash_regex_value.rb on lines 33..40
modules/exploits/windows/browser/adobe_flashplayer_flash10o.rb on lines 30..37
modules/exploits/windows/browser/java_docbase_bof.rb on lines 46..53
modules/exploits/windows/browser/mozilla_firefox_onreadystatechange.rb on lines 32..39
modules/exploits/windows/browser/ms06_013_createtextrange.rb on lines 34..41
modules/exploits/windows/fileformat/winamp_maki_bof.rb on lines 33..40
modules/exploits/windows/local/ms15_078_atmfd_bof.rb on lines 64..71

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 25.

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

          [ 'CVE', '2010-3552' ],
          [ 'OSVDB', '68873' ],
          [ 'BID', '44023' ],
          [ 'URL', 'http://blog.harmonysecurity.com/2010/10/oracle-java-ie-browser-plugin-stack.html' ],
          [ 'ZDI', '10-206' ],
Severity: Major
Found in modules/exploits/windows/browser/java_docbase_bof.rb and 30 other locations - About 15 mins to fix
modules/auxiliary/admin/http/cisco_ios_xe_os_exec_cve_2023_20273.rb on lines 54..65
modules/auxiliary/dos/windows/rdp/ms12_020_maxchannelids.rb on lines 22..29
modules/auxiliary/scanner/ssh/ssh_enumusers.rb on lines 37..44
modules/exploits/android/browser/stagefright_mp4_tx3g_64bit.rb on lines 53..61
modules/exploits/freebsd/local/ip6_setpktopt_uaf_priv_esc.rb on lines 48..55
modules/exploits/linux/http/fritzbox_echo_exec.rb on lines 31..38
modules/exploits/linux/http/klog_server_authenticate_user_unauth_command_injection.rb on lines 40..47
modules/exploits/linux/http/vmware_vcenter_vsan_health_rce.rb on lines 32..40
modules/exploits/linux/local/af_packet_packet_set_ring_priv_esc.rb on lines 61..68
modules/exploits/linux/local/blueman_set_dhcp_handler_dbus_priv_esc.rb on lines 39..46
modules/exploits/linux/local/ptrace_sudo_token_priv_esc.rb on lines 43..50
modules/exploits/linux/local/rds_rds_page_copy_user_priv_esc.rb on lines 48..55
modules/exploits/linux/local/servu_ftp_server_prepareinstallation_priv_esc.rb on lines 41..48
modules/exploits/linux/local/sudoedit_bypass_priv_esc.rb on lines 47..54
modules/exploits/multi/browser/java_atomicreferencearray.rb on lines 35..42
modules/exploits/multi/browser/java_jre17_jmxbean_2.rb on lines 35..42
modules/exploits/multi/browser/java_verifier_field_access.rb on lines 35..42
modules/exploits/multi/http/hp_sitescope_uploadfileshandler.rb on lines 34..41
modules/exploits/multi/http/struts2_multi_eval_ognl.rb on lines 33..40
modules/exploits/multi/http/vmware_vcenter_uploadova_rce.rb on lines 43..50
modules/exploits/unix/dhcp/rhel_dhcp_client_command_injection.rb on lines 35..42
modules/exploits/unix/fileformat/imagemagick_delegate.rb on lines 39..46
modules/exploits/unix/webapp/vicidial_manager_send_cmd_exec.rb on lines 37..44
modules/exploits/windows/browser/adobe_flash_otf_font.rb on lines 34..41
modules/exploits/windows/browser/adobe_flash_regex_value.rb on lines 33..40
modules/exploits/windows/browser/adobe_flashplayer_flash10o.rb on lines 30..37
modules/exploits/windows/browser/mozilla_firefox_onreadystatechange.rb on lines 32..39
modules/exploits/windows/browser/ms06_013_createtextrange.rb on lines 34..41
modules/exploits/windows/fileformat/winamp_maki_bof.rb on lines 33..40
modules/exploits/windows/local/ms15_078_atmfd_bof.rb on lines 64..71

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 25.

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

          def decode(input)
            case input
            when String
              decode_string(input)
            when OpenSSL::ASN1::ASN1Data
Severity: Major
Found in lib/rex/proto/kerberos/model/kdc_response.rb and 24 other locations - About 15 mins to fix
lib/rex/proto/kerberos/model/ap_rep.rb on lines 25..35
lib/rex/proto/kerberos/model/authenticator.rb on lines 47..57
lib/rex/proto/kerberos/model/authorization_data.rb on lines 21..31
lib/rex/proto/kerberos/model/checksum.rb on lines 22..32
lib/rex/proto/kerberos/model/enc_ap_rep_part.rb on lines 32..42
lib/rex/proto/kerberos/model/enc_kdc_response.rb on lines 75..85
lib/rex/proto/kerberos/model/enc_krb_cred_part.rb on lines 19..29
lib/rex/proto/kerberos/model/encrypted_data.rb on lines 30..40
lib/rex/proto/kerberos/model/encryption_key.rb on lines 28..38
lib/rex/proto/kerberos/model/host_address.rb on lines 23..33
lib/rex/proto/kerberos/model/kdc_request.rb on lines 29..39
lib/rex/proto/kerberos/model/kdc_request_body.rb on lines 73..83
lib/rex/proto/kerberos/model/krb_cred.rb on lines 35..45
lib/rex/proto/kerberos/model/krb_cred_info.rb on lines 66..76
lib/rex/proto/kerberos/model/krb_error.rb on lines 55..65
lib/rex/proto/kerberos/model/last_request.rb on lines 22..32
lib/rex/proto/kerberos/model/pre_auth_etype_info2.rb on lines 20..30
lib/rex/proto/kerberos/model/pre_auth_etype_info2_entry.rb on lines 26..36
lib/rex/proto/kerberos/model/pre_auth_for_user.rb on lines 32..42
lib/rex/proto/kerberos/model/pre_auth_pac_options.rb on lines 21..31
lib/rex/proto/kerberos/model/principal_name.rb on lines 28..38
lib/rex/proto/kerberos/model/ticket.rb on lines 35..45
lib/rex/proto/kerberos/model/ticket_enc_part.rb on lines 26..36
lib/rex/proto/kerberos/model/transited_encoding.rb on lines 19..29

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

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

          def decode(input)
            case input
            when String
              decode_string(input)
            when OpenSSL::ASN1::ASN1Data
Severity: Major
Found in lib/rex/proto/kerberos/model/enc_krb_cred_part.rb and 24 other locations - About 15 mins to fix
lib/rex/proto/kerberos/model/ap_rep.rb on lines 25..35
lib/rex/proto/kerberos/model/authenticator.rb on lines 47..57
lib/rex/proto/kerberos/model/authorization_data.rb on lines 21..31
lib/rex/proto/kerberos/model/checksum.rb on lines 22..32
lib/rex/proto/kerberos/model/enc_ap_rep_part.rb on lines 32..42
lib/rex/proto/kerberos/model/enc_kdc_response.rb on lines 75..85
lib/rex/proto/kerberos/model/encrypted_data.rb on lines 30..40
lib/rex/proto/kerberos/model/encryption_key.rb on lines 28..38
lib/rex/proto/kerberos/model/host_address.rb on lines 23..33
lib/rex/proto/kerberos/model/kdc_request.rb on lines 29..39
lib/rex/proto/kerberos/model/kdc_request_body.rb on lines 73..83
lib/rex/proto/kerberos/model/kdc_response.rb on lines 37..47
lib/rex/proto/kerberos/model/krb_cred.rb on lines 35..45
lib/rex/proto/kerberos/model/krb_cred_info.rb on lines 66..76
lib/rex/proto/kerberos/model/krb_error.rb on lines 55..65
lib/rex/proto/kerberos/model/last_request.rb on lines 22..32
lib/rex/proto/kerberos/model/pre_auth_etype_info2.rb on lines 20..30
lib/rex/proto/kerberos/model/pre_auth_etype_info2_entry.rb on lines 26..36
lib/rex/proto/kerberos/model/pre_auth_for_user.rb on lines 32..42
lib/rex/proto/kerberos/model/pre_auth_pac_options.rb on lines 21..31
lib/rex/proto/kerberos/model/principal_name.rb on lines 28..38
lib/rex/proto/kerberos/model/ticket.rb on lines 35..45
lib/rex/proto/kerberos/model/ticket_enc_part.rb on lines 26..36
lib/rex/proto/kerberos/model/transited_encoding.rb on lines 19..29

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

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

          def decode(input)
            case input
            when String
              decode_string(input)
            when OpenSSL::ASN1::Sequence
Severity: Major
Found in lib/rex/proto/kerberos/model/encryption_key.rb and 24 other locations - About 15 mins to fix
lib/rex/proto/kerberos/model/ap_rep.rb on lines 25..35
lib/rex/proto/kerberos/model/authenticator.rb on lines 47..57
lib/rex/proto/kerberos/model/authorization_data.rb on lines 21..31
lib/rex/proto/kerberos/model/checksum.rb on lines 22..32
lib/rex/proto/kerberos/model/enc_ap_rep_part.rb on lines 32..42
lib/rex/proto/kerberos/model/enc_kdc_response.rb on lines 75..85
lib/rex/proto/kerberos/model/enc_krb_cred_part.rb on lines 19..29
lib/rex/proto/kerberos/model/encrypted_data.rb on lines 30..40
lib/rex/proto/kerberos/model/host_address.rb on lines 23..33
lib/rex/proto/kerberos/model/kdc_request.rb on lines 29..39
lib/rex/proto/kerberos/model/kdc_request_body.rb on lines 73..83
lib/rex/proto/kerberos/model/kdc_response.rb on lines 37..47
lib/rex/proto/kerberos/model/krb_cred.rb on lines 35..45
lib/rex/proto/kerberos/model/krb_cred_info.rb on lines 66..76
lib/rex/proto/kerberos/model/krb_error.rb on lines 55..65
lib/rex/proto/kerberos/model/last_request.rb on lines 22..32
lib/rex/proto/kerberos/model/pre_auth_etype_info2.rb on lines 20..30
lib/rex/proto/kerberos/model/pre_auth_etype_info2_entry.rb on lines 26..36
lib/rex/proto/kerberos/model/pre_auth_for_user.rb on lines 32..42
lib/rex/proto/kerberos/model/pre_auth_pac_options.rb on lines 21..31
lib/rex/proto/kerberos/model/principal_name.rb on lines 28..38
lib/rex/proto/kerberos/model/ticket.rb on lines 35..45
lib/rex/proto/kerberos/model/ticket_enc_part.rb on lines 26..36
lib/rex/proto/kerberos/model/transited_encoding.rb on lines 19..29

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

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

    def decode(input)
      case input
      when String
        decode_string(input)
      when OpenSSL::ASN1::ASN1Data
Severity: Major
Found in lib/rex/proto/kerberos/model/ticket_enc_part.rb and 24 other locations - About 15 mins to fix
lib/rex/proto/kerberos/model/ap_rep.rb on lines 25..35
lib/rex/proto/kerberos/model/authenticator.rb on lines 47..57
lib/rex/proto/kerberos/model/authorization_data.rb on lines 21..31
lib/rex/proto/kerberos/model/checksum.rb on lines 22..32
lib/rex/proto/kerberos/model/enc_ap_rep_part.rb on lines 32..42
lib/rex/proto/kerberos/model/enc_kdc_response.rb on lines 75..85
lib/rex/proto/kerberos/model/enc_krb_cred_part.rb on lines 19..29
lib/rex/proto/kerberos/model/encrypted_data.rb on lines 30..40
lib/rex/proto/kerberos/model/encryption_key.rb on lines 28..38
lib/rex/proto/kerberos/model/host_address.rb on lines 23..33
lib/rex/proto/kerberos/model/kdc_request.rb on lines 29..39
lib/rex/proto/kerberos/model/kdc_request_body.rb on lines 73..83
lib/rex/proto/kerberos/model/kdc_response.rb on lines 37..47
lib/rex/proto/kerberos/model/krb_cred.rb on lines 35..45
lib/rex/proto/kerberos/model/krb_cred_info.rb on lines 66..76
lib/rex/proto/kerberos/model/krb_error.rb on lines 55..65
lib/rex/proto/kerberos/model/last_request.rb on lines 22..32
lib/rex/proto/kerberos/model/pre_auth_etype_info2.rb on lines 20..30
lib/rex/proto/kerberos/model/pre_auth_etype_info2_entry.rb on lines 26..36
lib/rex/proto/kerberos/model/pre_auth_for_user.rb on lines 32..42
lib/rex/proto/kerberos/model/pre_auth_pac_options.rb on lines 21..31
lib/rex/proto/kerberos/model/principal_name.rb on lines 28..38
lib/rex/proto/kerberos/model/ticket.rb on lines 35..45
lib/rex/proto/kerberos/model/transited_encoding.rb on lines 19..29

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

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

          def decode(input)
            case input
            when String
              decode_string(input)
            when OpenSSL::ASN1::ASN1Data
Severity: Major
Found in lib/rex/proto/kerberos/model/authorization_data.rb and 24 other locations - About 15 mins to fix
lib/rex/proto/kerberos/model/ap_rep.rb on lines 25..35
lib/rex/proto/kerberos/model/authenticator.rb on lines 47..57
lib/rex/proto/kerberos/model/checksum.rb on lines 22..32
lib/rex/proto/kerberos/model/enc_ap_rep_part.rb on lines 32..42
lib/rex/proto/kerberos/model/enc_kdc_response.rb on lines 75..85
lib/rex/proto/kerberos/model/enc_krb_cred_part.rb on lines 19..29
lib/rex/proto/kerberos/model/encrypted_data.rb on lines 30..40
lib/rex/proto/kerberos/model/encryption_key.rb on lines 28..38
lib/rex/proto/kerberos/model/host_address.rb on lines 23..33
lib/rex/proto/kerberos/model/kdc_request.rb on lines 29..39
lib/rex/proto/kerberos/model/kdc_request_body.rb on lines 73..83
lib/rex/proto/kerberos/model/kdc_response.rb on lines 37..47
lib/rex/proto/kerberos/model/krb_cred.rb on lines 35..45
lib/rex/proto/kerberos/model/krb_cred_info.rb on lines 66..76
lib/rex/proto/kerberos/model/krb_error.rb on lines 55..65
lib/rex/proto/kerberos/model/last_request.rb on lines 22..32
lib/rex/proto/kerberos/model/pre_auth_etype_info2.rb on lines 20..30
lib/rex/proto/kerberos/model/pre_auth_etype_info2_entry.rb on lines 26..36
lib/rex/proto/kerberos/model/pre_auth_for_user.rb on lines 32..42
lib/rex/proto/kerberos/model/pre_auth_pac_options.rb on lines 21..31
lib/rex/proto/kerberos/model/principal_name.rb on lines 28..38
lib/rex/proto/kerberos/model/ticket.rb on lines 35..45
lib/rex/proto/kerberos/model/ticket_enc_part.rb on lines 26..36
lib/rex/proto/kerberos/model/transited_encoding.rb on lines 19..29

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

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

          def decode(input)
            case input
            when String
              decode_string(input)
            when OpenSSL::ASN1::ASN1Data
Severity: Major
Found in lib/rex/proto/kerberos/model/enc_kdc_response.rb and 24 other locations - About 15 mins to fix
lib/rex/proto/kerberos/model/ap_rep.rb on lines 25..35
lib/rex/proto/kerberos/model/authenticator.rb on lines 47..57
lib/rex/proto/kerberos/model/authorization_data.rb on lines 21..31
lib/rex/proto/kerberos/model/checksum.rb on lines 22..32
lib/rex/proto/kerberos/model/enc_ap_rep_part.rb on lines 32..42
lib/rex/proto/kerberos/model/enc_krb_cred_part.rb on lines 19..29
lib/rex/proto/kerberos/model/encrypted_data.rb on lines 30..40
lib/rex/proto/kerberos/model/encryption_key.rb on lines 28..38
lib/rex/proto/kerberos/model/host_address.rb on lines 23..33
lib/rex/proto/kerberos/model/kdc_request.rb on lines 29..39
lib/rex/proto/kerberos/model/kdc_request_body.rb on lines 73..83
lib/rex/proto/kerberos/model/kdc_response.rb on lines 37..47
lib/rex/proto/kerberos/model/krb_cred.rb on lines 35..45
lib/rex/proto/kerberos/model/krb_cred_info.rb on lines 66..76
lib/rex/proto/kerberos/model/krb_error.rb on lines 55..65
lib/rex/proto/kerberos/model/last_request.rb on lines 22..32
lib/rex/proto/kerberos/model/pre_auth_etype_info2.rb on lines 20..30
lib/rex/proto/kerberos/model/pre_auth_etype_info2_entry.rb on lines 26..36
lib/rex/proto/kerberos/model/pre_auth_for_user.rb on lines 32..42
lib/rex/proto/kerberos/model/pre_auth_pac_options.rb on lines 21..31
lib/rex/proto/kerberos/model/principal_name.rb on lines 28..38
lib/rex/proto/kerberos/model/ticket.rb on lines 35..45
lib/rex/proto/kerberos/model/ticket_enc_part.rb on lines 26..36
lib/rex/proto/kerberos/model/transited_encoding.rb on lines 19..29

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

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

          def decode(input)
            case input
            when String
              decode_string(input)
            when OpenSSL::ASN1::ASN1Data
Severity: Major
Found in lib/rex/proto/kerberos/model/pre_auth_etype_info2_entry.rb and 24 other locations - About 15 mins to fix
lib/rex/proto/kerberos/model/ap_rep.rb on lines 25..35
lib/rex/proto/kerberos/model/authenticator.rb on lines 47..57
lib/rex/proto/kerberos/model/authorization_data.rb on lines 21..31
lib/rex/proto/kerberos/model/checksum.rb on lines 22..32
lib/rex/proto/kerberos/model/enc_ap_rep_part.rb on lines 32..42
lib/rex/proto/kerberos/model/enc_kdc_response.rb on lines 75..85
lib/rex/proto/kerberos/model/enc_krb_cred_part.rb on lines 19..29
lib/rex/proto/kerberos/model/encrypted_data.rb on lines 30..40
lib/rex/proto/kerberos/model/encryption_key.rb on lines 28..38
lib/rex/proto/kerberos/model/host_address.rb on lines 23..33
lib/rex/proto/kerberos/model/kdc_request.rb on lines 29..39
lib/rex/proto/kerberos/model/kdc_request_body.rb on lines 73..83
lib/rex/proto/kerberos/model/kdc_response.rb on lines 37..47
lib/rex/proto/kerberos/model/krb_cred.rb on lines 35..45
lib/rex/proto/kerberos/model/krb_cred_info.rb on lines 66..76
lib/rex/proto/kerberos/model/krb_error.rb on lines 55..65
lib/rex/proto/kerberos/model/last_request.rb on lines 22..32
lib/rex/proto/kerberos/model/pre_auth_etype_info2.rb on lines 20..30
lib/rex/proto/kerberos/model/pre_auth_for_user.rb on lines 32..42
lib/rex/proto/kerberos/model/pre_auth_pac_options.rb on lines 21..31
lib/rex/proto/kerberos/model/principal_name.rb on lines 28..38
lib/rex/proto/kerberos/model/ticket.rb on lines 35..45
lib/rex/proto/kerberos/model/ticket_enc_part.rb on lines 26..36
lib/rex/proto/kerberos/model/transited_encoding.rb on lines 19..29

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

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

          def decode(input)
            case input
            when String
              decode_string(input)
            when OpenSSL::ASN1::ASN1Data
Severity: Major
Found in lib/rex/proto/kerberos/model/kdc_request.rb and 24 other locations - About 15 mins to fix
lib/rex/proto/kerberos/model/ap_rep.rb on lines 25..35
lib/rex/proto/kerberos/model/authenticator.rb on lines 47..57
lib/rex/proto/kerberos/model/authorization_data.rb on lines 21..31
lib/rex/proto/kerberos/model/checksum.rb on lines 22..32
lib/rex/proto/kerberos/model/enc_ap_rep_part.rb on lines 32..42
lib/rex/proto/kerberos/model/enc_kdc_response.rb on lines 75..85
lib/rex/proto/kerberos/model/enc_krb_cred_part.rb on lines 19..29
lib/rex/proto/kerberos/model/encrypted_data.rb on lines 30..40
lib/rex/proto/kerberos/model/encryption_key.rb on lines 28..38
lib/rex/proto/kerberos/model/host_address.rb on lines 23..33
lib/rex/proto/kerberos/model/kdc_request_body.rb on lines 73..83
lib/rex/proto/kerberos/model/kdc_response.rb on lines 37..47
lib/rex/proto/kerberos/model/krb_cred.rb on lines 35..45
lib/rex/proto/kerberos/model/krb_cred_info.rb on lines 66..76
lib/rex/proto/kerberos/model/krb_error.rb on lines 55..65
lib/rex/proto/kerberos/model/last_request.rb on lines 22..32
lib/rex/proto/kerberos/model/pre_auth_etype_info2.rb on lines 20..30
lib/rex/proto/kerberos/model/pre_auth_etype_info2_entry.rb on lines 26..36
lib/rex/proto/kerberos/model/pre_auth_for_user.rb on lines 32..42
lib/rex/proto/kerberos/model/pre_auth_pac_options.rb on lines 21..31
lib/rex/proto/kerberos/model/principal_name.rb on lines 28..38
lib/rex/proto/kerberos/model/ticket.rb on lines 35..45
lib/rex/proto/kerberos/model/ticket_enc_part.rb on lines 26..36
lib/rex/proto/kerberos/model/transited_encoding.rb on lines 19..29

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

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

          def decode(input)
            case input
            when String
              decode_string(input)
            when OpenSSL::ASN1::ASN1Data
Severity: Major
Found in lib/rex/proto/kerberos/model/ap_rep.rb and 24 other locations - About 15 mins to fix
lib/rex/proto/kerberos/model/authenticator.rb on lines 47..57
lib/rex/proto/kerberos/model/authorization_data.rb on lines 21..31
lib/rex/proto/kerberos/model/checksum.rb on lines 22..32
lib/rex/proto/kerberos/model/enc_ap_rep_part.rb on lines 32..42
lib/rex/proto/kerberos/model/enc_kdc_response.rb on lines 75..85
lib/rex/proto/kerberos/model/enc_krb_cred_part.rb on lines 19..29
lib/rex/proto/kerberos/model/encrypted_data.rb on lines 30..40
lib/rex/proto/kerberos/model/encryption_key.rb on lines 28..38
lib/rex/proto/kerberos/model/host_address.rb on lines 23..33
lib/rex/proto/kerberos/model/kdc_request.rb on lines 29..39
lib/rex/proto/kerberos/model/kdc_request_body.rb on lines 73..83
lib/rex/proto/kerberos/model/kdc_response.rb on lines 37..47
lib/rex/proto/kerberos/model/krb_cred.rb on lines 35..45
lib/rex/proto/kerberos/model/krb_cred_info.rb on lines 66..76
lib/rex/proto/kerberos/model/krb_error.rb on lines 55..65
lib/rex/proto/kerberos/model/last_request.rb on lines 22..32
lib/rex/proto/kerberos/model/pre_auth_etype_info2.rb on lines 20..30
lib/rex/proto/kerberos/model/pre_auth_etype_info2_entry.rb on lines 26..36
lib/rex/proto/kerberos/model/pre_auth_for_user.rb on lines 32..42
lib/rex/proto/kerberos/model/pre_auth_pac_options.rb on lines 21..31
lib/rex/proto/kerberos/model/principal_name.rb on lines 28..38
lib/rex/proto/kerberos/model/ticket.rb on lines 35..45
lib/rex/proto/kerberos/model/ticket_enc_part.rb on lines 26..36
lib/rex/proto/kerberos/model/transited_encoding.rb on lines 19..29

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

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

          def decode(input)
            case input
            when String
              decode_string(input)
            when OpenSSL::ASN1::ASN1Data
Severity: Major
Found in lib/rex/proto/kerberos/model/krb_error.rb and 24 other locations - About 15 mins to fix
lib/rex/proto/kerberos/model/ap_rep.rb on lines 25..35
lib/rex/proto/kerberos/model/authenticator.rb on lines 47..57
lib/rex/proto/kerberos/model/authorization_data.rb on lines 21..31
lib/rex/proto/kerberos/model/checksum.rb on lines 22..32
lib/rex/proto/kerberos/model/enc_ap_rep_part.rb on lines 32..42
lib/rex/proto/kerberos/model/enc_kdc_response.rb on lines 75..85
lib/rex/proto/kerberos/model/enc_krb_cred_part.rb on lines 19..29
lib/rex/proto/kerberos/model/encrypted_data.rb on lines 30..40
lib/rex/proto/kerberos/model/encryption_key.rb on lines 28..38
lib/rex/proto/kerberos/model/host_address.rb on lines 23..33
lib/rex/proto/kerberos/model/kdc_request.rb on lines 29..39
lib/rex/proto/kerberos/model/kdc_request_body.rb on lines 73..83
lib/rex/proto/kerberos/model/kdc_response.rb on lines 37..47
lib/rex/proto/kerberos/model/krb_cred.rb on lines 35..45
lib/rex/proto/kerberos/model/krb_cred_info.rb on lines 66..76
lib/rex/proto/kerberos/model/last_request.rb on lines 22..32
lib/rex/proto/kerberos/model/pre_auth_etype_info2.rb on lines 20..30
lib/rex/proto/kerberos/model/pre_auth_etype_info2_entry.rb on lines 26..36
lib/rex/proto/kerberos/model/pre_auth_for_user.rb on lines 32..42
lib/rex/proto/kerberos/model/pre_auth_pac_options.rb on lines 21..31
lib/rex/proto/kerberos/model/principal_name.rb on lines 28..38
lib/rex/proto/kerberos/model/ticket.rb on lines 35..45
lib/rex/proto/kerberos/model/ticket_enc_part.rb on lines 26..36
lib/rex/proto/kerberos/model/transited_encoding.rb on lines 19..29

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

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

          [ 'CVE', '2012-0002' ],
          [ 'MSB', 'MS12-020' ],
          [ 'URL', 'http://www.privatepaste.com/ffe875e04a' ],
          [ 'URL', 'http://pastie.org/private/4egcqt9nucxnsiksudy5dw' ],
          [ 'URL', 'http://pastie.org/private/feg8du0e9kfagng4rrg' ],
Severity: Major
Found in modules/auxiliary/dos/windows/rdp/ms12_020_maxchannelids.rb and 30 other locations - About 15 mins to fix
modules/auxiliary/admin/http/cisco_ios_xe_os_exec_cve_2023_20273.rb on lines 54..65
modules/auxiliary/scanner/ssh/ssh_enumusers.rb on lines 37..44
modules/exploits/android/browser/stagefright_mp4_tx3g_64bit.rb on lines 53..61
modules/exploits/freebsd/local/ip6_setpktopt_uaf_priv_esc.rb on lines 48..55
modules/exploits/linux/http/fritzbox_echo_exec.rb on lines 31..38
modules/exploits/linux/http/klog_server_authenticate_user_unauth_command_injection.rb on lines 40..47
modules/exploits/linux/http/vmware_vcenter_vsan_health_rce.rb on lines 32..40
modules/exploits/linux/local/af_packet_packet_set_ring_priv_esc.rb on lines 61..68
modules/exploits/linux/local/blueman_set_dhcp_handler_dbus_priv_esc.rb on lines 39..46
modules/exploits/linux/local/ptrace_sudo_token_priv_esc.rb on lines 43..50
modules/exploits/linux/local/rds_rds_page_copy_user_priv_esc.rb on lines 48..55
modules/exploits/linux/local/servu_ftp_server_prepareinstallation_priv_esc.rb on lines 41..48
modules/exploits/linux/local/sudoedit_bypass_priv_esc.rb on lines 47..54
modules/exploits/multi/browser/java_atomicreferencearray.rb on lines 35..42
modules/exploits/multi/browser/java_jre17_jmxbean_2.rb on lines 35..42
modules/exploits/multi/browser/java_verifier_field_access.rb on lines 35..42
modules/exploits/multi/http/hp_sitescope_uploadfileshandler.rb on lines 34..41
modules/exploits/multi/http/struts2_multi_eval_ognl.rb on lines 33..40
modules/exploits/multi/http/vmware_vcenter_uploadova_rce.rb on lines 43..50
modules/exploits/unix/dhcp/rhel_dhcp_client_command_injection.rb on lines 35..42
modules/exploits/unix/fileformat/imagemagick_delegate.rb on lines 39..46
modules/exploits/unix/webapp/vicidial_manager_send_cmd_exec.rb on lines 37..44
modules/exploits/windows/browser/adobe_flash_otf_font.rb on lines 34..41
modules/exploits/windows/browser/adobe_flash_regex_value.rb on lines 33..40
modules/exploits/windows/browser/adobe_flashplayer_flash10o.rb on lines 30..37
modules/exploits/windows/browser/java_docbase_bof.rb on lines 46..53
modules/exploits/windows/browser/mozilla_firefox_onreadystatechange.rb on lines 32..39
modules/exploits/windows/browser/ms06_013_createtextrange.rb on lines 34..41
modules/exploits/windows/fileformat/winamp_maki_bof.rb on lines 33..40
modules/exploits/windows/local/ms15_078_atmfd_bof.rb on lines 64..71

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 25.

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

          [ 'CVE', '2014-9727' ],
          [ 'OSVDB', '103289' ],
          [ 'BID', '65520' ],
          [ 'URL', 'http://www.kapple.de/?p=75' ],                       # vulnerability details with PoC
          [ 'URL', 'https://www.speckmarschall.de/hoere.htm' ],          # probably the first published details (now censored)
Severity: Major
Found in modules/exploits/linux/http/fritzbox_echo_exec.rb and 30 other locations - About 15 mins to fix
modules/auxiliary/admin/http/cisco_ios_xe_os_exec_cve_2023_20273.rb on lines 54..65
modules/auxiliary/dos/windows/rdp/ms12_020_maxchannelids.rb on lines 22..29
modules/auxiliary/scanner/ssh/ssh_enumusers.rb on lines 37..44
modules/exploits/android/browser/stagefright_mp4_tx3g_64bit.rb on lines 53..61
modules/exploits/freebsd/local/ip6_setpktopt_uaf_priv_esc.rb on lines 48..55
modules/exploits/linux/http/klog_server_authenticate_user_unauth_command_injection.rb on lines 40..47
modules/exploits/linux/http/vmware_vcenter_vsan_health_rce.rb on lines 32..40
modules/exploits/linux/local/af_packet_packet_set_ring_priv_esc.rb on lines 61..68
modules/exploits/linux/local/blueman_set_dhcp_handler_dbus_priv_esc.rb on lines 39..46
modules/exploits/linux/local/ptrace_sudo_token_priv_esc.rb on lines 43..50
modules/exploits/linux/local/rds_rds_page_copy_user_priv_esc.rb on lines 48..55
modules/exploits/linux/local/servu_ftp_server_prepareinstallation_priv_esc.rb on lines 41..48
modules/exploits/linux/local/sudoedit_bypass_priv_esc.rb on lines 47..54
modules/exploits/multi/browser/java_atomicreferencearray.rb on lines 35..42
modules/exploits/multi/browser/java_jre17_jmxbean_2.rb on lines 35..42
modules/exploits/multi/browser/java_verifier_field_access.rb on lines 35..42
modules/exploits/multi/http/hp_sitescope_uploadfileshandler.rb on lines 34..41
modules/exploits/multi/http/struts2_multi_eval_ognl.rb on lines 33..40
modules/exploits/multi/http/vmware_vcenter_uploadova_rce.rb on lines 43..50
modules/exploits/unix/dhcp/rhel_dhcp_client_command_injection.rb on lines 35..42
modules/exploits/unix/fileformat/imagemagick_delegate.rb on lines 39..46
modules/exploits/unix/webapp/vicidial_manager_send_cmd_exec.rb on lines 37..44
modules/exploits/windows/browser/adobe_flash_otf_font.rb on lines 34..41
modules/exploits/windows/browser/adobe_flash_regex_value.rb on lines 33..40
modules/exploits/windows/browser/adobe_flashplayer_flash10o.rb on lines 30..37
modules/exploits/windows/browser/java_docbase_bof.rb on lines 46..53
modules/exploits/windows/browser/mozilla_firefox_onreadystatechange.rb on lines 32..39
modules/exploits/windows/browser/ms06_013_createtextrange.rb on lines 34..41
modules/exploits/windows/fileformat/winamp_maki_bof.rb on lines 33..40
modules/exploits/windows/local/ms15_078_atmfd_bof.rb on lines 64..71

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 25.

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

          def decode(input)
            case input
            when String
              decode_string(input)
            when OpenSSL::ASN1::Sequence
Severity: Major
Found in lib/rex/proto/kerberos/model/kdc_request_body.rb and 24 other locations - About 15 mins to fix
lib/rex/proto/kerberos/model/ap_rep.rb on lines 25..35
lib/rex/proto/kerberos/model/authenticator.rb on lines 47..57
lib/rex/proto/kerberos/model/authorization_data.rb on lines 21..31
lib/rex/proto/kerberos/model/checksum.rb on lines 22..32
lib/rex/proto/kerberos/model/enc_ap_rep_part.rb on lines 32..42
lib/rex/proto/kerberos/model/enc_kdc_response.rb on lines 75..85
lib/rex/proto/kerberos/model/enc_krb_cred_part.rb on lines 19..29
lib/rex/proto/kerberos/model/encrypted_data.rb on lines 30..40
lib/rex/proto/kerberos/model/encryption_key.rb on lines 28..38
lib/rex/proto/kerberos/model/host_address.rb on lines 23..33
lib/rex/proto/kerberos/model/kdc_request.rb on lines 29..39
lib/rex/proto/kerberos/model/kdc_response.rb on lines 37..47
lib/rex/proto/kerberos/model/krb_cred.rb on lines 35..45
lib/rex/proto/kerberos/model/krb_cred_info.rb on lines 66..76
lib/rex/proto/kerberos/model/krb_error.rb on lines 55..65
lib/rex/proto/kerberos/model/last_request.rb on lines 22..32
lib/rex/proto/kerberos/model/pre_auth_etype_info2.rb on lines 20..30
lib/rex/proto/kerberos/model/pre_auth_etype_info2_entry.rb on lines 26..36
lib/rex/proto/kerberos/model/pre_auth_for_user.rb on lines 32..42
lib/rex/proto/kerberos/model/pre_auth_pac_options.rb on lines 21..31
lib/rex/proto/kerberos/model/principal_name.rb on lines 28..38
lib/rex/proto/kerberos/model/ticket.rb on lines 35..45
lib/rex/proto/kerberos/model/ticket_enc_part.rb on lines 26..36
lib/rex/proto/kerberos/model/transited_encoding.rb on lines 19..29

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

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

          def decode(input)
            case input
            when String
              decode_string(input)
            when OpenSSL::ASN1::Sequence
Severity: Major
Found in lib/rex/proto/kerberos/model/krb_cred.rb and 24 other locations - About 15 mins to fix
lib/rex/proto/kerberos/model/ap_rep.rb on lines 25..35
lib/rex/proto/kerberos/model/authenticator.rb on lines 47..57
lib/rex/proto/kerberos/model/authorization_data.rb on lines 21..31
lib/rex/proto/kerberos/model/checksum.rb on lines 22..32
lib/rex/proto/kerberos/model/enc_ap_rep_part.rb on lines 32..42
lib/rex/proto/kerberos/model/enc_kdc_response.rb on lines 75..85
lib/rex/proto/kerberos/model/enc_krb_cred_part.rb on lines 19..29
lib/rex/proto/kerberos/model/encrypted_data.rb on lines 30..40
lib/rex/proto/kerberos/model/encryption_key.rb on lines 28..38
lib/rex/proto/kerberos/model/host_address.rb on lines 23..33
lib/rex/proto/kerberos/model/kdc_request.rb on lines 29..39
lib/rex/proto/kerberos/model/kdc_request_body.rb on lines 73..83
lib/rex/proto/kerberos/model/kdc_response.rb on lines 37..47
lib/rex/proto/kerberos/model/krb_cred_info.rb on lines 66..76
lib/rex/proto/kerberos/model/krb_error.rb on lines 55..65
lib/rex/proto/kerberos/model/last_request.rb on lines 22..32
lib/rex/proto/kerberos/model/pre_auth_etype_info2.rb on lines 20..30
lib/rex/proto/kerberos/model/pre_auth_etype_info2_entry.rb on lines 26..36
lib/rex/proto/kerberos/model/pre_auth_for_user.rb on lines 32..42
lib/rex/proto/kerberos/model/pre_auth_pac_options.rb on lines 21..31
lib/rex/proto/kerberos/model/principal_name.rb on lines 28..38
lib/rex/proto/kerberos/model/ticket.rb on lines 35..45
lib/rex/proto/kerberos/model/ticket_enc_part.rb on lines 26..36
lib/rex/proto/kerberos/model/transited_encoding.rb on lines 19..29

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

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

          def decode(input)
            case input
            when String
              decode_string(input)
            when OpenSSL::ASN1::ASN1Data
Severity: Major
Found in lib/rex/proto/kerberos/model/authenticator.rb and 24 other locations - About 15 mins to fix
lib/rex/proto/kerberos/model/ap_rep.rb on lines 25..35
lib/rex/proto/kerberos/model/authorization_data.rb on lines 21..31
lib/rex/proto/kerberos/model/checksum.rb on lines 22..32
lib/rex/proto/kerberos/model/enc_ap_rep_part.rb on lines 32..42
lib/rex/proto/kerberos/model/enc_kdc_response.rb on lines 75..85
lib/rex/proto/kerberos/model/enc_krb_cred_part.rb on lines 19..29
lib/rex/proto/kerberos/model/encrypted_data.rb on lines 30..40
lib/rex/proto/kerberos/model/encryption_key.rb on lines 28..38
lib/rex/proto/kerberos/model/host_address.rb on lines 23..33
lib/rex/proto/kerberos/model/kdc_request.rb on lines 29..39
lib/rex/proto/kerberos/model/kdc_request_body.rb on lines 73..83
lib/rex/proto/kerberos/model/kdc_response.rb on lines 37..47
lib/rex/proto/kerberos/model/krb_cred.rb on lines 35..45
lib/rex/proto/kerberos/model/krb_cred_info.rb on lines 66..76
lib/rex/proto/kerberos/model/krb_error.rb on lines 55..65
lib/rex/proto/kerberos/model/last_request.rb on lines 22..32
lib/rex/proto/kerberos/model/pre_auth_etype_info2.rb on lines 20..30
lib/rex/proto/kerberos/model/pre_auth_etype_info2_entry.rb on lines 26..36
lib/rex/proto/kerberos/model/pre_auth_for_user.rb on lines 32..42
lib/rex/proto/kerberos/model/pre_auth_pac_options.rb on lines 21..31
lib/rex/proto/kerberos/model/principal_name.rb on lines 28..38
lib/rex/proto/kerberos/model/ticket.rb on lines 35..45
lib/rex/proto/kerberos/model/ticket_enc_part.rb on lines 26..36
lib/rex/proto/kerberos/model/transited_encoding.rb on lines 19..29

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

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