INNER CODE UNIT · Ruby

get_history_file_path

Hackplayers/evil-winrm · evil-winrm.rb:683

  def get_history_file_path
    history_dir = File.join(Dir.home, '.evil-winrm', 'history')
    FileUtils.mkdir_p(history_dir) unless Dir.exist?(history_dir)

    # Create a safe filename from host and user
    safe_host = ($host || 'unknown').gsub(/[^a-zA-Z0-9._-]/, '_')
    safe_user = ($user || 'unknown').gsub(/[^a-zA-Z0-9._-]/, '_')
    history_filename = "#{safe_host}_#{safe_user}.hist"

    File.join(history_dir, history_filename)
  end

  # Load history from file
  def load_history
    history_file = get_history_file_path
    return unless File.exist?(history_file)

    begin

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…