require 'sinatra' require 'sinatra/contrib' require 'ap' get '/' do <<-EOHTML Link Form Cookie Header EOHTML end get "/link" do <<-EOHTML Link Link EOHTML end get "/link/straight" do default = 'default' return if params['input'].start_with?( default ) || !params['input'].include?( '_arachni_trainer_' ) redirect "/link/straight/trained" end get "/link/straight/trained" do <<-EOHTML Stuff EOHTML end get "/link/append" do default = 'default' return if !params['input'].start_with?( default ) || !params['input'].include?( '_arachni_trainer_' ) redirect "/link/append/trained" end get "/link/append/trained" do <<-EOHTML Stuff EOHTML end get "/form" do <<-EOHTML
EOHTML end get "/form/straight" do default = 'default' return if !params['input'] || params['input'].start_with?( default ) redirect "/form/straight/trained" end get "/form/straight/trained" do <<-EOHTML
Stuff
EOHTML end get "/form/append" do default = 'default' return if !params['input'] || !params['input'].start_with?( default ) redirect "/form/append/trained" end get "/form/append/trained" do <<-EOHTML
Stuff
EOHTML end get "/cookie" do <<-EOHTML Cookie Cookie EOHTML end get "/cookie/straight" do default = 'cookie value' cookies['cookie'] ||= default return if cookies['cookie'].start_with?( default ) || !cookies['cookie'].include?( '_arachni_trainer_' ) redirect "/cookie/straight/trained" end get "/cookie/straight/trained" do <<-EOHTML Stuff EOHTML end get "/cookie/append" do default = 'cookie value' cookies['cookie2'] ||= default return if !cookies['cookie2'].start_with?( default ) || !cookies['cookie2'].include?( '_arachni_trainer_' ) redirect "/cookie/append/trained" end get "/cookie/append/trained" do <<-EOHTML Stuff EOHTML end get "/header" do <<-EOHTML Header Header EOHTML end get "/header/straight" do default = 'default' return if !env['HTTP_USER_AGENT'] || env['HTTP_USER_AGENT'].start_with?( default ) || !env['HTTP_USER_AGENT'].include?( '_arachni_trainer_' ) redirect "/header/straight/trained" end get "/header/straight/trained" do <<-EOHTML Stuff EOHTML end get "/header/append" do default = 'arachni_user' return if !env['HTTP_USER_AGENT'] || !env['HTTP_USER_AGENT'].start_with?( default ) || !env['HTTP_USER_AGENT'].include?( '_arachni_trainer_' ) redirect "/header/append/trained" end get "/header/append/trained" do <<-EOHTML Stuff EOHTML end