rapid7/metasploit-framework

View on GitHub

Showing 22,177 of 22,177 total issues

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

            o += u('B', d[o + 1:o + 2])[0]
Severity: Minor
Found in data/meterpreter/python/met_rsa.py and 1 other location - About 30 mins to fix
data/meterpreter/python/met_rsa.py on lines 34..34

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

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

  def report_bad_cred(ip, rport, result)
    invalidate_login(
      address: ip,
      port: rport,
      protocol: 'tcp',
Severity: Major
Found in modules/auxiliary/scanner/http/syncovery_linux_login.rb and 7 other locations - About 30 mins to fix
modules/auxiliary/scanner/http/advantech_webaccess_login.rb on lines 94..105
modules/auxiliary/scanner/http/bavision_cam_login.rb on lines 91..102
modules/auxiliary/scanner/http/cisco_firepower_login.rb on lines 97..108
modules/auxiliary/scanner/http/phpmyadmin_login.rb on lines 59..70
modules/auxiliary/scanner/http/softing_sis_login.rb on lines 76..87
modules/auxiliary/scanner/http/symantec_web_gateway_login.rb on lines 88..99
modules/auxiliary/scanner/http/wowza_streaming_engine_manager_login.rb on lines 94..105

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

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

  def report_bad_cred(ip, rport, result)
    invalidate_login(
      address: ip,
      port: rport,
      protocol: 'tcp',
Severity: Major
Found in modules/auxiliary/scanner/http/cisco_firepower_login.rb and 7 other locations - About 30 mins to fix
modules/auxiliary/scanner/http/advantech_webaccess_login.rb on lines 94..105
modules/auxiliary/scanner/http/bavision_cam_login.rb on lines 91..102
modules/auxiliary/scanner/http/phpmyadmin_login.rb on lines 59..70
modules/auxiliary/scanner/http/softing_sis_login.rb on lines 76..87
modules/auxiliary/scanner/http/symantec_web_gateway_login.rb on lines 88..99
modules/auxiliary/scanner/http/syncovery_linux_login.rb on lines 98..109
modules/auxiliary/scanner/http/wowza_streaming_engine_manager_login.rb on lines 94..105

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

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

  def report_bad_cred(ip, rport, result)
    invalidate_login(
      address: ip,
      port: rport,
      protocol: 'tcp',
Severity: Major
Found in modules/auxiliary/scanner/http/bavision_cam_login.rb and 7 other locations - About 30 mins to fix
modules/auxiliary/scanner/http/advantech_webaccess_login.rb on lines 94..105
modules/auxiliary/scanner/http/cisco_firepower_login.rb on lines 97..108
modules/auxiliary/scanner/http/phpmyadmin_login.rb on lines 59..70
modules/auxiliary/scanner/http/softing_sis_login.rb on lines 76..87
modules/auxiliary/scanner/http/symantec_web_gateway_login.rb on lines 88..99
modules/auxiliary/scanner/http/syncovery_linux_login.rb on lines 98..109
modules/auxiliary/scanner/http/wowza_streaming_engine_manager_login.rb on lines 94..105

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

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

  def report_bad_cred(ip, rport, result)
    invalidate_login(
      address: ip,
      port: rport,
      protocol: 'tcp',
modules/auxiliary/scanner/http/advantech_webaccess_login.rb on lines 94..105
modules/auxiliary/scanner/http/bavision_cam_login.rb on lines 91..102
modules/auxiliary/scanner/http/cisco_firepower_login.rb on lines 97..108
modules/auxiliary/scanner/http/phpmyadmin_login.rb on lines 59..70
modules/auxiliary/scanner/http/softing_sis_login.rb on lines 76..87
modules/auxiliary/scanner/http/symantec_web_gateway_login.rb on lines 88..99
modules/auxiliary/scanner/http/syncovery_linux_login.rb on lines 98..109

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

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

  def report_bad_cred(ip, rport, result)
    invalidate_login(
      address: ip,
      port: rport,
      protocol: 'tcp',
Severity: Major
Found in modules/auxiliary/scanner/http/advantech_webaccess_login.rb and 7 other locations - About 30 mins to fix
modules/auxiliary/scanner/http/bavision_cam_login.rb on lines 91..102
modules/auxiliary/scanner/http/cisco_firepower_login.rb on lines 97..108
modules/auxiliary/scanner/http/phpmyadmin_login.rb on lines 59..70
modules/auxiliary/scanner/http/softing_sis_login.rb on lines 76..87
modules/auxiliary/scanner/http/symantec_web_gateway_login.rb on lines 88..99
modules/auxiliary/scanner/http/syncovery_linux_login.rb on lines 98..109
modules/auxiliary/scanner/http/wowza_streaming_engine_manager_login.rb on lines 94..105

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

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

  def report_bad_cred(ip, rport, result)
    invalidate_login(
      address: ip,
      port: rport,
      protocol: 'tcp',
Severity: Major
Found in modules/auxiliary/scanner/http/phpmyadmin_login.rb and 7 other locations - About 30 mins to fix
modules/auxiliary/scanner/http/advantech_webaccess_login.rb on lines 94..105
modules/auxiliary/scanner/http/bavision_cam_login.rb on lines 91..102
modules/auxiliary/scanner/http/cisco_firepower_login.rb on lines 97..108
modules/auxiliary/scanner/http/softing_sis_login.rb on lines 76..87
modules/auxiliary/scanner/http/symantec_web_gateway_login.rb on lines 88..99
modules/auxiliary/scanner/http/syncovery_linux_login.rb on lines 98..109
modules/auxiliary/scanner/http/wowza_streaming_engine_manager_login.rb on lines 94..105

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

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

  def report_bad_cred(ip, rport, result)
    invalidate_login(
      address: ip,
      port: rport,
      protocol: 'tcp',
Severity: Major
Found in modules/auxiliary/scanner/http/symantec_web_gateway_login.rb and 7 other locations - About 30 mins to fix
modules/auxiliary/scanner/http/advantech_webaccess_login.rb on lines 94..105
modules/auxiliary/scanner/http/bavision_cam_login.rb on lines 91..102
modules/auxiliary/scanner/http/cisco_firepower_login.rb on lines 97..108
modules/auxiliary/scanner/http/phpmyadmin_login.rb on lines 59..70
modules/auxiliary/scanner/http/softing_sis_login.rb on lines 76..87
modules/auxiliary/scanner/http/syncovery_linux_login.rb on lines 98..109
modules/auxiliary/scanner/http/wowza_streaming_engine_manager_login.rb on lines 94..105

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

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

  def report_bad_cred(ip, rport, result)
    invalidate_login(
      address: ip,
      port: rport,
      protocol: 'tcp',
Severity: Major
Found in modules/auxiliary/scanner/http/softing_sis_login.rb and 7 other locations - About 30 mins to fix
modules/auxiliary/scanner/http/advantech_webaccess_login.rb on lines 94..105
modules/auxiliary/scanner/http/bavision_cam_login.rb on lines 91..102
modules/auxiliary/scanner/http/cisco_firepower_login.rb on lines 97..108
modules/auxiliary/scanner/http/phpmyadmin_login.rb on lines 59..70
modules/auxiliary/scanner/http/symantec_web_gateway_login.rb on lines 88..99
modules/auxiliary/scanner/http/syncovery_linux_login.rb on lines 98..109
modules/auxiliary/scanner/http/wowza_streaming_engine_manager_login.rb on lines 94..105

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  def exploit_template(cli, target_info)
    swf_random = "#{rand_text_alpha(4 + rand(3))}.swf"
    target_payload = get_payload(cli, target_info)
    b64_payload = Rex::Text.encode_base64(target_payload)
    platform_id = 'win'
modules/exploits/windows/browser/adobe_flash_copy_pixels_to_byte_array.rb on lines 84..104
modules/exploits/windows/browser/adobe_flash_domain_memory_uaf.rb on lines 83..103
modules/exploits/windows/browser/adobe_flash_uncompress_zlib_uninitialized.rb on lines 79..99
modules/exploits/windows/browser/adobe_flash_worker_byte_array_uaf.rb on lines 78..98

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  def target_url(*args)
    (ssl ? 'https' : 'http') +
      if rport.to_i == 80 || rport.to_i == 443
        "://#{vhost}"
      else
modules/auxiliary/admin/http/cfme_manageiq_evm_pass_reset.rb on lines 155..161
modules/auxiliary/admin/http/katello_satellite_priv_esc.rb on lines 138..144
modules/exploits/linux/http/cfme_manageiq_evm_upload_exec.rb on lines 140..146
modules/exploits/linux/http/foreman_openstack_satellite_code_exec.rb on lines 113..119

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  def exploit_template(cli, target_info)
    swf_random = "#{rand_text_alpha(4 + rand(3))}.swf"
    target_payload = get_payload(cli, target_info)
    b64_payload = Rex::Text.encode_base64(target_payload)
    platform_id = 'win'
modules/exploits/windows/browser/adobe_flash_casi32_int_overflow.rb on lines 78..98
modules/exploits/windows/browser/adobe_flash_domain_memory_uaf.rb on lines 83..103
modules/exploits/windows/browser/adobe_flash_uncompress_zlib_uninitialized.rb on lines 79..99
modules/exploits/windows/browser/adobe_flash_worker_byte_array_uaf.rb on lines 78..98

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  def validate_active_host
    print_status("Attempting to PrivEsc on #{sysinfo['Computer']} via session ID: #{datastore['SESSION']}")
  rescue Rex::Post::Meterpreter::RequestError => e
    elog('Could not connect to session', error: e)
    raise Msf::Exploit::Failed, 'Could not connect to session'
Severity: Major
Found in modules/exploits/windows/local/cve_2020_1337_printerdemon.rb and 4 other locations - About 30 mins to fix
modules/exploits/windows/local/comahawk.rb on lines 117..122
modules/exploits/windows/local/cve_2020_1048_printerdemon.rb on lines 160..165
modules/exploits/windows/local/cve_2020_1313_system_orchestrator.rb on lines 139..144
modules/exploits/windows/local/tokenmagic.rb on lines 162..167

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  def target_url(*args)
    (ssl ? 'https' : 'http') +
      if rport.to_i == 80 || rport.to_i == 443
        "://#{vhost}"
      else
Severity: Major
Found in modules/auxiliary/admin/http/katello_satellite_priv_esc.rb and 4 other locations - About 30 mins to fix
modules/auxiliary/admin/http/cfme_manageiq_evm_pass_reset.rb on lines 155..161
modules/auxiliary/admin/http/foreman_openstack_satellite_priv_esc.rb on lines 132..138
modules/exploits/linux/http/cfme_manageiq_evm_upload_exec.rb on lines 140..146
modules/exploits/linux/http/foreman_openstack_satellite_code_exec.rb on lines 113..119

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  def target_url(*args)
    (ssl ? 'https' : 'http') +
      if rport.to_i == 80 || rport.to_i == 443
        "://#{vhost}"
      else
modules/auxiliary/admin/http/cfme_manageiq_evm_pass_reset.rb on lines 155..161
modules/auxiliary/admin/http/foreman_openstack_satellite_priv_esc.rb on lines 132..138
modules/auxiliary/admin/http/katello_satellite_priv_esc.rb on lines 138..144
modules/exploits/linux/http/cfme_manageiq_evm_upload_exec.rb on lines 140..146

Duplicated Code

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

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

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

Tuning

This issue has a mass of 32.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  def validate_active_host
    print_status("Attempting to PrivEsc on #{sysinfo['Computer']} via session ID: #{datastore['SESSION']}")
  rescue Rex::Post::Meterpreter::RequestError => e
    elog('Could not connect to session', error: e)
    raise Msf::Exploit::Failed, 'Could not connect to session'
modules/exploits/windows/local/comahawk.rb on lines 117..122
modules/exploits/windows/local/cve_2020_1048_printerdemon.rb on lines 160..165
modules/exploits/windows/local/cve_2020_1337_printerdemon.rb on lines 162..167
modules/exploits/windows/local/tokenmagic.rb on lines 162..167

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  def validate_active_host
    print_status("Attempting to PrivEsc on #{sysinfo['Computer']} via session ID: #{datastore['SESSION']}")
  rescue Rex::Post::Meterpreter::RequestError => e
    elog('Could not connect to session', error: e)
    raise Msf::Exploit::Failed, 'Could not connect to session'
Severity: Major
Found in modules/exploits/windows/local/cve_2020_1048_printerdemon.rb and 4 other locations - About 30 mins to fix
modules/exploits/windows/local/comahawk.rb on lines 117..122
modules/exploits/windows/local/cve_2020_1313_system_orchestrator.rb on lines 139..144
modules/exploits/windows/local/cve_2020_1337_printerdemon.rb on lines 162..167
modules/exploits/windows/local/tokenmagic.rb on lines 162..167

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  def exploit_template(cli, target_info)
    swf_random = "#{rand_text_alpha(4 + rand(3))}.swf"
    target_payload = get_payload(cli, target_info)
    b64_payload = Rex::Text.encode_base64(target_payload)
    platform_id = 'win'
modules/exploits/windows/browser/adobe_flash_casi32_int_overflow.rb on lines 78..98
modules/exploits/windows/browser/adobe_flash_copy_pixels_to_byte_array.rb on lines 84..104
modules/exploits/windows/browser/adobe_flash_domain_memory_uaf.rb on lines 83..103
modules/exploits/windows/browser/adobe_flash_uncompress_zlib_uninitialized.rb on lines 79..99

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  def target_url(*args)
    (ssl ? 'https' : 'http') +
      if rport.to_i == 80 || rport.to_i == 443
        "://#{vhost}"
      else
Severity: Major
Found in modules/auxiliary/admin/http/cfme_manageiq_evm_pass_reset.rb and 4 other locations - About 30 mins to fix
modules/auxiliary/admin/http/foreman_openstack_satellite_priv_esc.rb on lines 132..138
modules/auxiliary/admin/http/katello_satellite_priv_esc.rb on lines 138..144
modules/exploits/linux/http/cfme_manageiq_evm_upload_exec.rb on lines 140..146
modules/exploits/linux/http/foreman_openstack_satellite_code_exec.rb on lines 113..119

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  def validate_active_host
    print_status("Attempting to PrivEsc on #{sysinfo['Computer']} via session ID: #{datastore['SESSION']}")
  rescue Rex::Post::Meterpreter::RequestError => e
    elog('Could not connect to session', error: e)
    raise Msf::Exploit::Failed, 'Could not connect to session'
Severity: Major
Found in modules/exploits/windows/local/tokenmagic.rb and 4 other locations - About 30 mins to fix
modules/exploits/windows/local/comahawk.rb on lines 117..122
modules/exploits/windows/local/cve_2020_1048_printerdemon.rb on lines 160..165
modules/exploits/windows/local/cve_2020_1313_system_orchestrator.rb on lines 139..144
modules/exploits/windows/local/cve_2020_1337_printerdemon.rb on lines 162..167

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

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