require 'sinatra' require 'sinatra/contrib' def get_variations( str ) str end get '/' do <<-EOHTML Link Form Cookie Header Gotchas EOHTML end get "/gotchas" do <<-EOHTML Link Link EOHTML end get "/gotchas/escaped" do Rack::Utils.escape( params['input'] ) end get "/gotchas/in_attr" do <<-EOHTML EOHTML end get "/link" do <<-EOHTML Link Link Link Link EOHTML end get "/link/in_textfield" do <<-EOHTML EOHTML end get "/link/in_comment" do <<-EOHTML EOHTML end get "/link/straight" do default = 'default' return if params['input'].start_with?( default ) get_variations( params['input'].split( default ).last ) end get "/link/append" do default = 'default' return if !params['input'].start_with?( default ) get_variations( params['input'].split( default ).last ) end get "/form" do <<-EOHTML
EOHTML end get "/form/in_comment" do <<-EOHTML EOHTML end get "/form/straight" do default = 'default' return if !params['input'] || params['input'].start_with?( default ) get_variations( params['input'].split( default ).last ) end get "/form/append" do default = 'default' return if !params['input'] || !params['input'].start_with?( default ) get_variations( params['input'].split( default ).last ) end get "/cookie" do <<-EOHTML Cookie Cookie Cookie EOHTML end get "/cookie/straight" do default = 'cookie value' cookies['cookie'] ||= default return if cookies['cookie'].start_with?( default ) get_variations( cookies['cookie'].split( default ).last ) end get "/cookie/append" do default = 'cookie value' cookies['cookie2'] ||= default return if !cookies['cookie2'].start_with?( default ) get_variations( cookies['cookie2'].split( default ).last ) end get "/header" do <<-EOHTML Header Header EOHTML end get "/header/straight" do default = 'arachni_user' return if !env['HTTP_USER_AGENT'] || env['HTTP_USER_AGENT'].start_with?( default ) get_variations( env['HTTP_USER_AGENT'].split( default ).last ) end get "/header/append" do default = 'arachni_user' return if !env['HTTP_USER_AGENT'] || !env['HTTP_USER_AGENT'].start_with?( default ) get_variations( env['HTTP_USER_AGENT'].split( default ).last ) end