From 185c91565584c4a79c70a9a1a3e35f45b4ecd900 Mon Sep 17 00:00:00 2001 From: wchen-r7 Date: Fri, 31 Mar 2017 17:20:04 -0500 Subject: [PATCH] Change port --- chef/cookbooks/metasploitable/files/sinatra/check.rb | 2 +- chef/cookbooks/metasploitable/files/sinatra/poc.rb | 2 +- chef/cookbooks/metasploitable/files/sinatra/start.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/chef/cookbooks/metasploitable/files/sinatra/check.rb b/chef/cookbooks/metasploitable/files/sinatra/check.rb index 4ba8474..647c424 100644 --- a/chef/cookbooks/metasploitable/files/sinatra/check.rb +++ b/chef/cookbooks/metasploitable/files/sinatra/check.rb @@ -11,7 +11,7 @@ require 'net/http' SECRET = "a7aebc287bba0ee4e64f947415a94e5f" -cli = Net::HTTP.new('127.0.0.1', 8080) +cli = Net::HTTP.new('127.0.0.1', 8181) req = Net::HTTP::Get.new('/') res = cli.request(req) cookie = res['Set-Cookie'].scan(/_metasploitable=(.+); path/).flatten.first || '' diff --git a/chef/cookbooks/metasploitable/files/sinatra/poc.rb b/chef/cookbooks/metasploitable/files/sinatra/poc.rb index 1af717f..c1de5bb 100644 --- a/chef/cookbooks/metasploitable/files/sinatra/poc.rb +++ b/chef/cookbooks/metasploitable/files/sinatra/poc.rb @@ -27,7 +27,7 @@ dump = [ Marshal.dump(session) ].pack('m') hmac = OpenSSL::HMAC.hexdigest(OpenSSL::Digest::SHA1.new, SECRET, dump) cookie = "_metasploitable=#{CGI.escape("#{dump}--#{hmac}")}" -http = Net::HTTP.new('127.0.0.1', 8080) +http = Net::HTTP.new('127.0.0.1', 8181) req = Net::HTTP::Get.new('/') req['Cookie'] = cookie res = http.request(req) diff --git a/chef/cookbooks/metasploitable/files/sinatra/start.rb b/chef/cookbooks/metasploitable/files/sinatra/start.rb index f5cfe43..df0b465 100644 --- a/chef/cookbooks/metasploitable/files/sinatra/start.rb +++ b/chef/cookbooks/metasploitable/files/sinatra/start.rb @@ -8,7 +8,7 @@ MYSECRET = 'a7aebc287bba0ee4e64f947415a94e5f' set :environment, :development set :bind, '0.0.0.0' -set :port, 8080 +set :port, 8181 use Rack::Session::Cookie, :key => "_metasploitable",