modules/exploits/freebsd/webapp/spamtitan_unauth_rce.rb
Method initialize
has 128 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(info = {})
super(
update_info(
info,
'Name' => 'SpamTitan Unauthenticated RCE',
File spamtitan_unauth_rce.rb
has 290 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
class MetasploitModule < Msf::Exploit::Remote
Rank = NormalRanking
prepend Msf::Exploit::Remote::AutoCheck
include Msf::Exploit::Remote::SNMPClient
Method check
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
Open
def check
snmp_x_uri = normalize_uri(target_uri.path, 'snmp-x.php')
vprint_status("Check if #{snmp_x_uri} exists")
res = send_request_cgi(
'uri' => snmp_x_uri,
- 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 check
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def check
snmp_x_uri = normalize_uri(target_uri.path, 'snmp-x.php')
vprint_status("Check if #{snmp_x_uri} exists")
res = send_request_cgi(
'uri' => snmp_x_uri,
Method inject_payload
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def inject_payload(community)
snmp_x_uri = normalize_uri(target_uri.path, 'snmp-x.php')
print_status("Send a request to #{snmp_x_uri} and inject the payload")
post_params = {
Method inject_payload
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
def inject_payload(community)
snmp_x_uri = normalize_uri(target_uri.path, 'snmp-x.php')
print_status("Send a request to #{snmp_x_uri} and inject the payload")
post_params = {
- 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
Avoid too many return
statements within this method. Open
Open
return Exploit::CheckCode::Unknown.new(
"Could not connect to SpamTitan vulnerable page (#{snmp_x_uri})"
)
Avoid too many return
statements within this method. Open
Open
return Exploit::CheckCode::Safe.new(
"Could not connect to SpamTitan vulnerable page (#{snmp_x_uri}) - "\
"unexpected HTTP response code: #{res.code}"
)