INNER CODE UNIT · Ruby

clear_screen

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

  def clear_screen
    system('clear') || system('cls') || puts("\033[2J\033[H")
  end

  # Get history file path based on host and user
  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

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…