rapid7/metasploit-framework

View on GitHub

Showing 7,361 of 22,177 total issues

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

  def scanner(ip)
    @scanner ||= lambda {
      cred_collection = build_credential_collection(
        username: datastore['USERNAME'],
        password: datastore['PASSWORD']
Severity: Major
Found in modules/auxiliary/scanner/http/syncovery_linux_login.rb and 1 other location - About 1 hr to fix
modules/auxiliary/scanner/http/wowza_streaming_engine_manager_login.rb on lines 44..65

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

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

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

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

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

Refactorings

Further Reading

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

  def initialize(info = {})
    super(update_info(info,
      'Name'           => 'EnjoySAP SAP GUI ActiveX Control Buffer Overflow',
      'Description'    => %q{
          This module exploits a stack buffer overflow in SAP KWEdit ActiveX
modules/exploits/windows/browser/windvd7_applicationtype.rb on lines 12..48

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

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

    super(update_info(info,
      'Name'           => 'Hyleos ChemView ActiveX Control Stack Buffer Overflow',
      'Description'    => %q{
          This module exploits a stack-based buffer overflow within version 1.9.5.1 of Hyleos
        ChemView (HyleosChemView.ocx). By calling the 'SaveAsMolFile' or 'ReadMolFile' methods
modules/exploits/windows/browser/pcvue_func.rb on lines 12..58

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

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

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

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

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

Refactorings

Further Reading

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

  def file_dropper_delete_file(session, file)
    win_file = file_dropper_win_path(file)

    if session.type == 'meterpreter'
      begin
Severity: Major
Found in lib/msf/core/exploit/file_dropper.rb and 1 other location - About 1 hr to fix
lib/msf/core/exploit/file_dropper.rb on lines 228..257

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

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

  begin
    print_status("\tGetting Firefox Form History for #{usrnm}")
    db = SQLite3::Database.new(formdb)
    #print_status("\tProcessing #{formdb}")
    db.execute("SELECT fieldname,value FROM moz_formhistory") do |row|
Severity: Major
Found in scripts/meterpreter/enum_firefox.rb and 1 other location - About 1 hr to fix
scripts/meterpreter/enum_firefox.rb on lines 149..165

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

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 (res2.code == res1.code) and (res3.code != res2.code) and (res3.code != 200)
      print_good("#{rhost}:#{rport} is likely vulnerable due to a #{res3.code} reply for invalid YAML")
      report_vuln({
        :host    => rhost,
        :port    => rport,
Severity: Major
Found in modules/auxiliary/scanner/http/rails_xml_yaml_scanner.rb and 1 other location - About 1 hr to fix
modules/auxiliary/scanner/http/rails_json_yaml_scanner.rb on lines 79..93

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

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

        final Transformer[] transformers = new Transformer[] {
                new ConstantTransformer(Runtime.class),
                new InvokerTransformer("getMethod", new Class[] { String.class,
                        Class[].class }, new Object[] { "getRuntime",
                        new Class[0] }),
Severity: Major
Found in data/exploits/CVE-2017-1000353/Payload.java and 2 other locations - About 1 hr to fix
external/source/exploits/CVE-2015-8103/payloads/CommonsCollections1.java on lines 50..60
external/source/exploits/CVE-2020-7200/OlderDeserialization/src/Test1.java on lines 119..129

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

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

        final Transformer[] transformers = new Transformer[] {
                new ConstantTransformer(Runtime.class),
                new InvokerTransformer("getMethod", new Class[] {
                        String.class, Class[].class }, new Object[] {
                        "getRuntime", new Class[0] }),
data/exploits/CVE-2017-1000353/Payload.java on lines 46..54
external/source/exploits/CVE-2015-8103/payloads/CommonsCollections1.java on lines 50..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 90.

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

        final Transformer[] transformers = new Transformer[] {
                new ConstantTransformer(Runtime.class),
                new InvokerTransformer("getMethod", new Class[] {
                    String.class, Class[].class }, new Object[] {
                    "getRuntime", new Class[0] }),
data/exploits/CVE-2017-1000353/Payload.java on lines 46..54
external/source/exploits/CVE-2020-7200/OlderDeserialization/src/Test1.java on lines 119..129

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

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

  def report_cred(opts)
    service_data = {
      address: opts[:ip],
      port: opts[:port],
      service_name: opts[:service_name],
modules/auxiliary/admin/misc/sercomm_dump_config.rb on lines 88..111
modules/auxiliary/admin/scada/advantech_webaccess_dbvisitor_sqli.rb on lines 191..214
modules/auxiliary/gather/apache_rave_creds.rb on lines 107..130
modules/auxiliary/gather/d20pass.rb on lines 182..205
modules/auxiliary/gather/doliwamp_traversal_creds.rb on lines 152..175
modules/auxiliary/gather/hp_snac_domain_creds.rb on lines 90..113
modules/auxiliary/scanner/couchdb/couchdb_login.rb on lines 76..99
modules/auxiliary/scanner/dcerpc/windows_deployment_services.rb on lines 214..237
modules/auxiliary/scanner/http/openmind_messageos_login.rb on lines 72..95
modules/auxiliary/scanner/http/radware_appdirector_enum.rb on lines 78..101
modules/auxiliary/scanner/misc/dvr_config_disclosure.rb on lines 147..170
modules/auxiliary/scanner/misc/dvr_config_disclosure.rb on lines 210..233
modules/auxiliary/scanner/misc/raysharp_dvr_passwords.rb on lines 36..59
modules/auxiliary/scanner/misc/rosewill_rxs3211_passwords.rb on lines 84..107
modules/auxiliary/scanner/openvas/openvas_gsad_login.rb on lines 115..138
modules/auxiliary/scanner/oracle/isqlplus_login.rb on lines 231..254
modules/auxiliary/scanner/postgres/postgres_version.rb on lines 51..74
modules/auxiliary/scanner/rservices/rsh_login.rb on lines 222..245
modules/auxiliary/scanner/sap/sap_ctc_verb_tampering_user_mgmt.rb on lines 86..109
modules/auxiliary/scanner/sap/sap_mgmt_con_brute_login.rb on lines 63..86
modules/auxiliary/scanner/sap/sap_soap_bapi_user_create1.rb on lines 52..75
modules/auxiliary/scanner/scada/koyo_login.rb on lines 127..150
modules/auxiliary/server/capture/drda.rb on lines 237..260
modules/auxiliary/server/capture/ftp.rb on lines 51..74
modules/auxiliary/server/capture/http.rb on lines 107..130
modules/auxiliary/server/capture/http_basic.rb on lines 57..80
modules/auxiliary/server/capture/mysql.rb on lines 127..150
modules/auxiliary/server/capture/pop3.rb on lines 53..76
modules/auxiliary/server/capture/postgresql.rb on lines 41..64
modules/auxiliary/server/capture/sip.rb on lines 105..128
modules/exploits/linux/http/dlink_dir850l_unauth_exec.rb on lines 69..92

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

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

  def report_cred(opts)
    service_data = {
      address: opts[:ip],
      port: opts[:port],
      service_name: opts[:service_name],
Severity: Major
Found in modules/auxiliary/scanner/oracle/isqlplus_login.rb and 31 other locations - About 1 hr to fix
modules/auxiliary/admin/misc/sercomm_dump_config.rb on lines 88..111
modules/auxiliary/admin/scada/advantech_webaccess_dbvisitor_sqli.rb on lines 191..214
modules/auxiliary/gather/apache_rave_creds.rb on lines 107..130
modules/auxiliary/gather/d20pass.rb on lines 182..205
modules/auxiliary/gather/doliwamp_traversal_creds.rb on lines 152..175
modules/auxiliary/gather/hp_snac_domain_creds.rb on lines 90..113
modules/auxiliary/gather/windows_deployment_services_shares.rb on lines 196..219
modules/auxiliary/scanner/couchdb/couchdb_login.rb on lines 76..99
modules/auxiliary/scanner/dcerpc/windows_deployment_services.rb on lines 214..237
modules/auxiliary/scanner/http/openmind_messageos_login.rb on lines 72..95
modules/auxiliary/scanner/http/radware_appdirector_enum.rb on lines 78..101
modules/auxiliary/scanner/misc/dvr_config_disclosure.rb on lines 147..170
modules/auxiliary/scanner/misc/dvr_config_disclosure.rb on lines 210..233
modules/auxiliary/scanner/misc/raysharp_dvr_passwords.rb on lines 36..59
modules/auxiliary/scanner/misc/rosewill_rxs3211_passwords.rb on lines 84..107
modules/auxiliary/scanner/openvas/openvas_gsad_login.rb on lines 115..138
modules/auxiliary/scanner/postgres/postgres_version.rb on lines 51..74
modules/auxiliary/scanner/rservices/rsh_login.rb on lines 222..245
modules/auxiliary/scanner/sap/sap_ctc_verb_tampering_user_mgmt.rb on lines 86..109
modules/auxiliary/scanner/sap/sap_mgmt_con_brute_login.rb on lines 63..86
modules/auxiliary/scanner/sap/sap_soap_bapi_user_create1.rb on lines 52..75
modules/auxiliary/scanner/scada/koyo_login.rb on lines 127..150
modules/auxiliary/server/capture/drda.rb on lines 237..260
modules/auxiliary/server/capture/ftp.rb on lines 51..74
modules/auxiliary/server/capture/http.rb on lines 107..130
modules/auxiliary/server/capture/http_basic.rb on lines 57..80
modules/auxiliary/server/capture/mysql.rb on lines 127..150
modules/auxiliary/server/capture/pop3.rb on lines 53..76
modules/auxiliary/server/capture/postgresql.rb on lines 41..64
modules/auxiliary/server/capture/sip.rb on lines 105..128
modules/exploits/linux/http/dlink_dir850l_unauth_exec.rb on lines 69..92

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

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

  def report_cred(opts)
    service_data = {
      address: opts[:ip],
      port: opts[:port],
      service_name: opts[:service_name],
Severity: Major
Found in modules/exploits/linux/http/dlink_dir850l_unauth_exec.rb and 31 other locations - About 1 hr to fix
modules/auxiliary/admin/misc/sercomm_dump_config.rb on lines 88..111
modules/auxiliary/admin/scada/advantech_webaccess_dbvisitor_sqli.rb on lines 191..214
modules/auxiliary/gather/apache_rave_creds.rb on lines 107..130
modules/auxiliary/gather/d20pass.rb on lines 182..205
modules/auxiliary/gather/doliwamp_traversal_creds.rb on lines 152..175
modules/auxiliary/gather/hp_snac_domain_creds.rb on lines 90..113
modules/auxiliary/gather/windows_deployment_services_shares.rb on lines 196..219
modules/auxiliary/scanner/couchdb/couchdb_login.rb on lines 76..99
modules/auxiliary/scanner/dcerpc/windows_deployment_services.rb on lines 214..237
modules/auxiliary/scanner/http/openmind_messageos_login.rb on lines 72..95
modules/auxiliary/scanner/http/radware_appdirector_enum.rb on lines 78..101
modules/auxiliary/scanner/misc/dvr_config_disclosure.rb on lines 147..170
modules/auxiliary/scanner/misc/dvr_config_disclosure.rb on lines 210..233
modules/auxiliary/scanner/misc/raysharp_dvr_passwords.rb on lines 36..59
modules/auxiliary/scanner/misc/rosewill_rxs3211_passwords.rb on lines 84..107
modules/auxiliary/scanner/openvas/openvas_gsad_login.rb on lines 115..138
modules/auxiliary/scanner/oracle/isqlplus_login.rb on lines 231..254
modules/auxiliary/scanner/postgres/postgres_version.rb on lines 51..74
modules/auxiliary/scanner/rservices/rsh_login.rb on lines 222..245
modules/auxiliary/scanner/sap/sap_ctc_verb_tampering_user_mgmt.rb on lines 86..109
modules/auxiliary/scanner/sap/sap_mgmt_con_brute_login.rb on lines 63..86
modules/auxiliary/scanner/sap/sap_soap_bapi_user_create1.rb on lines 52..75
modules/auxiliary/scanner/scada/koyo_login.rb on lines 127..150
modules/auxiliary/server/capture/drda.rb on lines 237..260
modules/auxiliary/server/capture/ftp.rb on lines 51..74
modules/auxiliary/server/capture/http.rb on lines 107..130
modules/auxiliary/server/capture/http_basic.rb on lines 57..80
modules/auxiliary/server/capture/mysql.rb on lines 127..150
modules/auxiliary/server/capture/pop3.rb on lines 53..76
modules/auxiliary/server/capture/postgresql.rb on lines 41..64
modules/auxiliary/server/capture/sip.rb on lines 105..128

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

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

  def report_cred(opts)
    service_data = {
      address: opts[:ip],
      port: opts[:port],
      service_name: opts[:service_name],
Severity: Major
Found in modules/auxiliary/admin/misc/sercomm_dump_config.rb and 31 other locations - About 1 hr to fix
modules/auxiliary/admin/scada/advantech_webaccess_dbvisitor_sqli.rb on lines 191..214
modules/auxiliary/gather/apache_rave_creds.rb on lines 107..130
modules/auxiliary/gather/d20pass.rb on lines 182..205
modules/auxiliary/gather/doliwamp_traversal_creds.rb on lines 152..175
modules/auxiliary/gather/hp_snac_domain_creds.rb on lines 90..113
modules/auxiliary/gather/windows_deployment_services_shares.rb on lines 196..219
modules/auxiliary/scanner/couchdb/couchdb_login.rb on lines 76..99
modules/auxiliary/scanner/dcerpc/windows_deployment_services.rb on lines 214..237
modules/auxiliary/scanner/http/openmind_messageos_login.rb on lines 72..95
modules/auxiliary/scanner/http/radware_appdirector_enum.rb on lines 78..101
modules/auxiliary/scanner/misc/dvr_config_disclosure.rb on lines 147..170
modules/auxiliary/scanner/misc/dvr_config_disclosure.rb on lines 210..233
modules/auxiliary/scanner/misc/raysharp_dvr_passwords.rb on lines 36..59
modules/auxiliary/scanner/misc/rosewill_rxs3211_passwords.rb on lines 84..107
modules/auxiliary/scanner/openvas/openvas_gsad_login.rb on lines 115..138
modules/auxiliary/scanner/oracle/isqlplus_login.rb on lines 231..254
modules/auxiliary/scanner/postgres/postgres_version.rb on lines 51..74
modules/auxiliary/scanner/rservices/rsh_login.rb on lines 222..245
modules/auxiliary/scanner/sap/sap_ctc_verb_tampering_user_mgmt.rb on lines 86..109
modules/auxiliary/scanner/sap/sap_mgmt_con_brute_login.rb on lines 63..86
modules/auxiliary/scanner/sap/sap_soap_bapi_user_create1.rb on lines 52..75
modules/auxiliary/scanner/scada/koyo_login.rb on lines 127..150
modules/auxiliary/server/capture/drda.rb on lines 237..260
modules/auxiliary/server/capture/ftp.rb on lines 51..74
modules/auxiliary/server/capture/http.rb on lines 107..130
modules/auxiliary/server/capture/http_basic.rb on lines 57..80
modules/auxiliary/server/capture/mysql.rb on lines 127..150
modules/auxiliary/server/capture/pop3.rb on lines 53..76
modules/auxiliary/server/capture/postgresql.rb on lines 41..64
modules/auxiliary/server/capture/sip.rb on lines 105..128
modules/exploits/linux/http/dlink_dir850l_unauth_exec.rb on lines 69..92

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

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

  def report_cred(opts)
    service_data = {
      address: opts[:ip],
      port: opts[:port],
      service_name: opts[:service_name],
modules/auxiliary/admin/misc/sercomm_dump_config.rb on lines 88..111
modules/auxiliary/admin/scada/advantech_webaccess_dbvisitor_sqli.rb on lines 191..214
modules/auxiliary/gather/apache_rave_creds.rb on lines 107..130
modules/auxiliary/gather/d20pass.rb on lines 182..205
modules/auxiliary/gather/doliwamp_traversal_creds.rb on lines 152..175
modules/auxiliary/gather/hp_snac_domain_creds.rb on lines 90..113
modules/auxiliary/gather/windows_deployment_services_shares.rb on lines 196..219
modules/auxiliary/scanner/couchdb/couchdb_login.rb on lines 76..99
modules/auxiliary/scanner/dcerpc/windows_deployment_services.rb on lines 214..237
modules/auxiliary/scanner/http/openmind_messageos_login.rb on lines 72..95
modules/auxiliary/scanner/misc/dvr_config_disclosure.rb on lines 147..170
modules/auxiliary/scanner/misc/dvr_config_disclosure.rb on lines 210..233
modules/auxiliary/scanner/misc/raysharp_dvr_passwords.rb on lines 36..59
modules/auxiliary/scanner/misc/rosewill_rxs3211_passwords.rb on lines 84..107
modules/auxiliary/scanner/openvas/openvas_gsad_login.rb on lines 115..138
modules/auxiliary/scanner/oracle/isqlplus_login.rb on lines 231..254
modules/auxiliary/scanner/postgres/postgres_version.rb on lines 51..74
modules/auxiliary/scanner/rservices/rsh_login.rb on lines 222..245
modules/auxiliary/scanner/sap/sap_ctc_verb_tampering_user_mgmt.rb on lines 86..109
modules/auxiliary/scanner/sap/sap_mgmt_con_brute_login.rb on lines 63..86
modules/auxiliary/scanner/sap/sap_soap_bapi_user_create1.rb on lines 52..75
modules/auxiliary/scanner/scada/koyo_login.rb on lines 127..150
modules/auxiliary/server/capture/drda.rb on lines 237..260
modules/auxiliary/server/capture/ftp.rb on lines 51..74
modules/auxiliary/server/capture/http.rb on lines 107..130
modules/auxiliary/server/capture/http_basic.rb on lines 57..80
modules/auxiliary/server/capture/mysql.rb on lines 127..150
modules/auxiliary/server/capture/pop3.rb on lines 53..76
modules/auxiliary/server/capture/postgresql.rb on lines 41..64
modules/auxiliary/server/capture/sip.rb on lines 105..128
modules/exploits/linux/http/dlink_dir850l_unauth_exec.rb on lines 69..92

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

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

  def report_cred(opts)
    service_data = {
      address: opts[:ip],
      port: opts[:port],
      service_name: opts[:service_name],
Severity: Major
Found in modules/auxiliary/scanner/scada/koyo_login.rb and 31 other locations - About 1 hr to fix
modules/auxiliary/admin/misc/sercomm_dump_config.rb on lines 88..111
modules/auxiliary/admin/scada/advantech_webaccess_dbvisitor_sqli.rb on lines 191..214
modules/auxiliary/gather/apache_rave_creds.rb on lines 107..130
modules/auxiliary/gather/d20pass.rb on lines 182..205
modules/auxiliary/gather/doliwamp_traversal_creds.rb on lines 152..175
modules/auxiliary/gather/hp_snac_domain_creds.rb on lines 90..113
modules/auxiliary/gather/windows_deployment_services_shares.rb on lines 196..219
modules/auxiliary/scanner/couchdb/couchdb_login.rb on lines 76..99
modules/auxiliary/scanner/dcerpc/windows_deployment_services.rb on lines 214..237
modules/auxiliary/scanner/http/openmind_messageos_login.rb on lines 72..95
modules/auxiliary/scanner/http/radware_appdirector_enum.rb on lines 78..101
modules/auxiliary/scanner/misc/dvr_config_disclosure.rb on lines 147..170
modules/auxiliary/scanner/misc/dvr_config_disclosure.rb on lines 210..233
modules/auxiliary/scanner/misc/raysharp_dvr_passwords.rb on lines 36..59
modules/auxiliary/scanner/misc/rosewill_rxs3211_passwords.rb on lines 84..107
modules/auxiliary/scanner/openvas/openvas_gsad_login.rb on lines 115..138
modules/auxiliary/scanner/oracle/isqlplus_login.rb on lines 231..254
modules/auxiliary/scanner/postgres/postgres_version.rb on lines 51..74
modules/auxiliary/scanner/rservices/rsh_login.rb on lines 222..245
modules/auxiliary/scanner/sap/sap_ctc_verb_tampering_user_mgmt.rb on lines 86..109
modules/auxiliary/scanner/sap/sap_mgmt_con_brute_login.rb on lines 63..86
modules/auxiliary/scanner/sap/sap_soap_bapi_user_create1.rb on lines 52..75
modules/auxiliary/server/capture/drda.rb on lines 237..260
modules/auxiliary/server/capture/ftp.rb on lines 51..74
modules/auxiliary/server/capture/http.rb on lines 107..130
modules/auxiliary/server/capture/http_basic.rb on lines 57..80
modules/auxiliary/server/capture/mysql.rb on lines 127..150
modules/auxiliary/server/capture/pop3.rb on lines 53..76
modules/auxiliary/server/capture/postgresql.rb on lines 41..64
modules/auxiliary/server/capture/sip.rb on lines 105..128
modules/exploits/linux/http/dlink_dir850l_unauth_exec.rb on lines 69..92

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

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

  def report_cred(opts)
    service_data = {
      address: opts[:ip],
      port: opts[:port],
      service_name: opts[:service_name],
modules/auxiliary/admin/misc/sercomm_dump_config.rb on lines 88..111
modules/auxiliary/admin/scada/advantech_webaccess_dbvisitor_sqli.rb on lines 191..214
modules/auxiliary/gather/apache_rave_creds.rb on lines 107..130
modules/auxiliary/gather/d20pass.rb on lines 182..205
modules/auxiliary/gather/doliwamp_traversal_creds.rb on lines 152..175
modules/auxiliary/gather/hp_snac_domain_creds.rb on lines 90..113
modules/auxiliary/gather/windows_deployment_services_shares.rb on lines 196..219
modules/auxiliary/scanner/couchdb/couchdb_login.rb on lines 76..99
modules/auxiliary/scanner/dcerpc/windows_deployment_services.rb on lines 214..237
modules/auxiliary/scanner/http/openmind_messageos_login.rb on lines 72..95
modules/auxiliary/scanner/http/radware_appdirector_enum.rb on lines 78..101
modules/auxiliary/scanner/misc/dvr_config_disclosure.rb on lines 147..170
modules/auxiliary/scanner/misc/dvr_config_disclosure.rb on lines 210..233
modules/auxiliary/scanner/misc/raysharp_dvr_passwords.rb on lines 36..59
modules/auxiliary/scanner/misc/rosewill_rxs3211_passwords.rb on lines 84..107
modules/auxiliary/scanner/openvas/openvas_gsad_login.rb on lines 115..138
modules/auxiliary/scanner/oracle/isqlplus_login.rb on lines 231..254
modules/auxiliary/scanner/postgres/postgres_version.rb on lines 51..74
modules/auxiliary/scanner/rservices/rsh_login.rb on lines 222..245
modules/auxiliary/scanner/sap/sap_mgmt_con_brute_login.rb on lines 63..86
modules/auxiliary/scanner/sap/sap_soap_bapi_user_create1.rb on lines 52..75
modules/auxiliary/scanner/scada/koyo_login.rb on lines 127..150
modules/auxiliary/server/capture/drda.rb on lines 237..260
modules/auxiliary/server/capture/ftp.rb on lines 51..74
modules/auxiliary/server/capture/http.rb on lines 107..130
modules/auxiliary/server/capture/http_basic.rb on lines 57..80
modules/auxiliary/server/capture/mysql.rb on lines 127..150
modules/auxiliary/server/capture/pop3.rb on lines 53..76
modules/auxiliary/server/capture/postgresql.rb on lines 41..64
modules/auxiliary/server/capture/sip.rb on lines 105..128
modules/exploits/linux/http/dlink_dir850l_unauth_exec.rb on lines 69..92

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

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

  def report_cred(opts)
    service_data = {
      address: opts[:ip],
      port: opts[:port],
      service_name: opts[:service_name],
modules/auxiliary/admin/misc/sercomm_dump_config.rb on lines 88..111
modules/auxiliary/admin/scada/advantech_webaccess_dbvisitor_sqli.rb on lines 191..214
modules/auxiliary/gather/apache_rave_creds.rb on lines 107..130
modules/auxiliary/gather/d20pass.rb on lines 182..205
modules/auxiliary/gather/doliwamp_traversal_creds.rb on lines 152..175
modules/auxiliary/gather/hp_snac_domain_creds.rb on lines 90..113
modules/auxiliary/gather/windows_deployment_services_shares.rb on lines 196..219
modules/auxiliary/scanner/couchdb/couchdb_login.rb on lines 76..99
modules/auxiliary/scanner/dcerpc/windows_deployment_services.rb on lines 214..237
modules/auxiliary/scanner/http/radware_appdirector_enum.rb on lines 78..101
modules/auxiliary/scanner/misc/dvr_config_disclosure.rb on lines 147..170
modules/auxiliary/scanner/misc/dvr_config_disclosure.rb on lines 210..233
modules/auxiliary/scanner/misc/raysharp_dvr_passwords.rb on lines 36..59
modules/auxiliary/scanner/misc/rosewill_rxs3211_passwords.rb on lines 84..107
modules/auxiliary/scanner/openvas/openvas_gsad_login.rb on lines 115..138
modules/auxiliary/scanner/oracle/isqlplus_login.rb on lines 231..254
modules/auxiliary/scanner/postgres/postgres_version.rb on lines 51..74
modules/auxiliary/scanner/rservices/rsh_login.rb on lines 222..245
modules/auxiliary/scanner/sap/sap_ctc_verb_tampering_user_mgmt.rb on lines 86..109
modules/auxiliary/scanner/sap/sap_mgmt_con_brute_login.rb on lines 63..86
modules/auxiliary/scanner/sap/sap_soap_bapi_user_create1.rb on lines 52..75
modules/auxiliary/scanner/scada/koyo_login.rb on lines 127..150
modules/auxiliary/server/capture/drda.rb on lines 237..260
modules/auxiliary/server/capture/ftp.rb on lines 51..74
modules/auxiliary/server/capture/http.rb on lines 107..130
modules/auxiliary/server/capture/http_basic.rb on lines 57..80
modules/auxiliary/server/capture/mysql.rb on lines 127..150
modules/auxiliary/server/capture/pop3.rb on lines 53..76
modules/auxiliary/server/capture/postgresql.rb on lines 41..64
modules/auxiliary/server/capture/sip.rb on lines 105..128
modules/exploits/linux/http/dlink_dir850l_unauth_exec.rb on lines 69..92

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

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

  def report_cred(opts)
    service_data = {
      address: opts[:ip],
      port: opts[:port],
      service_name: opts[:service_name],
Severity: Major
Found in modules/auxiliary/server/capture/postgresql.rb and 31 other locations - About 1 hr to fix
modules/auxiliary/admin/misc/sercomm_dump_config.rb on lines 88..111
modules/auxiliary/admin/scada/advantech_webaccess_dbvisitor_sqli.rb on lines 191..214
modules/auxiliary/gather/apache_rave_creds.rb on lines 107..130
modules/auxiliary/gather/d20pass.rb on lines 182..205
modules/auxiliary/gather/doliwamp_traversal_creds.rb on lines 152..175
modules/auxiliary/gather/hp_snac_domain_creds.rb on lines 90..113
modules/auxiliary/gather/windows_deployment_services_shares.rb on lines 196..219
modules/auxiliary/scanner/couchdb/couchdb_login.rb on lines 76..99
modules/auxiliary/scanner/dcerpc/windows_deployment_services.rb on lines 214..237
modules/auxiliary/scanner/http/openmind_messageos_login.rb on lines 72..95
modules/auxiliary/scanner/http/radware_appdirector_enum.rb on lines 78..101
modules/auxiliary/scanner/misc/dvr_config_disclosure.rb on lines 147..170
modules/auxiliary/scanner/misc/dvr_config_disclosure.rb on lines 210..233
modules/auxiliary/scanner/misc/raysharp_dvr_passwords.rb on lines 36..59
modules/auxiliary/scanner/misc/rosewill_rxs3211_passwords.rb on lines 84..107
modules/auxiliary/scanner/openvas/openvas_gsad_login.rb on lines 115..138
modules/auxiliary/scanner/oracle/isqlplus_login.rb on lines 231..254
modules/auxiliary/scanner/postgres/postgres_version.rb on lines 51..74
modules/auxiliary/scanner/rservices/rsh_login.rb on lines 222..245
modules/auxiliary/scanner/sap/sap_ctc_verb_tampering_user_mgmt.rb on lines 86..109
modules/auxiliary/scanner/sap/sap_mgmt_con_brute_login.rb on lines 63..86
modules/auxiliary/scanner/sap/sap_soap_bapi_user_create1.rb on lines 52..75
modules/auxiliary/scanner/scada/koyo_login.rb on lines 127..150
modules/auxiliary/server/capture/drda.rb on lines 237..260
modules/auxiliary/server/capture/ftp.rb on lines 51..74
modules/auxiliary/server/capture/http.rb on lines 107..130
modules/auxiliary/server/capture/http_basic.rb on lines 57..80
modules/auxiliary/server/capture/mysql.rb on lines 127..150
modules/auxiliary/server/capture/pop3.rb on lines 53..76
modules/auxiliary/server/capture/sip.rb on lines 105..128
modules/exploits/linux/http/dlink_dir850l_unauth_exec.rb on lines 69..92

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

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

  def report_cred(opts)
    service_data = {
      address: opts[:ip],
      port: opts[:port],
      service_name: opts[:service_name],
Severity: Major
Found in modules/auxiliary/scanner/couchdb/couchdb_login.rb and 31 other locations - About 1 hr to fix
modules/auxiliary/admin/misc/sercomm_dump_config.rb on lines 88..111
modules/auxiliary/admin/scada/advantech_webaccess_dbvisitor_sqli.rb on lines 191..214
modules/auxiliary/gather/apache_rave_creds.rb on lines 107..130
modules/auxiliary/gather/d20pass.rb on lines 182..205
modules/auxiliary/gather/doliwamp_traversal_creds.rb on lines 152..175
modules/auxiliary/gather/hp_snac_domain_creds.rb on lines 90..113
modules/auxiliary/gather/windows_deployment_services_shares.rb on lines 196..219
modules/auxiliary/scanner/dcerpc/windows_deployment_services.rb on lines 214..237
modules/auxiliary/scanner/http/openmind_messageos_login.rb on lines 72..95
modules/auxiliary/scanner/http/radware_appdirector_enum.rb on lines 78..101
modules/auxiliary/scanner/misc/dvr_config_disclosure.rb on lines 147..170
modules/auxiliary/scanner/misc/dvr_config_disclosure.rb on lines 210..233
modules/auxiliary/scanner/misc/raysharp_dvr_passwords.rb on lines 36..59
modules/auxiliary/scanner/misc/rosewill_rxs3211_passwords.rb on lines 84..107
modules/auxiliary/scanner/openvas/openvas_gsad_login.rb on lines 115..138
modules/auxiliary/scanner/oracle/isqlplus_login.rb on lines 231..254
modules/auxiliary/scanner/postgres/postgres_version.rb on lines 51..74
modules/auxiliary/scanner/rservices/rsh_login.rb on lines 222..245
modules/auxiliary/scanner/sap/sap_ctc_verb_tampering_user_mgmt.rb on lines 86..109
modules/auxiliary/scanner/sap/sap_mgmt_con_brute_login.rb on lines 63..86
modules/auxiliary/scanner/sap/sap_soap_bapi_user_create1.rb on lines 52..75
modules/auxiliary/scanner/scada/koyo_login.rb on lines 127..150
modules/auxiliary/server/capture/drda.rb on lines 237..260
modules/auxiliary/server/capture/ftp.rb on lines 51..74
modules/auxiliary/server/capture/http.rb on lines 107..130
modules/auxiliary/server/capture/http_basic.rb on lines 57..80
modules/auxiliary/server/capture/mysql.rb on lines 127..150
modules/auxiliary/server/capture/pop3.rb on lines 53..76
modules/auxiliary/server/capture/postgresql.rb on lines 41..64
modules/auxiliary/server/capture/sip.rb on lines 105..128
modules/exploits/linux/http/dlink_dir850l_unauth_exec.rb on lines 69..92

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

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

  def report_cred(opts)
    service_data = {
      address: opts[:ip],
      port: opts[:port],
      service_name: opts[:service_name],
Severity: Major
Found in modules/auxiliary/server/capture/drda.rb and 31 other locations - About 1 hr to fix
modules/auxiliary/admin/misc/sercomm_dump_config.rb on lines 88..111
modules/auxiliary/admin/scada/advantech_webaccess_dbvisitor_sqli.rb on lines 191..214
modules/auxiliary/gather/apache_rave_creds.rb on lines 107..130
modules/auxiliary/gather/d20pass.rb on lines 182..205
modules/auxiliary/gather/doliwamp_traversal_creds.rb on lines 152..175
modules/auxiliary/gather/hp_snac_domain_creds.rb on lines 90..113
modules/auxiliary/gather/windows_deployment_services_shares.rb on lines 196..219
modules/auxiliary/scanner/couchdb/couchdb_login.rb on lines 76..99
modules/auxiliary/scanner/dcerpc/windows_deployment_services.rb on lines 214..237
modules/auxiliary/scanner/http/openmind_messageos_login.rb on lines 72..95
modules/auxiliary/scanner/http/radware_appdirector_enum.rb on lines 78..101
modules/auxiliary/scanner/misc/dvr_config_disclosure.rb on lines 147..170
modules/auxiliary/scanner/misc/dvr_config_disclosure.rb on lines 210..233
modules/auxiliary/scanner/misc/raysharp_dvr_passwords.rb on lines 36..59
modules/auxiliary/scanner/misc/rosewill_rxs3211_passwords.rb on lines 84..107
modules/auxiliary/scanner/openvas/openvas_gsad_login.rb on lines 115..138
modules/auxiliary/scanner/oracle/isqlplus_login.rb on lines 231..254
modules/auxiliary/scanner/postgres/postgres_version.rb on lines 51..74
modules/auxiliary/scanner/rservices/rsh_login.rb on lines 222..245
modules/auxiliary/scanner/sap/sap_ctc_verb_tampering_user_mgmt.rb on lines 86..109
modules/auxiliary/scanner/sap/sap_mgmt_con_brute_login.rb on lines 63..86
modules/auxiliary/scanner/sap/sap_soap_bapi_user_create1.rb on lines 52..75
modules/auxiliary/scanner/scada/koyo_login.rb on lines 127..150
modules/auxiliary/server/capture/ftp.rb on lines 51..74
modules/auxiliary/server/capture/http.rb on lines 107..130
modules/auxiliary/server/capture/http_basic.rb on lines 57..80
modules/auxiliary/server/capture/mysql.rb on lines 127..150
modules/auxiliary/server/capture/pop3.rb on lines 53..76
modules/auxiliary/server/capture/postgresql.rb on lines 41..64
modules/auxiliary/server/capture/sip.rb on lines 105..128
modules/exploits/linux/http/dlink_dir850l_unauth_exec.rb on lines 69..92

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

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