Showing 7,287 of 21,960 total issues
File dnn_cookie_deserialization_rce.rb
has 547 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'openssl'
require 'set'
class MetasploitModule < Msf::Exploit::Remote
include Msf::Exploit::Remote::HttpClient
Method exploit
has 227 lines of code (exceeds 25 allowed). Consider refactoring. Open
def exploit
if check != CheckCode::Appears
fail_with(Failure::NotVulnerable, 'Target not vulnerable! punt!')
end
Method run
has 227 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
max_search = datastore['MAX_SEARCH']
db, dbfile = create_sqlite_db
print_status "Temporary database created: #{dbfile.path}"
Method generate
has 226 lines of code (exceeds 25 allowed). Consider refactoring. Open
def generate(_opts = {})
uri = URI(datastore['HOPURL'])
#create actual payload
payload_data = <<EOS
cld ; clear direction flag
File winenum.rb
has 539 lines of code (exceeds 250 allowed). Consider refactoring. Open
@client = client
opts = Rex::Parser::Arguments.new(
"-h" => [ false, "Help menu." ],
"-m" => [ false, "Migrate the Meterpreter Session from it current process to a new cmd.exe before doing anything" ],
"-r" => [ false, "Dump, compress and download entire Registry" ],
Method exploit
has 223 lines of code (exceeds 25 allowed). Consider refactoring. Open
def exploit
if !datastore['ForceExploit'] && is_root?
fail_with(Failure::BadConfig, 'Session already has root privileges. Set ForceExploit to override.')
end
Identical blocks of code found in 2 locations. Consider refactoring. Open
def calculate_race(server, domain, num=50)
q_beg_t = nil
q_end_t = nil
cnt = 0
- Read upRead up
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 284.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
def calculate_race(server, domain, num=50)
q_beg_t = nil
q_end_t = nil
cnt = 0
- Read upRead up
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 284.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Method run
has 222 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
'
Hash format
:name,
:check_file,
Method run_host
has 221 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run_host(target_host)
case
when action.name == 'LISTFILES'
res = http_post('listFiles')
unless res
File command_shell.rb
has 534 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'shellwords'
require 'rex/text/table'
require "base64"
module Msf
Method getMbeanServer
has 220 lines of code (exceeds 25 allowed). Consider refactoring. Open
private MBeanServer getMbeanServer() {
return new MBeanServer() {
@Override
Method exploit
has 219 lines of code (exceeds 25 allowed). Consider refactoring. Open
def exploit
# Make initial request to get assigned a session token
cookie = "pagerefresh=1; NfaupdateMsg=true; sortBy=sByName; testcookie=; "
cookie << "am_username=;am_check="
begin
Method process_propfind
has 218 lines of code (exceeds 25 allowed). Consider refactoring. Open
def process_propfind(cli, request)
path = request.uri
print_status("Received WebDAV PROPFIND request for #{path}")
body = ''
Method initialize
has 217 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(info = {})
super(merge_info(info,
'Name' => 'Windows x64 Pingback, Reverse TCP Inline',
'Description' => 'Connect back to attacker and report UUID (Windows x64)',
'Author' => [ 'bwatters-r7' ],
Method exploit_html
has 217 lines of code (exceeds 25 allowed). Consider refactoring. Open
def exploit_html(req_uri)
srvhost = datastore['SRVHOST']
srvport = datastore['SRVPORT']
template = <<-EOF
Method custom_inflections
has 216 lines of code (exceeds 25 allowed). Consider refactoring. Open
def custom_inflections
{
'uuid' => 'UUID',
'db_manager' => 'DBManager',
'ci' => 'CI',
File solarwinds_orion_dump.rb
has 526 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'metasploit/framework/credential_collection'
class MetasploitModule < Msf::Post
include Msf::Post::Common
include Msf::Post::File
File apache_superset_cookie_sig_rce.rb
has 525 lines of code (exceeds 250 allowed). Consider refactoring. Open
class MetasploitModule < Msf::Exploit::Remote
Rank = GoodRanking
include Msf::Exploit::Remote::HttpClient
def initialize(info = {})
Method cmd_hosts
has 215 lines of code (exceeds 25 allowed). Consider refactoring. Open
def cmd_hosts(*args)
return unless active?
onlyup = false
set_rhosts = false
mode = []