Skip to content

Commit afaf832

Browse files
committed
remove verbose error from library, bubble consistent exceptions to the module instead
1 parent a6e5944 commit afaf832

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

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

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -123,27 +123,12 @@ def start_service
123123
self.service.send_response_proc = Proc.new do |cli, data|
124124
on_send_response(cli,data)
125125
end
126-
126+
127127
add_static_hosts
128128
self.service.start(!datastore['DISABLE_NS_CACHE'])
129129

130130
rescue ::Errno::EACCES => e
131-
if (srvport.to_i < 1024)
132-
print_line(" ")
133-
print_error("Could not start the DNS server: #{e}.")
134-
print_error(
135-
"This module is configured to use a privileged port (#{srvport}). " +
136-
"On Unix systems, only the root user account is allowed to bind to privileged ports." +
137-
"Please run the framework as root to use this module."
138-
)
139-
print_error(
140-
"On Microsoft Windows systems, this error is returned when a process attempts to "+
141-
"listen on a host/port combination that is already in use. For example, Windows XP "+
142-
"will return this error if a process attempts to bind() over the system SMB/NetBIOS services."
143-
)
144-
print_line(" ")
145-
end
146-
raise e
131+
raise Rex::BindFailed.new(e.message)
147132
end
148133
end
149134

0 commit comments

Comments
 (0)