Spencer McIntyre
2b3a723557
Consistently refer to black hole as two words
2024-03-19 20:49:28 -04:00
Spencer McIntyre
b3b6f79594
Update the presentation of static entries
...
Keep the first line blank for consistency with rules and sort hostnames
and addresses.
2024-03-19 12:48:13 -04:00
Spencer McIntyre
5b1d0100d2
Add spell checking for resolvers
2024-03-19 12:48:07 -04:00
Spencer McIntyre
a366f6a819
The DNS feature requires a restart, so flag it
...
Also rename DNS_FEATURE to simply DNS because in this context, the
FEATURE suffix is redundant.
2024-03-12 09:58:52 -04:00
Spencer McIntyre
65cc577694
Fix saving and loading DNS rules from the config
2024-03-11 14:55:36 -04:00
Spencer McIntyre
eca99e2c77
Refactor resolver types
2024-02-14 14:40:22 -05:00
Spencer McIntyre
5036d28b44
Validate hostnames before storing them
...
This proactively fixes a potential DoS condition where if a user were to
add a hostname containing a ; and followed by data that is not an IP
address that MSF may fail to start.
Example:
dns add-static 'foo;bar' 192.0.2.1
save
2024-02-09 14:52:41 -05:00
Spencer McIntyre
1b2a2af4d4
Fix unit tests on Ruby 3.2 because IPAddr =~ fails
2024-02-08 17:10:49 -05:00
Spencer McIntyre
56d2dfa46a
Fix removing invalid DNS rule IDs
2024-02-08 17:00:40 -05:00
Spencer McIntyre
630301a0df
Add versioning to the DNS configuration
2024-02-08 16:39:24 -05:00
Spencer McIntyre
1cab98f4c2
Support multiple addresses for a static hostname
2024-02-08 16:05:54 -05:00
Spencer McIntyre
62e960352f
Refactor naming entries as rules
2024-02-08 13:05:53 -05:00
Spencer McIntyre
243ebcb3a6
Add some missing documentation
2024-02-08 13:05:53 -05:00
Spencer McIntyre
c1a08b97d2
Load the termux hosts file path too
2024-02-08 13:05:50 -05:00
Spencer McIntyre
5c9b454291
Change initialization to allow reseting
...
Change how the resolver is initialized so the instance can be reset to
sane default values loaded from the operating system.
2024-02-08 11:22:33 -05:00
Spencer McIntyre
2653a180e4
Update tests add new initialization methods
2024-02-08 11:22:33 -05:00
Spencer McIntyre
648a7b394d
Update configuration saving and loading
2024-02-08 11:22:33 -05:00
Spencer McIntyre
bd7d4f0099
Add commands to manage static hostname records
2024-02-08 11:22:33 -05:00
Spencer McIntyre
fcd84a41aa
Add a DNS resolver for static entries
...
Move support for static entries out of the cache so it can be controlled
like the other resolvers.
2024-02-08 11:22:33 -05:00
Spencer McIntyre
2cf706e91f
Use the dns entry index instead of unique IDs
2024-02-08 11:22:33 -05:00
Spencer McIntyre
43a7993215
Show the matching rule for DNS resolution
2024-02-08 11:22:33 -05:00
Spencer McIntyre
3c716041bd
Add the blackhole resolver
2024-02-08 11:22:33 -05:00
Spencer McIntyre
3445c1b588
Add the system resolver for A and AAAA queries
2024-02-08 11:22:33 -05:00
Spencer McIntyre
a5dc63617f
Refactor resolver entries to unify them
...
Now resolution will match a single rule, but that rule can have multiple
servers.
2024-02-08 11:22:33 -05:00
Spencer McIntyre
464d2eef73
Add a method for upstream resolvers from query args
2024-02-08 11:22:33 -05:00
Spencer McIntyre
7fe10d8613
Switch to a more generic upstream resolvers model
...
Upstream resolvers can be DNS servers or something else.
2024-02-08 11:22:33 -05:00
Spencer McIntyre
282f97ba2d
Add the flush-cache subcommand
...
Also rename purge to flush-entries and update descriptions to clarify
what exactly is being flushed.
2024-02-08 11:22:33 -05:00
Spencer McIntyre
319cff7d3a
Change the DNS timeout from 30 to 5 seconds
...
Also, add the #to_i method for timeouts
This makes it compatible with Rex Sockets later on
2024-02-08 11:22:33 -05:00
Spencer McIntyre
c780bfcb66
Add a DNS query command for inspection
2024-02-08 11:22:32 -05:00
Spencer McIntyre
6fdfd7147c
Print the system nameservers too
2024-02-08 11:22:32 -05:00
Spencer McIntyre
9181d93807
Search for a resolv.conf file
2024-02-08 11:22:32 -05:00
Dean Welch
4bdff53358
Refactor dns send_tcp
2024-01-05 10:38:31 +00:00
Dean Welch
f92b2662c4
Fix dns resolution skipping over nameservers with valid responses
2024-01-04 14:10:45 +00:00
Ashley Donaldson
473ded345b
Fix UDP detection when DNS resolution is not on
2023-11-23 10:34:09 +11:00
Ashley Donaldson
ef9a165d22
Changes from code review
2023-11-22 16:43:02 +11:00
Ashley Donaldson
34bd661d3f
Fall back to other server if first one fails
2023-11-22 09:06:06 +11:00
Ashley Donaldson
1a07ab5aee
Improved comments on functions
2023-11-10 15:56:45 +11:00
Ashley Donaldson
f351d7b5e1
Don't create DNS cached resolver on every test, because it'll exhaust the OS's resources
2023-11-10 12:07:37 +11:00
Ashley Donaldson
d0585e0df5
Added unit tests
2023-11-09 14:45:06 +11:00
Ashley Donaldson
8ce328022c
Clearer dns feature results
2023-11-08 11:15:01 +11:00
Ashley Donaldson
1a7eefd972
Support saving and loading DNS in the MSF config file
2023-11-08 07:38:12 +11:00
Ashley Donaldson
7442655ab9
Override to TCP when encountering UDP-unfriendly comms
2023-11-07 15:58:45 +11:00
Ashley Donaldson
21f3335c31
Fully integrated Rex-socket-friendly DNS
2023-11-07 14:05:24 +11:00
Ashley Donaldson
a7c4b29748
Register nameserver with framework
2023-11-07 06:46:06 +11:00
Grant Willcox
3e81408a24
Add support for getting IPv6 addresses from hosts files and saving them into the cache
2023-04-28 14:47:56 -05:00
Grant Willcox
708da64a68
Add back in the require for dnsruby
2023-04-23 13:56:24 -05:00
RageLtMan
97c0fa7411
Split CachedResolver to own file per jmartin-r7
2023-04-17 13:14:47 -04:00
Grant Willcox
246a69e897
Remove unneeded return statement after raising an exception
2023-04-14 15:28:17 -05:00
Grant Willcox
da5a361d3f
Remove extra require that wasn't needed with Zeitwerk
2023-04-14 15:28:17 -05:00
Grant Willcox
2d90bdcecb
Fix up some YARD issues
2023-04-14 15:28:17 -05:00