rapid7/metasploit-framework

View on GitHub
tools/exploit/reg.rb

Summary

Maintainability
D
1 day
Test Coverage

File reg.rb has 400 lines of code (exceeds 250 allowed). Consider refactoring.
Open

begin
msfbase = __FILE__
while File.symlink?(msfbase)
  msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
end
Severity: Minor
Found in tools/exploit/reg.rb - About 5 hrs to fix

    Method get_system_information has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

    def get_system_information
      if @hive.hive_name =~ /SYSTEM/
        mounted_devices_info_key = @hive.relative_query("\\MountedDevices")
    
        current_control_set_key = @hive.value_query('\Select\Default')
    Severity: Minor
    Found in tools/exploit/reg.rb - About 3 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method get_boot_key has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    def get_boot_key
    
        return if !@hive.root_key
        return if !@hive.root_key.name
    
    
    Severity: Minor
    Found in tools/exploit/reg.rb - About 45 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method print_all_keys has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    def print_all_keys(nodekey)
    
      return if !nodekey
      return if !nodekey.lf_record
      return if !nodekey.lf_record.children
    Severity: Minor
    Found in tools/exploit/reg.rb - About 25 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method print_all_values has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

      def print_all_values(nodekey)
    
        return if !nodekey
        return if !nodekey.lf_record
        return if !nodekey.lf_record.children
    Severity: Minor
    Found in tools/exploit/reg.rb - About 25 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

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

    when "get_icq_information"
      @hive = Rex::Registry::Hive.new(ARGV[ARGV.length - 1])
    
      if @hive.hive_name !~ /NTUSER\.dat/i && @hive.hive_name !~ /SOFTWARE/
        puts "I need either a SOFTWARE or NTUSER.dat hive, not #{@hive.hive_name}."
    Severity: Minor
    Found in tools/exploit/reg.rb and 2 other locations - About 30 mins to fix
    tools/exploit/reg.rb on lines 504..511
    tools/exploit/reg.rb on lines 531..538

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

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

    when "get_system_information"
      @hive = Rex::Registry::Hive.new(ARGV[ARGV.length - 1])
    
      if @hive.hive_name !~ /SYSTEM/ && @hive.hive_name !~ /SOFTWARE/
        puts "I need the SYSTEM or SOFTWARE hive, not #{@hive.hive_name}."
    Severity: Minor
    Found in tools/exploit/reg.rb and 2 other locations - About 30 mins to fix
    tools/exploit/reg.rb on lines 450..457
    tools/exploit/reg.rb on lines 531..538

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

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

    when "get_user_application_information"
      @hive = Rex::Registry::Hive.new(ARGV[ARGV.length - 1])
    
      if @hive.hive_name !~ /NTUSER\.dat/i && @hive.hive_name !~ /SOFTWARE/
        puts "I need either an NTUSER.dat or SOFTWARE hive, not a #{@hive.hive_name}."
    Severity: Minor
    Found in tools/exploit/reg.rb and 2 other locations - About 30 mins to fix
    tools/exploit/reg.rb on lines 450..457
    tools/exploit/reg.rb on lines 504..511

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

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

    when "get_ie_information"
      @hive = Rex::Registry::Hive.new(ARGV[ARGV.length - 1])
    
      if @hive.hive_name !~ /NTUSER\.dat/i
        puts "I need an NTUSER.dat hive, not #{@hive.hive_name}."
    Severity: Major
    Found in tools/exploit/reg.rb and 9 other locations - About 15 mins to fix
    tools/exploit/reg.rb on lines 341..347
    tools/exploit/reg.rb on lines 359..365
    tools/exploit/reg.rb on lines 368..374
    tools/exploit/reg.rb on lines 441..447
    tools/exploit/reg.rb on lines 468..474
    tools/exploit/reg.rb on lines 477..483
    tools/exploit/reg.rb on lines 486..492
    tools/exploit/reg.rb on lines 495..501
    tools/exploit/reg.rb on lines 522..528

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

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

    when "get_outlook_information"
      @hive = Rex::Registry::Hive.new(ARGV[ARGV.length - 1])
    
      if @hive.hive_name !~ /NTUSER\.dat/i
        puts "I need an NTUSER.dat hive, not #{@hive.hive_name}."
    Severity: Major
    Found in tools/exploit/reg.rb and 9 other locations - About 15 mins to fix
    tools/exploit/reg.rb on lines 341..347
    tools/exploit/reg.rb on lines 359..365
    tools/exploit/reg.rb on lines 368..374
    tools/exploit/reg.rb on lines 441..447
    tools/exploit/reg.rb on lines 459..465
    tools/exploit/reg.rb on lines 468..474
    tools/exploit/reg.rb on lines 486..492
    tools/exploit/reg.rb on lines 495..501
    tools/exploit/reg.rb on lines 522..528

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

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

    when "get_yahoo_messenger_information"
      @hive = Rex::Registry::Hive.new(ARGV[ARGV.length - 1])
    
      if @hive.hive_name !~ /NTUSER\.dat/i
        puts "I need an NTUSER.dat hive, not a #{@hive.hive_name}."
    Severity: Major
    Found in tools/exploit/reg.rb and 9 other locations - About 15 mins to fix
    tools/exploit/reg.rb on lines 341..347
    tools/exploit/reg.rb on lines 359..365
    tools/exploit/reg.rb on lines 368..374
    tools/exploit/reg.rb on lines 441..447
    tools/exploit/reg.rb on lines 459..465
    tools/exploit/reg.rb on lines 468..474
    tools/exploit/reg.rb on lines 477..483
    tools/exploit/reg.rb on lines 486..492
    tools/exploit/reg.rb on lines 522..528

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

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

    when "get_boot_key"
      @hive = Rex::Registry::Hive.new(ARGV[ARGV.length - 1])
    
      if @hive.hive_name !~ /SYSTEM/
        puts "I need a SYSTEM hive to grab the boot key, not a #{@hive.hive_name}."
    Severity: Major
    Found in tools/exploit/reg.rb and 9 other locations - About 15 mins to fix
    tools/exploit/reg.rb on lines 359..365
    tools/exploit/reg.rb on lines 368..374
    tools/exploit/reg.rb on lines 441..447
    tools/exploit/reg.rb on lines 459..465
    tools/exploit/reg.rb on lines 468..474
    tools/exploit/reg.rb on lines 477..483
    tools/exploit/reg.rb on lines 486..492
    tools/exploit/reg.rb on lines 495..501
    tools/exploit/reg.rb on lines 522..528

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

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

    when "get_windows_messenger_information"
      @hive = Rex::Registry::Hive.new(ARGV[ARGV.length - 1])
    
      if @hive.hive_name !~ /NTUSER\.dat/i
        puts "I need an NTUSER.dat hive, not a #{@hive.hive_name}."
    Severity: Major
    Found in tools/exploit/reg.rb and 9 other locations - About 15 mins to fix
    tools/exploit/reg.rb on lines 341..347
    tools/exploit/reg.rb on lines 359..365
    tools/exploit/reg.rb on lines 368..374
    tools/exploit/reg.rb on lines 441..447
    tools/exploit/reg.rb on lines 459..465
    tools/exploit/reg.rb on lines 468..474
    tools/exploit/reg.rb on lines 477..483
    tools/exploit/reg.rb on lines 495..501
    tools/exploit/reg.rb on lines 522..528

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

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

    when "get_msn_messenger_information"
      @hive = Rex::Registry::Hive.new(ARGV[ARGV.length - 1])
    
      if @hive.hive_name !~ /NTUSER\.dat/i
        puts "I need an NTUSER.dat hive, not #{@hive.hive_name}."
    Severity: Major
    Found in tools/exploit/reg.rb and 9 other locations - About 15 mins to fix
    tools/exploit/reg.rb on lines 341..347
    tools/exploit/reg.rb on lines 359..365
    tools/exploit/reg.rb on lines 368..374
    tools/exploit/reg.rb on lines 441..447
    tools/exploit/reg.rb on lines 459..465
    tools/exploit/reg.rb on lines 477..483
    tools/exploit/reg.rb on lines 486..492
    tools/exploit/reg.rb on lines 495..501
    tools/exploit/reg.rb on lines 522..528

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

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

    when "list_applications"
      @hive = Rex::Registry::Hive.new(ARGV[ARGV.length - 1])
    
      if @hive.hive_name !~ /SOFTWARE/
        puts "I need a SOFTWARE hive, not a #{@hive.hive_name}."
    Severity: Major
    Found in tools/exploit/reg.rb and 9 other locations - About 15 mins to fix
    tools/exploit/reg.rb on lines 341..347
    tools/exploit/reg.rb on lines 368..374
    tools/exploit/reg.rb on lines 441..447
    tools/exploit/reg.rb on lines 459..465
    tools/exploit/reg.rb on lines 468..474
    tools/exploit/reg.rb on lines 477..483
    tools/exploit/reg.rb on lines 486..492
    tools/exploit/reg.rb on lines 495..501
    tools/exploit/reg.rb on lines 522..528

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

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

    when "list_drivers"
      @hive = Rex::Registry::Hive.new(ARGV[ARGV.length - 1])
    
      if @hive.hive_name !~ /SYSTEM/
        puts "I need a SYSTEM hive, not a #{@hive.hive_name}."
    Severity: Major
    Found in tools/exploit/reg.rb and 9 other locations - About 15 mins to fix
    tools/exploit/reg.rb on lines 341..347
    tools/exploit/reg.rb on lines 359..365
    tools/exploit/reg.rb on lines 441..447
    tools/exploit/reg.rb on lines 459..465
    tools/exploit/reg.rb on lines 468..474
    tools/exploit/reg.rb on lines 477..483
    tools/exploit/reg.rb on lines 486..492
    tools/exploit/reg.rb on lines 495..501
    tools/exploit/reg.rb on lines 522..528

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

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

    when "get_aol_instant_messenger_information"
      @hive = Rex::Registry::Hive.new(ARGV[ARGV.length - 1])
    
      if @hive.hive_name !~ /NTUSER\.DAT/i
        puts "I need the NTUSER.dat hive, not #{@hive.hive_name}."
    Severity: Major
    Found in tools/exploit/reg.rb and 9 other locations - About 15 mins to fix
    tools/exploit/reg.rb on lines 341..347
    tools/exploit/reg.rb on lines 359..365
    tools/exploit/reg.rb on lines 368..374
    tools/exploit/reg.rb on lines 459..465
    tools/exploit/reg.rb on lines 468..474
    tools/exploit/reg.rb on lines 477..483
    tools/exploit/reg.rb on lines 486..492
    tools/exploit/reg.rb on lines 495..501
    tools/exploit/reg.rb on lines 522..528

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

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

    when "get_user_information"
      @hive = Rex::Registry::Hive.new(ARGV[ARGV.length - 1])
    
      if @hive.hive_name !~ /SAM/
        puts "I need a SAM hive. Not a #{@hive.hive_name}."
    Severity: Major
    Found in tools/exploit/reg.rb and 9 other locations - About 15 mins to fix
    tools/exploit/reg.rb on lines 341..347
    tools/exploit/reg.rb on lines 359..365
    tools/exploit/reg.rb on lines 368..374
    tools/exploit/reg.rb on lines 441..447
    tools/exploit/reg.rb on lines 459..465
    tools/exploit/reg.rb on lines 468..474
    tools/exploit/reg.rb on lines 477..483
    tools/exploit/reg.rb on lines 486..492
    tools/exploit/reg.rb on lines 495..501

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

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

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

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

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

    Refactorings

    Further Reading

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

    def get_msn_messenger_information
    
      if @hive.hive_name =~ /NTUSER\.dat/i
        general_information_key = @hive.relative_query("\\Software\\Microsoft\\MessengerService\\ListCache\\.NETMessengerService\\")
        file_sharing_information_key = @hive.relative_query("\\Software\\Microsoft\\MSNMessenger\\FileSharing - Autoshare")
    Severity: Minor
    Found in tools/exploit/reg.rb and 1 other location - About 15 mins to fix
    tools/exploit/reg.rb on lines 207..215

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

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

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

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

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

    Refactorings

    Further Reading

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

    def get_windows_messenger_information
      if @hive.hive_name =~ /NTUSER\.dat/i
        contact_list_information_key = @hive.relative_query("\\Software\\Microsoft\\MessengerService\\ListCache\\.NET Messenger Service")
        file_transfers_information_key = @hive.relative_query("\\Software\\Microsoft\\Messenger Service - FtReceiveFolder")
        last_user_information_key = @hive.relative_query("\\Software\\Microsoft\\MessengerService\\ListCache\\.NET Messenger Service - IdentityName")
    Severity: Minor
    Found in tools/exploit/reg.rb and 1 other location - About 15 mins to fix
    tools/exploit/reg.rb on lines 194..203

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

    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