modules/exploits/windows/http/moveit_cve_2023_34362.rb
File moveit_cve_2023_34362.rb
has 395 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
class MetasploitModule < Msf::Exploit::Remote
Rank = ExcellentRanking
prepend Msf::Exploit::Remote::AutoCheck
include Msf::Exploit::Remote::HttpClient
Method initialize
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(info = {})
super(
update_info(
info,
'Name' => 'MOVEit SQL Injection vulnerability',
Class MetasploitModule
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class MetasploitModule < Msf::Exploit::Remote
Rank = ExcellentRanking
prepend Msf::Exploit::Remote::AutoCheck
include Msf::Exploit::Remote::HttpClient
Method check
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
def check
res = send_request_cgi({
'method' => 'GET',
'uri' => normalize_uri('moveitisapi/moveitisapi.dll?action=capa'),
'connection' => 'close',
- Read upRead up
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 moveitv2encrypt
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def moveitv2encrypt(data, org_key, iv = nil, tag = '@%!')
fail_with(Msf::Exploit::Failure::BadConfig, 'org_key must be 16 bytyes') if org_key.length != 16
if iv.nil?
iv = Rex::Text.rand_text_alphanumeric(4)
Method exploit
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def exploit
# Get the sessionID and siLockLongTermInstID
print_status('[01/11] Get the sessionID and siLockLongTermInstID')
populate_token_instid
# Allow Remote Access and Create new sysAd
Avoid too many return
statements within this method. Open
Open
return Exploit::CheckCode::Unknown
Avoid too many return
statements within this method. Open
Open
return Exploit::CheckCode::Appears if version >= Rex::Version.new('14.1.0') && version < Rex::Version.new('14.1.7')
Avoid too many return
statements within this method. Open
Open
return Exploit::CheckCode::Appears if version >= Rex::Version.new('15.0.0') && version < Rex::Version.new('15.0.3')
Avoid too many return
statements within this method. Open
Open
return Exploit::CheckCode::Safe