fixed bug with hostname not existing in the dns/hosts file
This commit is contained in:
@@ -61,10 +61,9 @@ module Banners
|
||||
beef_host = configuration.get("beef.http.public") || configuration.get("beef.http.host")
|
||||
|
||||
# create an array of the interfaces the framework is listening on
|
||||
if beef_host == '0.0.0.0' # the framework will listen on all interfaces
|
||||
interfaces = Socket.getaddrinfo(Socket.gethostname, 0, Socket::AF_UNSPEC, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME).map { |x| x[3] }
|
||||
interfaces = interfaces << "127.0.0.1"
|
||||
interfaces.uniq!
|
||||
if beef_host == '0.0.0.0' # the framework will listen on all interfaces
|
||||
interfaces = Socket.ip_address_list.map {|x| x.ip_address if x.ipv4?}
|
||||
interfaces.delete_if {|x| x.nil?} # remove if the entry is nill
|
||||
else # the framework will listen on only one interface
|
||||
interfaces = [beef_host]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user