Skip to content

Commit 1a0b342

Browse files
committed
Add srvport to HttpServer
This allows URIPORT to override SRVPORT.
1 parent 1c9a890 commit 1a0b342

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lib/msf/core/exploit/http/server.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,19 @@ def srvhost_addr
490490
host
491491
end
492492

493+
#
494+
# Returns the local port that is being listened on.
495+
#
496+
def srvport
497+
if datastore['URIPORT']
498+
port = datastore['URIPORT']
499+
else
500+
port = datastore['SRVPORT']
501+
end
502+
503+
port
504+
end
505+
493506
#
494507
# Removes a URI resource.
495508
#

0 commit comments

Comments
 (0)