Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

22 lines (19 sloc) 0.579 kB
require 'rubygems'
require 'sinatra'
get '/' do
host = ENV['VCAP_APP_HOST']
port = ENV['VCAP_APP_PORT']
msg = "<h1>Hello from FDHog! via: #{host}:#{port} </h1>"
msg += "<h2>Visit /evil to trigger bad behavior.</h2>"
msg += "<h1><font weight=bold color=red>DO NOT DO THIS ON A NON-SECURE DEA!</font></h1>"
end
get '/evil' do
@@stick_around ||= []
# Try to get 10000 file descriptors (sockets)
Socket.do_not_reverse_lookup = true
(1..100000).each do |i|
@@stick_around[i] = s = TCPServer.new(0)
puts "#{i} --> PORT= #{s.addr[1]}"
end
"BAD BAD!"
end
Jump to Line
Something went wrong with that request. Please try again.