modules/exploits/windows/http/telerik_rau_deserialization.rb
Method initialize
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(info = {})
super(
update_info(
info,
'Name' => 'Telerik UI ASP.NET AJAX RadAsyncUpload Deserialization',
Method upload_file
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def upload_file(file_contents, version)
target_folder = encrypt('')
temp_target_folder = encrypt(datastore['DESTINATION'].encode('UTF-16LE'))
if (version =~ /(\d{4})\.\d+.\d+/) && Regexp.last_match(1).to_i > 2016
# signing is only necessary for versions >= 2017.1.118 (versions that don't match the regex don't require signing)
Method check
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
def check
res = send_request_cgi({
'uri' => normalize_uri(target_uri.path, 'Telerik.Web.UI.WebResource.axd'),
'vars_get' => { 'type' => 'rau' }
})
- 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 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def check
res = send_request_cgi({
'uri' => normalize_uri(target_uri.path, 'Telerik.Web.UI.WebResource.axd'),
'vars_get' => { 'type' => 'rau' }
})
Method enumerate_version
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def enumerate_version
print_status('Enumerating the Telerik UI ASP.NET AJAX version, this will fail if the keys are incorrect')
File.open(File.join(Msf::Config.data_directory, 'wordlists', 'telerik_ui_asp_net_ajax_versions.txt'), 'rb').each_line do |version|
version.strip!
next if version.start_with?('#')
- 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"