Module: Msf::Exploit::Remote::HTTP::ManageEngineAdauditPlus::JsonPostData
- Included in:
- Msf::Exploit::Remote::HTTP::ManageEngineAdauditPlus
- Defined in:
- lib/msf/core/exploit/remote/http/manage_engine_adaudit_plus/json_post_data.rb
Instance Method Summary collapse
-
#generate_gpo_watcher_data_json(options) ⇒ String
Generates a JSON hash according to the format required by the GPOWatcherData endpoint.
-
#generate_ver_file_name ⇒ String
Returns a String matching the VER_FILE_NAME format used by ADAudit Plus.
Instance Method Details
#generate_gpo_watcher_data_json(options) ⇒ String
Generates a JSON hash according to the format required by the GPOWatcherData endpoint
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/msf/core/exploit/remote/http/manage_engine_adaudit_plus/json_post_data.rb', line 18 def generate_gpo_watcher_data_json() post_data = {} return post_data.to_json unless .is_a?(Hash) post_data['isGPOData'] = ['isGPOData'] || true post_data['DOMAIN_NAME'] = ['DOMAIN_NAME'] || '' post_data['GPO_GUID'] = ['GPO_GUID'] || Rex::Proto::MsDtyp::MsDtypGuid.random_generate post_data['GPO_VERSION'] = ['GPO_VERSION'] || rand(1..9) post_data['VER_FILE_NAME'] = ['VER_FILE_NAME'] || generate_ver_file_name post_data['xmlReport'] = ['xmlReport'] || '<?xml version="1.0" encoding="utf-16"?>' html_fileName = ['Html_fileName'] post_data['Html_fileName'] = html_fileName if html_fileName html_report = ['htmlReport'] post_data['htmlReport'] = html_report if html_report post_data.to_json end |
#generate_ver_file_name ⇒ String
Returns a String matching the VER_FILE_NAME format used by ADAudit Plus
41 42 43 |
# File 'lib/msf/core/exploit/remote/http/manage_engine_adaudit_plus/json_post_data.rb', line 41 def generate_ver_file_name "#{rand(1..9)}_#{Rex::Text.rand_text_alphanumeric(18)}".downcase + '.xml' end |