mirror of
https://github.com/rapid7/metasploitable3.git
synced 2024-07-04 18:55:48 +02:00
Change port
This commit is contained in:
parent
92d0e1bc45
commit
185c915655
|
@ -11,7 +11,7 @@ require 'net/http'
|
||||||
|
|
||||||
SECRET = "a7aebc287bba0ee4e64f947415a94e5f"
|
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('/')
|
req = Net::HTTP::Get.new('/')
|
||||||
res = cli.request(req)
|
res = cli.request(req)
|
||||||
cookie = res['Set-Cookie'].scan(/_metasploitable=(.+); path/).flatten.first || ''
|
cookie = res['Set-Cookie'].scan(/_metasploitable=(.+); path/).flatten.first || ''
|
||||||
|
|
|
@ -27,7 +27,7 @@ dump = [ Marshal.dump(session) ].pack('m')
|
||||||
hmac = OpenSSL::HMAC.hexdigest(OpenSSL::Digest::SHA1.new, SECRET, dump)
|
hmac = OpenSSL::HMAC.hexdigest(OpenSSL::Digest::SHA1.new, SECRET, dump)
|
||||||
cookie = "_metasploitable=#{CGI.escape("#{dump}--#{hmac}")}"
|
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 = Net::HTTP::Get.new('/')
|
||||||
req['Cookie'] = cookie
|
req['Cookie'] = cookie
|
||||||
res = http.request(req)
|
res = http.request(req)
|
||||||
|
|
|
@ -8,7 +8,7 @@ MYSECRET = 'a7aebc287bba0ee4e64f947415a94e5f'
|
||||||
|
|
||||||
set :environment, :development
|
set :environment, :development
|
||||||
set :bind, '0.0.0.0'
|
set :bind, '0.0.0.0'
|
||||||
set :port, 8080
|
set :port, 8181
|
||||||
|
|
||||||
use Rack::Session::Cookie,
|
use Rack::Session::Cookie,
|
||||||
:key => "_metasploitable",
|
:key => "_metasploitable",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user