rapid7/metasploit-framework

View on GitHub

Showing 7,361 of 22,177 total issues

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

  def initialize(info = {})
    super(merge_info(info,
       'Name'          => 'Unix Command Shell, Reverse TCP SSL (telnet)',
       'Description'   => %q{
        Creates an interactive shell via mkfifo and telnet.
modules/payloads/singles/cmd/unix/bind_ruby.rb on lines 14..31
modules/payloads/singles/cmd/unix/bind_ruby_ipv6.rb on lines 14..31
modules/payloads/singles/cmd/unix/reverse_ksh.rb on lines 14..34
modules/payloads/singles/cmd/unix/reverse_perl.rb on lines 14..35
modules/payloads/singles/cmd/unix/reverse_perl_ssl.rb on lines 14..35
modules/payloads/singles/cmd/unix/reverse_php_ssl.rb on lines 14..35
modules/payloads/singles/cmd/unix/reverse_python_ssl.rb on lines 15..36
modules/payloads/singles/cmd/unix/reverse_ruby.rb on lines 14..31
modules/payloads/singles/cmd/unix/reverse_ruby_ssl.rb on lines 14..31
modules/payloads/singles/cmd/windows/bind_ruby.rb on lines 14..31
modules/payloads/singles/cmd/windows/reverse_ruby.rb on lines 14..31

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

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

  def initialize(info = {})
    super(merge_info(info,
     'Name'          => 'Unix Command Shell, Reverse TCP SSL (via php)',
     'Description'   => 'Creates an interactive shell via php, uses SSL',
     'Author'        => 'RageLtMan <rageltman[at]sempervictus>',
Severity: Major
Found in modules/payloads/singles/cmd/unix/reverse_php_ssl.rb and 11 other locations - About 1 hr to fix
modules/payloads/singles/cmd/unix/bind_ruby.rb on lines 14..31
modules/payloads/singles/cmd/unix/bind_ruby_ipv6.rb on lines 14..31
modules/payloads/singles/cmd/unix/reverse_bash_telnet_ssl.rb on lines 14..40
modules/payloads/singles/cmd/unix/reverse_ksh.rb on lines 14..34
modules/payloads/singles/cmd/unix/reverse_perl.rb on lines 14..35
modules/payloads/singles/cmd/unix/reverse_perl_ssl.rb on lines 14..35
modules/payloads/singles/cmd/unix/reverse_python_ssl.rb on lines 15..36
modules/payloads/singles/cmd/unix/reverse_ruby.rb on lines 14..31
modules/payloads/singles/cmd/unix/reverse_ruby_ssl.rb on lines 14..31
modules/payloads/singles/cmd/windows/bind_ruby.rb on lines 14..31
modules/payloads/singles/cmd/windows/reverse_ruby.rb on lines 14..31

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

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

  def initialize(info = {})
    super(merge_info(info,
     'Name'        => 'Unix Command Shell, Bind TCP (via Ruby)',
     'Description' => 'Continually listen for a connection and spawn a command shell via Ruby',
     'Author'      => 'kris katterjohn',
Severity: Major
Found in modules/payloads/singles/cmd/unix/bind_ruby.rb and 11 other locations - About 1 hr to fix
modules/payloads/singles/cmd/unix/bind_ruby_ipv6.rb on lines 14..31
modules/payloads/singles/cmd/unix/reverse_bash_telnet_ssl.rb on lines 14..40
modules/payloads/singles/cmd/unix/reverse_ksh.rb on lines 14..34
modules/payloads/singles/cmd/unix/reverse_perl.rb on lines 14..35
modules/payloads/singles/cmd/unix/reverse_perl_ssl.rb on lines 14..35
modules/payloads/singles/cmd/unix/reverse_php_ssl.rb on lines 14..35
modules/payloads/singles/cmd/unix/reverse_python_ssl.rb on lines 15..36
modules/payloads/singles/cmd/unix/reverse_ruby.rb on lines 14..31
modules/payloads/singles/cmd/unix/reverse_ruby_ssl.rb on lines 14..31
modules/payloads/singles/cmd/windows/bind_ruby.rb on lines 14..31
modules/payloads/singles/cmd/windows/reverse_ruby.rb on lines 14..31

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

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

  def initialize(info = {})
    super(merge_info(info,
     'Name'        => 'Unix Command Shell, Bind TCP (via Ruby) IPv6',
     'Description' => 'Continually listen for a connection and spawn a command shell via Ruby',
     'Author'      => 'kris katterjohn',
Severity: Major
Found in modules/payloads/singles/cmd/unix/bind_ruby_ipv6.rb and 11 other locations - About 1 hr to fix
modules/payloads/singles/cmd/unix/bind_ruby.rb on lines 14..31
modules/payloads/singles/cmd/unix/reverse_bash_telnet_ssl.rb on lines 14..40
modules/payloads/singles/cmd/unix/reverse_ksh.rb on lines 14..34
modules/payloads/singles/cmd/unix/reverse_perl.rb on lines 14..35
modules/payloads/singles/cmd/unix/reverse_perl_ssl.rb on lines 14..35
modules/payloads/singles/cmd/unix/reverse_php_ssl.rb on lines 14..35
modules/payloads/singles/cmd/unix/reverse_python_ssl.rb on lines 15..36
modules/payloads/singles/cmd/unix/reverse_ruby.rb on lines 14..31
modules/payloads/singles/cmd/unix/reverse_ruby_ssl.rb on lines 14..31
modules/payloads/singles/cmd/windows/bind_ruby.rb on lines 14..31
modules/payloads/singles/cmd/windows/reverse_ruby.rb on lines 14..31

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

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

  def self.get_host_tags
    lambda {
      warden.authenticate!
      begin
        opts = parse_json_request(request, false)
Severity: Major
Found in lib/msf/core/web_services/servlet/host_servlet.rb and 9 other locations - About 1 hr to fix
lib/msf/core/web_services/servlet/host_servlet.rb on lines 63..74
lib/msf/core/web_services/servlet/host_servlet.rb on lines 107..119
lib/msf/core/web_services/servlet/host_servlet.rb on lines 123..134
lib/msf/core/web_services/servlet/login_servlet.rb on lines 52..63
lib/msf/core/web_services/servlet/note_servlet.rb on lines 48..59
lib/msf/core/web_services/servlet/payload_servlet.rb on lines 50..61
lib/msf/core/web_services/servlet/service_servlet.rb on lines 47..58
lib/msf/core/web_services/servlet/session_servlet.rb on lines 55..66
lib/msf/core/web_services/servlet/workspace_servlet.rb on lines 52..63

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

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

  def decoder_stub(state)
    # If the decoder stub has not already been generated for this state, do
    # it now.  The decoder stub method may be called more than once.
    if (state.decoder_stub == nil)
      # Shikata will only cut off the last 1-4 bytes of it's own end
Severity: Major
Found in modules/encoders/x86/context_cpuid.rb and 2 other locations - About 1 hr to fix
modules/encoders/x86/context_stat.rb on lines 48..67
modules/encoders/x86/context_time.rb on lines 48..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 47.

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

  def initialize(info = {})
    super(merge_info(info,
     'Name'          => 'Unix Command Shell, Reverse TCP SSL (via perl)',
     'Description'   => 'Creates an interactive shell via perl, uses SSL',
     'Author'        => 'RageLtMan <rageltman[at]sempervictus>',
Severity: Major
Found in modules/payloads/singles/cmd/unix/reverse_perl_ssl.rb and 11 other locations - About 1 hr to fix
modules/payloads/singles/cmd/unix/bind_ruby.rb on lines 14..31
modules/payloads/singles/cmd/unix/bind_ruby_ipv6.rb on lines 14..31
modules/payloads/singles/cmd/unix/reverse_bash_telnet_ssl.rb on lines 14..40
modules/payloads/singles/cmd/unix/reverse_ksh.rb on lines 14..34
modules/payloads/singles/cmd/unix/reverse_perl.rb on lines 14..35
modules/payloads/singles/cmd/unix/reverse_php_ssl.rb on lines 14..35
modules/payloads/singles/cmd/unix/reverse_python_ssl.rb on lines 15..36
modules/payloads/singles/cmd/unix/reverse_ruby.rb on lines 14..31
modules/payloads/singles/cmd/unix/reverse_ruby_ssl.rb on lines 14..31
modules/payloads/singles/cmd/windows/bind_ruby.rb on lines 14..31
modules/payloads/singles/cmd/windows/reverse_ruby.rb on lines 14..31

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

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

  def initialize(info = {})
    super(merge_info(info,
     'Name'        => 'Windows Command Shell, Reverse TCP (via Ruby)',
     'Description' => 'Connect back and create a command shell via Ruby',
     'Author'      => 'kris katterjohn',
Severity: Major
Found in modules/payloads/singles/cmd/windows/reverse_ruby.rb and 11 other locations - About 1 hr to fix
modules/payloads/singles/cmd/unix/bind_ruby.rb on lines 14..31
modules/payloads/singles/cmd/unix/bind_ruby_ipv6.rb on lines 14..31
modules/payloads/singles/cmd/unix/reverse_bash_telnet_ssl.rb on lines 14..40
modules/payloads/singles/cmd/unix/reverse_ksh.rb on lines 14..34
modules/payloads/singles/cmd/unix/reverse_perl.rb on lines 14..35
modules/payloads/singles/cmd/unix/reverse_perl_ssl.rb on lines 14..35
modules/payloads/singles/cmd/unix/reverse_php_ssl.rb on lines 14..35
modules/payloads/singles/cmd/unix/reverse_python_ssl.rb on lines 15..36
modules/payloads/singles/cmd/unix/reverse_ruby.rb on lines 14..31
modules/payloads/singles/cmd/unix/reverse_ruby_ssl.rb on lines 14..31
modules/payloads/singles/cmd/windows/bind_ruby.rb on lines 14..31

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

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

  def self.update_note
    lambda {
      warden.authenticate!
      begin
        opts = parse_json_request(request, false)
Severity: Major
Found in lib/msf/core/web_services/servlet/note_servlet.rb and 9 other locations - About 1 hr to fix
lib/msf/core/web_services/servlet/host_servlet.rb on lines 63..74
lib/msf/core/web_services/servlet/host_servlet.rb on lines 91..103
lib/msf/core/web_services/servlet/host_servlet.rb on lines 107..119
lib/msf/core/web_services/servlet/host_servlet.rb on lines 123..134
lib/msf/core/web_services/servlet/login_servlet.rb on lines 52..63
lib/msf/core/web_services/servlet/payload_servlet.rb on lines 50..61
lib/msf/core/web_services/servlet/service_servlet.rb on lines 47..58
lib/msf/core/web_services/servlet/session_servlet.rb on lines 55..66
lib/msf/core/web_services/servlet/workspace_servlet.rb on lines 52..63

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

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

  def get_custom_headers(ds)
    headers = ""
    headers << "Host: #{ds['HttpHostHeader']}\r\n" if ds['HttpHostHeader']
    headers << "Cookie: #{ds['HttpCookie']}\r\n" if ds['HttpCookie']
    headers << "Referer: #{ds['HttpReferer']}\r\n" if ds['HttpReferer']
Severity: Major
Found in lib/msf/core/payload/windows/reverse_http.rb and 2 other locations - About 1 hr to fix
lib/msf/core/payload/transport_config.rb on lines 125..134
lib/msf/core/payload/windows/x64/reverse_http_x64.rb on lines 72..81

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

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

  def decoder_stub(state)
    # If the decoder stub has not already been generated for this state, do
    # it now.  The decoder stub method may be called more than once.
    if (state.decoder_stub == nil)
      # Shikata will only cut off the last 1-4 bytes of it's own end
Severity: Major
Found in modules/encoders/x86/context_time.rb and 2 other locations - About 1 hr to fix
modules/encoders/x86/context_cpuid.rb on lines 47..66
modules/encoders/x86/context_stat.rb on lines 48..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 47.

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

  def self.add_host_tag
    lambda {
      warden.authenticate!
      begin
        opts = parse_json_request(request, false)
Severity: Major
Found in lib/msf/core/web_services/servlet/host_servlet.rb and 9 other locations - About 1 hr to fix
lib/msf/core/web_services/servlet/host_servlet.rb on lines 63..74
lib/msf/core/web_services/servlet/host_servlet.rb on lines 91..103
lib/msf/core/web_services/servlet/host_servlet.rb on lines 123..134
lib/msf/core/web_services/servlet/login_servlet.rb on lines 52..63
lib/msf/core/web_services/servlet/note_servlet.rb on lines 48..59
lib/msf/core/web_services/servlet/payload_servlet.rb on lines 50..61
lib/msf/core/web_services/servlet/service_servlet.rb on lines 47..58
lib/msf/core/web_services/servlet/session_servlet.rb on lines 55..66
lib/msf/core/web_services/servlet/workspace_servlet.rb on lines 52..63

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

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

  def self.update_workspace
    lambda {
      warden.authenticate!
      begin
        opts = parse_json_request(request, false)
Severity: Major
Found in lib/msf/core/web_services/servlet/workspace_servlet.rb and 9 other locations - About 1 hr to fix
lib/msf/core/web_services/servlet/host_servlet.rb on lines 63..74
lib/msf/core/web_services/servlet/host_servlet.rb on lines 91..103
lib/msf/core/web_services/servlet/host_servlet.rb on lines 107..119
lib/msf/core/web_services/servlet/host_servlet.rb on lines 123..134
lib/msf/core/web_services/servlet/login_servlet.rb on lines 52..63
lib/msf/core/web_services/servlet/note_servlet.rb on lines 48..59
lib/msf/core/web_services/servlet/payload_servlet.rb on lines 50..61
lib/msf/core/web_services/servlet/service_servlet.rb on lines 47..58
lib/msf/core/web_services/servlet/session_servlet.rb on lines 55..66

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

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

    if(response.headers.has_key?('Server') )
      if(response.headers['Server'] =~ /IIS/ or response.headers['Server'] =~ /\(Windows/)
        os = "Windows (#{response.headers['Server']})"
      elsif(response.headers['Server'] =~ /Apache\//)
        os = "Unix (#{response.headers['Server']})"
Severity: Major
Found in modules/auxiliary/scanner/http/coldfusion_version.rb and 2 other locations - About 1 hr to fix
modules/auxiliary/gather/coldfusion_pwd_props.rb on lines 43..50
modules/auxiliary/scanner/http/coldfusion_locale_traversal.rb on lines 53..60

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

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

  def self.update_login
    lambda {
      warden.authenticate!
      begin
        opts = parse_json_request(request, false)
Severity: Major
Found in lib/msf/core/web_services/servlet/login_servlet.rb and 9 other locations - About 1 hr to fix
lib/msf/core/web_services/servlet/host_servlet.rb on lines 63..74
lib/msf/core/web_services/servlet/host_servlet.rb on lines 91..103
lib/msf/core/web_services/servlet/host_servlet.rb on lines 107..119
lib/msf/core/web_services/servlet/host_servlet.rb on lines 123..134
lib/msf/core/web_services/servlet/note_servlet.rb on lines 48..59
lib/msf/core/web_services/servlet/payload_servlet.rb on lines 50..61
lib/msf/core/web_services/servlet/service_servlet.rb on lines 47..58
lib/msf/core/web_services/servlet/session_servlet.rb on lines 55..66
lib/msf/core/web_services/servlet/workspace_servlet.rb on lines 52..63

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

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

  def self.update_host
    lambda {
      warden.authenticate!
      begin
        opts = parse_json_request(request, false)
Severity: Major
Found in lib/msf/core/web_services/servlet/host_servlet.rb and 9 other locations - About 1 hr to fix
lib/msf/core/web_services/servlet/host_servlet.rb on lines 91..103
lib/msf/core/web_services/servlet/host_servlet.rb on lines 107..119
lib/msf/core/web_services/servlet/host_servlet.rb on lines 123..134
lib/msf/core/web_services/servlet/login_servlet.rb on lines 52..63
lib/msf/core/web_services/servlet/note_servlet.rb on lines 48..59
lib/msf/core/web_services/servlet/payload_servlet.rb on lines 50..61
lib/msf/core/web_services/servlet/service_servlet.rb on lines 47..58
lib/msf/core/web_services/servlet/session_servlet.rb on lines 55..66
lib/msf/core/web_services/servlet/workspace_servlet.rb on lines 52..63

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

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

  def get_custom_headers(ds)
    headers = ""
    headers << "Host: #{ds['HttpHostHeader']}\r\n" if ds['HttpHostHeader']
    headers << "Cookie: #{ds['HttpCookie']}\r\n" if ds['HttpCookie']
    headers << "Referer: #{ds['HttpReferer']}\r\n" if ds['HttpReferer']
Severity: Major
Found in lib/msf/core/payload/transport_config.rb and 2 other locations - About 1 hr to fix
lib/msf/core/payload/windows/reverse_http.rb on lines 67..76
lib/msf/core/payload/windows/x64/reverse_http_x64.rb on lines 72..81

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

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

  def self.update_service
    lambda {
      warden.authenticate!
      begin
        opts = parse_json_request(request, false)
Severity: Major
Found in lib/msf/core/web_services/servlet/service_servlet.rb and 9 other locations - About 1 hr to fix
lib/msf/core/web_services/servlet/host_servlet.rb on lines 63..74
lib/msf/core/web_services/servlet/host_servlet.rb on lines 91..103
lib/msf/core/web_services/servlet/host_servlet.rb on lines 107..119
lib/msf/core/web_services/servlet/host_servlet.rb on lines 123..134
lib/msf/core/web_services/servlet/login_servlet.rb on lines 52..63
lib/msf/core/web_services/servlet/note_servlet.rb on lines 48..59
lib/msf/core/web_services/servlet/payload_servlet.rb on lines 50..61
lib/msf/core/web_services/servlet/session_servlet.rb on lines 55..66
lib/msf/core/web_services/servlet/workspace_servlet.rb on lines 52..63

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

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

  def self.update_session
    lambda {
      warden.authenticate!
      begin
        opts = parse_json_request(request, false)
Severity: Major
Found in lib/msf/core/web_services/servlet/session_servlet.rb and 9 other locations - About 1 hr to fix
lib/msf/core/web_services/servlet/host_servlet.rb on lines 63..74
lib/msf/core/web_services/servlet/host_servlet.rb on lines 91..103
lib/msf/core/web_services/servlet/host_servlet.rb on lines 107..119
lib/msf/core/web_services/servlet/host_servlet.rb on lines 123..134
lib/msf/core/web_services/servlet/login_servlet.rb on lines 52..63
lib/msf/core/web_services/servlet/note_servlet.rb on lines 48..59
lib/msf/core/web_services/servlet/payload_servlet.rb on lines 50..61
lib/msf/core/web_services/servlet/service_servlet.rb on lines 47..58
lib/msf/core/web_services/servlet/workspace_servlet.rb on lines 52..63

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

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

    if(response.headers.has_key?('Server') )
      if(response.headers['Server'] =~ /IIS/ or response.headers['Server'] =~ /\(Windows/)
        os = "Windows (#{response.headers['Server']})"
      elsif(response.headers['Server'] =~ /Apache\//)
          os = "Unix (#{response.headers['Server']})"
Severity: Major
Found in modules/auxiliary/gather/coldfusion_pwd_props.rb and 2 other locations - About 1 hr to fix
modules/auxiliary/scanner/http/coldfusion_locale_traversal.rb on lines 53..60
modules/auxiliary/scanner/http/coldfusion_version.rb on lines 29..36

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

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