require 'sinatra' require 'sinatra/contrib' def default "default.html" end OUT = { php: 'Link Form Cookie Header Link template EOHTML end get "/#{language}/link" do <<-EOHTML Link Link EOHTML end get "/#{language}/link/straight.#{language}" do return if params['input'].include?( "\0" ) get_variations( language, params['input'] ) end get "/#{language}/link/with_null.#{language}" do return if !params['input'].end_with?( "\00.html" ) get_variations( language, params['input'].split( "\0.html" ).first ) end get "/#{language}/link-template" do <<-EOHTML Link Link EOHTML end get "/#{language}/link-template/straight/input/*/stuff.#{language}" do val = params[:splat].first default = 'default' return if val.start_with?( default ) get_variations( language, val.split( default ).last ) end get "/#{language}/link-template/with_null/input/*/stuff.#{language}" do val = params[:splat].first return if !val.end_with?( "\00.html" ) get_variations( language, val.split( "\0.html" ).first ) end get "/#{language}/form" do <<-EOHTML
EOHTML end post "/#{language}/form/straight.#{language}" do return if params['input'].include?( "\0" ) get_variations( language, params['input'] ) end post "/#{language}/form/with_null.#{language}" do return if !params['input'].end_with?( "\00.html" ) get_variations( language, params['input'].split( "\0.html" ).first ) end get "/#{language}/cookie" do <<-HTML Cookie HTML end get "/#{language}/cookie/straight.#{language}" do get_variations( language, cookies['cookie'] ) end get "/#{language}/header" do <<-EOHTML Header EOHTML end get "/#{language}/header/straight.#{language}" do default = 'arachni_user' return if env['HTTP_USER_AGENT'].start_with?( default ) || env['HTTP_USER_AGENT'].include?( "\0" ) get_variations( language, env['HTTP_USER_AGENT'] ) end end