#
# Copyright (c) 2006-2025 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - https://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
class Coldfusion_dir_traversal_exploit < BeEF::Core::Command
  def self.options
    [
      { 'name' => 'fileToRetrieve', 'ui_label' => 'Retrieve file  (in CF /lib dir)', 'value' => 'password.properties' },
      { 'name' => 'os_combobox', 'type' => 'combobox', 'ui_label' => 'CF server OS', 'store_type' => 'arraystore',
        'store_fields' => ['os'], 'store_data' => [['Windows'], ['Linux/MacOSX/*BSD']],
        'valueField' => 'os', 'displayField' => 'os', 'mode' => 'local', 'autoWidth' => true },
      { 'name' => 'cf_version', 'type' => 'combobox', 'ui_label' => 'ColdFusion version', 'store_type' => 'arraystore',
        'store_fields' => ['cf_version'], 'store_data' => [['8'], ['9']],
        'valueField' => 'cf_version', 'displayField' => 'cf_version', 'mode' => 'local', 'autoWidth' => true }
    ]
  end

  def post_execute
    save({ 'result' => @datastore['result'] })
  end
end
