Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNS feature stops working when trying to use it before enabling the feature #18948

Closed
cdelafuente-r7 opened this issue Mar 12, 2024 · 0 comments · Fixed by #18949
Closed

DNS feature stops working when trying to use it before enabling the feature #18948

cdelafuente-r7 opened this issue Mar 12, 2024 · 0 comments · Fixed by #18949

Comments

@cdelafuente-r7
Copy link
Contributor

The DNS feature stops working when the dns_feature value is set to false or if it is not present in the config, when trying to use the dns command.

To reproduce this bug:

  1. start msfconsole without a config file in $HOME/.msf4/
  2. run dns help and see the expected error message
  3. enable the feature with features set dns_feature true
  4. run dns help again and nothing happens
msf6 > ls -l ~/.msf4/config
[*] exec: ls -l ~/.msf4/config

ls: /home/msfuser/.msf4/config: No such file or directory
msf6 > dns help
[-] Unknown command: dns. Run the help command for more details.
msf6 > features set dns_feature true
dns_feature => true
msf6 > dns help
msf6 > dns print
msf6 >

Other scenario:

  1. start msfconsole
  2. disable the feature with features set dns_feature false
  3. exit and restart msfconsole
  4. run dns help and see the expected error message
  5. enable the feature with features set dns_feature true
  6. run dns help again and nothing happens
msf6 > features set dns_feature false
dns_feature => false
msf6 > save
Saved configuration to: /home/msfuser/.msf4/config
msf6 > exit
❯ ./msfconsole -q
msf6 > cat ~/.msf4/config
[*] exec: cat ~/.msf4/config

[framework/core]

[framework/features]
dns_feature=false

[framework/ui/console]

msf6 > dns help
[-] Unknown command: dns. Run the help command for more details.
msf6 > features set dns_feature true
dns_feature => true
msf6 > dns help
msf6 >

This doesn't happen if the dns feature is enabled in the config.

msf6 > cat ~/.msf4/config
[*] exec: cat ~/.msf4/config

[framework/core]

[framework/features]
dns_feature=true

[framework/ui/console]

msf6 > features set dns_feature false
dns_feature => false
msf6 > dns help
[-] Unknown command: dns. Run the help command for more details.
msf6 > features set dns_feature true
dns_feature => true
msf6 > dns help
Manage Metasploit's DNS resolution behaviour

USAGE:
  dns [add] [--index <insertion index>] [--rule <wildcard DNS entry>] [--session <session id>] <resolver> ...
  dns [add-static] <hostname> <IP address> ...
  dns [remove/del] -i <entry id> [-i <entry id> ...]
  dns [remove-static] <hostname> [<IP address> ...]
  dns [flush-cache]
  dns [flush-entries]
  dns [flush-static]
  dns [print]
  dns [reset-config] [-y/--yes] [--system]
  dns [resolve] [-f <address family>] <hostname> ...
  dns [help] [subcommand]

SUBCOMMANDS:
  add           - Add a DNS resolution entry to resolve certain domain names through a particular DNS resolver
  add-static    - Add a statically defined hostname
  flush-cache   - Remove all cached DNS answers
  flush-entries - Remove all configured DNS resolution entries
  flush-static  - Remove all statically defined hostnames
  print         - Show all configured DNS resolution entries
  remove        - Delete a DNS resolution entry
  remove-static - Delete a statically defined hostname
  reset-config  - Reset the DNS configuration
  resolve       - Resolve a hostname

EXAMPLES:
  Display help information for the 'add' subcommand
    dns help add

msf6 >
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant