Skip to content

Commit a6e5944

Browse files
committed
fix msftidy, add nicer errors on bind failure
1 parent 84b463f commit a6e5944

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

modules/auxiliary/server/dns/native_server.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ def run
3636
begin
3737
start_service
3838
service.wait
39+
rescue Rex::BindFailed => e
40+
print_error "Failed to bind to port #{datastore['RPORT']}: #{e.message}"
3941
ensure
4042
stop_service(true)
4143
end

modules/auxiliary/spoof/dns/native_spoofer.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def initialize(info = {})
3333
[
3434
OptString.new('FILTER', [false, 'The filter string for capturing traffic', 'dst port 53']),
3535
OptAddress.new('SRVHOST', [true, 'The local host to listen on for DNS services.', '127.0.2.2'])
36-
], self.class)
36+
])
3737

3838
deregister_options('PCAPFILE')
3939
end
@@ -46,6 +46,8 @@ def run
4646
start_service
4747
capture_traffic
4848
service.wait
49+
rescue Rex::BindFailed => e
50+
print_error "Failed to bind to port #{datastore['RPORT']}: #{e.message}"
4951
ensure
5052
@capture_thread.kill if @capture_thread
5153
close_pcap

0 commit comments

Comments
 (0)