ronin-rb/ronin-exploits

View on GitHub

Showing 28 of 28 total issues

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

module Ronin
  module Exploits
    module Mixins
      #
      # Adds TCP helper methods for communicating with a remote host.
Severity: Major
Found in lib/ronin/exploits/mixins/remote_tcp.rb and 1 other location - About 6 hrs to fix
lib/ronin/exploits/mixins/remote_udp.rb on lines 28..262

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

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

module Ronin
  module Exploits
    module Mixins
      #
      # Adds UDP helper methods for communicating with a remote host.
Severity: Major
Found in lib/ronin/exploits/mixins/remote_udp.rb and 1 other location - About 6 hrs to fix
lib/ronin/exploits/mixins/remote_tcp.rb on lines 28..270

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

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

Class Exploit has 28 methods (exceeds 20 allowed). Consider refactoring.
Open

    class Exploit

      include Core::Metadata::ID
      include Core::Metadata::Authors
      include Core::Metadata::Summary
Severity: Minor
Found in lib/ronin/exploits/exploit.rb - About 3 hrs to fix

    Method print_metadata has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

              def print_metadata(exploit)
                fields = {
                  'Type' => exploit_type(exploit)
                }
    
    
    Severity: Minor
    Found in lib/ronin/exploits/cli/commands/show.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

    File run.rb has 282 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'ronin/exploits/cli/exploit_command'
    require 'ronin/exploits/cli/ruby_shell'
    require 'ronin/exploits/mixins/has_payload'
    require 'ronin/exploits/mixins/has_targets'
    require 'ronin/exploits/mixins/loot'
    Severity: Minor
    Found in lib/ronin/exploits/cli/commands/run.rb - About 2 hrs to fix

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

      module Ronin
        module Exploits
          module Mixins
            #
            # Methods for building Structured Exception Handler (SEH) buffer
      Severity: Major
      Found in lib/ronin/exploits/mixins/seh.rb and 1 other location - About 1 hr to fix
      lib/ronin/exploits/mixins/stack_overflow.rb on lines 26..120

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

      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

      module Ronin
        module Exploits
          module Mixins
            #
            # Methods for building Stack Overflow buffers.
      Severity: Major
      Found in lib/ronin/exploits/mixins/stack_overflow.rb and 1 other location - About 1 hr to fix
      lib/ronin/exploits/mixins/seh.rb on lines 26..132

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

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

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

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

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

      Refactorings

      Further Reading

      Method print_metadata has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                def print_metadata(exploit)
                  fields = {
                    'Type' => exploit_type(exploit)
                  }
      
      
      Severity: Minor
      Found in lib/ronin/exploits/cli/commands/show.rb - About 1 hr to fix

        Method print_target has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

                  def print_target(target)
                    fields = {}
        
                    fields['Arch'] = target.arch if target.arch
        
        
        Severity: Minor
        Found in lib/ronin/exploits/cli/commands/show.rb - About 1 hr 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 shouts has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

                  def shouts(new_shouts=nil)
                    if new_shouts
                      @shouts = if superclass.kind_of?(ClassMethods)
                                  superclass.shouts + new_shouts
                                else
        Severity: Minor
        Found in lib/ronin/exploits/metadata/shouts.rb - About 55 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 post_exploitation has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

                  def post_exploitation
                    if @exploit_class.include?(Mixins::HasPayload) &&
                       @exploit.payload.kind_of?(Ronin::Payloads::Payload) &&
                       @exploit.payload.kind_of?(Ronin::Payloads::Mixins::PostEx)
                      unless @exploit.payload.session
        Severity: Minor
        Found in lib/ronin/exploits/cli/commands/run.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 select_target has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

                def select_target(arch: nil, os: nil, os_version: nil, software: nil, version: nil)
                  targets = self.class.targets.lazy
        
                  if arch
                    targets = targets.select { |target| target.arch == arch }
        Severity: Minor
        Found in lib/ronin/exploits/mixins/has_targets.rb - About 35 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 2 locations. Consider refactoring.
        Open

                def attr_name(name, name_case: nil)
                  name = name.to_s
        
                  case name_case
                  when :random then name.random_case
        Severity: Minor
        Found in lib/ronin/exploits/mixins/html.rb and 1 other location - About 35 mins to fix
        lib/ronin/exploits/mixins/html.rb on lines 143..152

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

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

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

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

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

        Refactorings

        Further Reading

        Method print_exploit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

                  def print_exploit(exploit)
                    puts "[ #{exploit.id} ]"
                    puts
        
                    indent do
        Severity: Minor
        Found in lib/ronin/exploits/cli/commands/show.rb - About 35 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 2 locations. Consider refactoring.
        Open

                def tag_name(name, name_case: nil)
                  name = name.to_s
        
                  case name_case
                  when :random then name.random_case
        Severity: Minor
        Found in lib/ronin/exploits/mixins/html.rb and 1 other location - About 35 mins to fix
        lib/ronin/exploits/mixins/html.rb on lines 47..56

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

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

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

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

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

        Refactorings

        Further Reading

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

          module Exploits
            module Metadata
              #
              # Adds a {HeaderName::ClassMethods#header_name header_name} metadata
              # attribute to an exploit class.
        Severity: Minor
        Found in lib/ronin/exploits/metadata/header_name.rb and 3 other locations - About 30 mins to fix
        lib/ronin/exploits/metadata/arch.rb on lines 23..82
        lib/ronin/exploits/metadata/cookie_param.rb on lines 23..79
        lib/ronin/exploits/metadata/url_query_param.rb on lines 23..79

        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

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

          module Exploits
            module Metadata
              #
              # Metadata mixin that allows an exploit to define which architecture it
              # specifically targets.
        Severity: Minor
        Found in lib/ronin/exploits/metadata/arch.rb and 3 other locations - About 30 mins to fix
        lib/ronin/exploits/metadata/cookie_param.rb on lines 23..79
        lib/ronin/exploits/metadata/header_name.rb on lines 23..79
        lib/ronin/exploits/metadata/url_query_param.rb on lines 23..79

        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

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

          module Exploits
            module Metadata
              #
              # Adds a {CookieParam::ClassMethods#cookie_param cookie_param} metadata
              # attribute to an exploit class.
        Severity: Minor
        Found in lib/ronin/exploits/metadata/cookie_param.rb and 3 other locations - About 30 mins to fix
        lib/ronin/exploits/metadata/arch.rb on lines 23..82
        lib/ronin/exploits/metadata/header_name.rb on lines 23..79
        lib/ronin/exploits/metadata/url_query_param.rb on lines 23..79

        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

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

          module Exploits
            module Metadata
              #
              # Adds a {URLQueryParam::ClassMethods#url_query_param url_query_param}
              # metadata attribute to an exploit class.
        Severity: Minor
        Found in lib/ronin/exploits/metadata/url_query_param.rb and 3 other locations - About 30 mins to fix
        lib/ronin/exploits/metadata/arch.rb on lines 23..82
        lib/ronin/exploits/metadata/cookie_param.rb on lines 23..79
        lib/ronin/exploits/metadata/header_name.rb on lines 23..79

        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

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

        module Ronin
          module Exploits
            module Params
              #
              # Adds the required `port` param to the exploit.
        Severity: Minor
        Found in lib/ronin/exploits/params/port.rb and 1 other location - About 25 mins to fix
        lib/ronin/exploits/params/filename.rb on lines 24..67

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

        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