@@ -36,6 +36,9 @@ def init
3636 self . next_id = 0
3737 end
3838
39+ #
40+ # Save the custom settings to the MSF config file
41+ #
3942 def save_config
4043 new_config = { }
4144 [ self . entries_with_rules , self . entries_without_rules ] . each do |entry_set |
@@ -52,6 +55,9 @@ def save_config
5255 Msf ::Config . save ( CONFIG_KEY => new_config )
5356 end
5457
58+ #
59+ # Load the custom settings from the MSF config file
60+ #
5561 def load_config
5662 config = Msf ::Config . load
5763
@@ -92,8 +98,8 @@ def load_config
9298 end
9399
94100 # Add a custom nameserver entry to the custom provider
95- # @param [ wildcard_rules] Array<String> The wildcard rules to match a DNS request against
96- # @param [ dns_server] Array<String> The list of IP addresses that would be used for this custom rule
101+ # @param wildcard_rules [ Array<String>] The wildcard rules to match a DNS request against
102+ # @param dns_server [ Array<String>] The list of IP addresses that would be used for this custom rule
97103 # @param comm [Msf::Session::Comm] The communication channel to be used for these DNS requests
98104 def add_nameserver ( wildcard_rules , dns_server , comm )
99105 raise ::ArgumentError . new ( "Invalid DNS server: #{ dns_server } " ) unless Rex ::Socket . is_ip_addr? ( dns_server )
@@ -118,7 +124,7 @@ def add_nameserver(wildcard_rules, dns_server, comm)
118124 #
119125 # Remove entries with the given IDs
120126 # Ignore entries that are not found
121- # @param [Array<Integer>] The IDs to removed
127+ # @param ids [Array<Integer>] The IDs to removed
122128 # @return [Array<Hash>] The removed entries
123129 #
124130 def remove_ids ( ids )
@@ -140,6 +146,7 @@ def remove_ids(ids)
140146 #
141147 # The custom nameserver entries that have been configured
142148 # @return [Array<Array>] An array containing two elements: The entries with rules, and the entries without rules
149+ #
143150 def nameserver_entries
144151 [ entries_with_rules , entries_without_rules ]
145152 end
@@ -148,6 +155,11 @@ def purge
148155 init
149156 end
150157
158+ # The nameservers that match the given packet
159+ # @param packet [Dnsruby::Message] The DNS packet to be sent
160+ # @raise [ResolveError] If the packet contains multiple questions, which would end up sending to a different set of nameservers
161+ # @return [Array<Array>] A list of nameservers, each with Rex::Socket options
162+ #
151163 def nameservers_for_packet ( packet )
152164 # Leaky abstraction: a packet could have multiple question entries,
153165 # and each of these could have different nameservers, or travel via
0 commit comments