rapid7/metasploit-framework

View on GitHub
modules/exploits/windows/browser/adobe_flash_uncompress_zlib_uninitialized.rb

Summary

Maintainability
B
5 hrs
Test Coverage

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

  def initialize(info={})
    super(update_info(info,
      'Name'                => 'Adobe Flash Player UncompressViaZlibVariant Uninitialized Memory',
      'Description'         => %q{
        This module exploits an uninitialized memory vulnerability in Adobe Flash Player. The

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

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

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 101.

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

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

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

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

    Refactorings

    Further Reading

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

      def on_request_exploit(cli, request, target_info)
        print_status("Request: #{request.uri}")
    
        if request.uri =~ /\.swf$/
          print_status('Sending SWF...')
    modules/exploits/multi/browser/adobe_flash_hacking_team_uaf.rb on lines 107..117
    modules/exploits/multi/browser/adobe_flash_net_connection_confusion.rb on lines 103..113
    modules/exploits/multi/browser/adobe_flash_opaque_background_uaf.rb on lines 103..113
    modules/exploits/multi/browser/adobe_flash_pixel_bender_bof.rb on lines 100..110
    modules/exploits/multi/browser/adobe_flash_shader_drawing_fill.rb on lines 98..108
    modules/exploits/multi/browser/adobe_flash_shader_job_overflow.rb on lines 102..112
    modules/exploits/multi/browser/adobe_flash_uncompress_zlib_uaf.rb on lines 98..108
    modules/exploits/windows/browser/adobe_flash_casi32_int_overflow.rb on lines 65..75
    modules/exploits/windows/browser/adobe_flash_copy_pixels_to_byte_array.rb on lines 71..81
    modules/exploits/windows/browser/adobe_flash_domain_memory_uaf.rb on lines 70..80
    modules/exploits/windows/browser/adobe_flash_worker_byte_array_uaf.rb on lines 65..75

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

    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_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

    There are no issues that match your filters.

    Category
    Status