rapid7/metasploit-framework

View on GitHub
scripts/meterpreter/checkvm.rb

Summary

Maintainability
F
4 days
Test Coverage

Method vboxchk has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
Open

def vboxchk(session)
  vm = false
  vboxprocs = [
    "vboxservice.exe",
    "vboxtray.exe"
Severity: Minor
Found in scripts/meterpreter/checkvm.rb - About 6 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 xenchk has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

def xenchk(session)
  vm = false
  xenprocs = [
    "xenservice.exe"
  ]
Severity: Minor
Found in scripts/meterpreter/checkvm.rb - About 4 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 checkvm.rb has 334 lines of code (exceeds 250 allowed). Consider refactoring.
Open

session = client

@@exec_opts = Rex::Parser::Arguments.new(
  "-h" => [ false,"Help menu." ]
)
Severity: Minor
Found in scripts/meterpreter/checkvm.rb - About 4 hrs to fix

    Method vboxchk has 88 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def vboxchk(session)
      vm = false
      vboxprocs = [
        "vboxservice.exe",
        "vboxtray.exe"
    Severity: Major
    Found in scripts/meterpreter/checkvm.rb - About 3 hrs to fix

      Method xenchk has 70 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def xenchk(session)
        vm = false
        xenprocs = [
          "xenservice.exe"
        ]
      Severity: Major
      Found in scripts/meterpreter/checkvm.rb - About 2 hrs to fix

        Method vmwarechk has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

        def vmwarechk(session)
          vm = false
          begin
          key = session.sys.registry.open_key(HKEY_LOCAL_MACHINE, 'SYSTEM\ControlSet001\Services', KEY_READ)
          srvvals = key.enum_key
        Severity: Minor
        Found in scripts/meterpreter/checkvm.rb - About 2 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 checkvrtlpc has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

        def checkvrtlpc(session)
          vm = false
          vpcprocs = [
            "vmusrvc.exe",
            "vmsrvc.exe"
        Severity: Minor
        Found in scripts/meterpreter/checkvm.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 vmwarechk has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        def vmwarechk(session)
          vm = false
          begin
          key = session.sys.registry.open_key(HKEY_LOCAL_MACHINE, 'SYSTEM\ControlSet001\Services', KEY_READ)
          srvvals = key.enum_key
        Severity: Minor
        Found in scripts/meterpreter/checkvm.rb - About 1 hr to fix

          Method checkvrtlpc has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          def checkvrtlpc(session)
            vm = false
            vpcprocs = [
              "vmusrvc.exe",
              "vmsrvc.exe"
          Severity: Minor
          Found in scripts/meterpreter/checkvm.rb - About 1 hr to fix

            Method hypervchk has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            def hypervchk(session)
              begin
                vm = false
                key = session.sys.registry.open_key(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft', KEY_READ)
                sfmsvals = key.enum_key
            Severity: Minor
            Found in scripts/meterpreter/checkvm.rb - About 1 hr to fix

              Method hypervchk has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

              def hypervchk(session)
                begin
                  vm = false
                  key = session.sys.registry.open_key(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft', KEY_READ)
                  sfmsvals = key.enum_key
              Severity: Minor
              Found in scripts/meterpreter/checkvm.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 qemuchk has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              def qemuchk(session)
                vm = false
                if not vm
                  begin
                    key = session.sys.registry.open_key(HKEY_LOCAL_MACHINE, 'HARDWARE\DEVICEMAP\Scsi\Scsi Port 0\Scsi Bus 0\Target Id 0\Logical Unit Id 0')
              Severity: Minor
              Found in scripts/meterpreter/checkvm.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

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

                if not vm
                  begin
                  key = session.sys.registry.open_key(HKEY_LOCAL_MACHINE, 'SYSTEM\ControlSet001\Services', KEY_READ)
                  srvvals = key.enum_key
                  if srvvals.include?("vpcbus")
              Severity: Major
              Found in scripts/meterpreter/checkvm.rb and 1 other location - About 1 hr to fix
              scripts/meterpreter/checkvm.rb on lines 223..241

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

              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

                if not vm
                  begin
                  key = session.sys.registry.open_key(HKEY_LOCAL_MACHINE, 'SYSTEM\ControlSet001\Services', KEY_READ)
                  srvvals = key.enum_key
                  if srvvals.include?("VBoxMouse")
              Severity: Major
              Found in scripts/meterpreter/checkvm.rb and 1 other location - About 1 hr to fix
              scripts/meterpreter/checkvm.rb on lines 132..150

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

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

                if not vm
                begin
                  key = session.sys.registry.open_key(HKEY_LOCAL_MACHINE, 'HARDWARE\ACPI\DSDT', KEY_READ)
                  srvvals = key.enum_key
                  if srvvals.include?("VBOX__")
              Severity: Minor
              Found in scripts/meterpreter/checkvm.rb and 5 other locations - About 20 mins to fix
              scripts/meterpreter/checkvm.rb on lines 181..189
              scripts/meterpreter/checkvm.rb on lines 192..200
              scripts/meterpreter/checkvm.rb on lines 260..268
              scripts/meterpreter/checkvm.rb on lines 271..279
              scripts/meterpreter/checkvm.rb on lines 282..290

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

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

                if not vm
                begin
                  key = session.sys.registry.open_key(HKEY_LOCAL_MACHINE, 'HARDWARE\ACPI\DSDT', KEY_READ)
                  srvvals = key.enum_key
                  if srvvals.include?("Xen")
              Severity: Minor
              Found in scripts/meterpreter/checkvm.rb and 5 other locations - About 20 mins to fix
              scripts/meterpreter/checkvm.rb on lines 170..178
              scripts/meterpreter/checkvm.rb on lines 181..189
              scripts/meterpreter/checkvm.rb on lines 192..200
              scripts/meterpreter/checkvm.rb on lines 271..279
              scripts/meterpreter/checkvm.rb on lines 282..290

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

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

                if not vm
                  begin
                  key = session.sys.registry.open_key(HKEY_LOCAL_MACHINE, 'HARDWARE\ACPI\FADT', KEY_READ)
                  srvvals = key.enum_key
                  if srvvals.include?("Xen")
              Severity: Minor
              Found in scripts/meterpreter/checkvm.rb and 5 other locations - About 20 mins to fix
              scripts/meterpreter/checkvm.rb on lines 170..178
              scripts/meterpreter/checkvm.rb on lines 181..189
              scripts/meterpreter/checkvm.rb on lines 192..200
              scripts/meterpreter/checkvm.rb on lines 260..268
              scripts/meterpreter/checkvm.rb on lines 282..290

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

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

                if not vm
                  begin
                  key = session.sys.registry.open_key(HKEY_LOCAL_MACHINE, 'HARDWARE\ACPI\FADT', KEY_READ)
                  srvvals = key.enum_key
                  if srvvals.include?("VBOX__")
              Severity: Minor
              Found in scripts/meterpreter/checkvm.rb and 5 other locations - About 20 mins to fix
              scripts/meterpreter/checkvm.rb on lines 170..178
              scripts/meterpreter/checkvm.rb on lines 192..200
              scripts/meterpreter/checkvm.rb on lines 260..268
              scripts/meterpreter/checkvm.rb on lines 271..279
              scripts/meterpreter/checkvm.rb on lines 282..290

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

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

                if not vm
                  begin
                  key = session.sys.registry.open_key(HKEY_LOCAL_MACHINE, 'HARDWARE\ACPI\RSDT', KEY_READ)
                  srvvals = key.enum_key
                  if srvvals.include?("Xen")
              Severity: Minor
              Found in scripts/meterpreter/checkvm.rb and 5 other locations - About 20 mins to fix
              scripts/meterpreter/checkvm.rb on lines 170..178
              scripts/meterpreter/checkvm.rb on lines 181..189
              scripts/meterpreter/checkvm.rb on lines 192..200
              scripts/meterpreter/checkvm.rb on lines 260..268
              scripts/meterpreter/checkvm.rb on lines 271..279

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

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

                if not vm
                  begin
                    key = session.sys.registry.open_key(HKEY_LOCAL_MACHINE, 'HARDWARE\DESCRIPTION\System\CentralProcessor\0')
                    if key.query_value('ProcessorNameString').data.downcase =~ /qemu/
                      print_status("This is a QEMU/KVM Virtual Machine")
              Severity: Minor
              Found in scripts/meterpreter/checkvm.rb and 4 other locations - About 20 mins to fix
              scripts/meterpreter/checkvm.rb on lines 89..96
              scripts/meterpreter/checkvm.rb on lines 203..210
              scripts/meterpreter/checkvm.rb on lines 213..220
              scripts/meterpreter/checkvm.rb on lines 322..329

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

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

                if not vm
                  begin
                  key = session.sys.registry.open_key(HKEY_LOCAL_MACHINE, 'HARDWARE\ACPI\RSDT', KEY_READ)
                  srvvals = key.enum_key
                  if srvvals.include?("VBOX__")
              Severity: Minor
              Found in scripts/meterpreter/checkvm.rb and 5 other locations - About 20 mins to fix
              scripts/meterpreter/checkvm.rb on lines 170..178
              scripts/meterpreter/checkvm.rb on lines 181..189
              scripts/meterpreter/checkvm.rb on lines 260..268
              scripts/meterpreter/checkvm.rb on lines 271..279
              scripts/meterpreter/checkvm.rb on lines 282..290

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

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

                if not vm
                  begin
                    key = session.sys.registry.open_key(HKEY_LOCAL_MACHINE, 'HARDWARE\DEVICEMAP\Scsi\Scsi Port 0\Scsi Bus 0\Target Id 0\Logical Unit Id 0')
                    if key.query_value('Identifier').data.downcase =~ /vmware/
                      print_status("This is a VMware Virtual Machine")
              Severity: Minor
              Found in scripts/meterpreter/checkvm.rb and 4 other locations - About 20 mins to fix
              scripts/meterpreter/checkvm.rb on lines 203..210
              scripts/meterpreter/checkvm.rb on lines 213..220
              scripts/meterpreter/checkvm.rb on lines 322..329
              scripts/meterpreter/checkvm.rb on lines 332..339

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

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

                if not vm
                  begin
                  key = session.sys.registry.open_key(HKEY_LOCAL_MACHINE, 'HARDWARE\DESCRIPTION\System')
                  if key.query_value('SystemBiosVersion').data.downcase =~ /vbox/
                    print_status("This is a Sun VirtualBox Virtual Machine")
              Severity: Minor
              Found in scripts/meterpreter/checkvm.rb and 4 other locations - About 20 mins to fix
              scripts/meterpreter/checkvm.rb on lines 89..96
              scripts/meterpreter/checkvm.rb on lines 203..210
              scripts/meterpreter/checkvm.rb on lines 322..329
              scripts/meterpreter/checkvm.rb on lines 332..339

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

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

                if not vm
                  begin
                  key = session.sys.registry.open_key(HKEY_LOCAL_MACHINE, 'HARDWARE\DEVICEMAP\Scsi\Scsi Port 0\Scsi Bus 0\Target Id 0\Logical Unit Id 0')
                  if key.query_value('Identifier').data.downcase =~ /vbox/
                    print_status("This is a Sun VirtualBox Virtual Machine")
              Severity: Minor
              Found in scripts/meterpreter/checkvm.rb and 4 other locations - About 20 mins to fix
              scripts/meterpreter/checkvm.rb on lines 89..96
              scripts/meterpreter/checkvm.rb on lines 213..220
              scripts/meterpreter/checkvm.rb on lines 322..329
              scripts/meterpreter/checkvm.rb on lines 332..339

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

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

                if not vm
                  begin
                    key = session.sys.registry.open_key(HKEY_LOCAL_MACHINE, 'HARDWARE\DEVICEMAP\Scsi\Scsi Port 0\Scsi Bus 0\Target Id 0\Logical Unit Id 0')
                    if key.query_value('Identifier').data.downcase =~ /qemu/
                      print_status("This is a QEMU/KVM Virtual Machine")
              Severity: Minor
              Found in scripts/meterpreter/checkvm.rb and 4 other locations - About 20 mins to fix
              scripts/meterpreter/checkvm.rb on lines 89..96
              scripts/meterpreter/checkvm.rb on lines 203..210
              scripts/meterpreter/checkvm.rb on lines 213..220
              scripts/meterpreter/checkvm.rb on lines 332..339

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

              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

                vpcprocs.each do |p|
                  session.sys.process.get_processes().each do |x|
                    if p == (x['name'].downcase)
                      print_status("This is a VirtualPC Virtual Machine") if not vm
                      vm = true
              Severity: Minor
              Found in scripts/meterpreter/checkvm.rb and 3 other locations - About 15 mins to fix
              scripts/meterpreter/checkvm.rb on lines 104..108
              scripts/meterpreter/checkvm.rb on lines 162..166
              scripts/meterpreter/checkvm.rb on lines 252..256

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

                  vmwareprocs.each do |p|
                    session.sys.process.get_processes().each do |x|
                      if p == (x['name'].downcase)
                        print_status("This is a VMware Virtual Machine") if not vm
                        vm = true
              Severity: Minor
              Found in scripts/meterpreter/checkvm.rb and 3 other locations - About 15 mins to fix
              scripts/meterpreter/checkvm.rb on lines 124..128
              scripts/meterpreter/checkvm.rb on lines 162..166
              scripts/meterpreter/checkvm.rb on lines 252..256

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

                vboxprocs.each do |p|
                  session.sys.process.get_processes().each do |x|
                    if p == (x['name'].downcase)
                      print_status("This is a Sun VirtualBox Virtual Machine") if not vm
                      vm = true
              Severity: Minor
              Found in scripts/meterpreter/checkvm.rb and 3 other locations - About 15 mins to fix
              scripts/meterpreter/checkvm.rb on lines 104..108
              scripts/meterpreter/checkvm.rb on lines 124..128
              scripts/meterpreter/checkvm.rb on lines 252..256

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

                xenprocs.each do |p|
                  session.sys.process.get_processes().each do |x|
                    if p == (x['name'].downcase)
                      print_status("This is a Xen Virtual Machine") if not vm
                      vm = true
              Severity: Minor
              Found in scripts/meterpreter/checkvm.rb and 3 other locations - About 15 mins to fix
              scripts/meterpreter/checkvm.rb on lines 104..108
              scripts/meterpreter/checkvm.rb on lines 124..128
              scripts/meterpreter/checkvm.rb on lines 162..166

              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