Post Windows Gather NTDS.DIT Location - Metasploit
This page contains detailed information about how to use the post/windows/gather/ntds_location metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.
Module Overview
Name: Post Windows Gather NTDS.DIT Location
Module: post/windows/gather/ntds_location
Source code: modules/post/windows/gather/ntds_location.rb
Disclosure date: -
Last modification time: 2021-10-06 13:43:31 +0000
Supported architecture(s): -
Supported platform(s): Windows
Target service / protocol: -
Target network port(s): -
List of CVEs: -
This module will find the location of the NTDS.DIT file (from the Registry), check that it exists, and display its location on the screen, which is useful if you wish to manually acquire the file using ntdsutil or vss.
Module Ranking and Traits
Module Ranking:
- normal: The exploit is otherwise reliable, but depends on a specific version and can't (or doesn't) reliably autodetect. More information about ranking can be found here.
Basic Usage
There are two ways to execute this post module.
From the Meterpreter prompt
The first is by using the "run" command at the Meterpreter prompt. It allows you to run the post module against that specific session:
meterpreter > run post/windows/gather/ntds_location
From the msf prompt
The second is by using the "use" command at the msf prompt. You will have to figure out which session ID to set manually. To list all session IDs, you can use the "sessions" command.
msf > use post/windows/gather/ntds_location
msf post(ntds_location) > show options
... show and set options ...
msf post(ntds_location) > set SESSION session-id
msf post(ntds_location) > exploit
If you wish to run the post against all sessions from framework, here is how:
1 - Create the following resource script:
framework.sessions.each_pair do |sid, session|
run_single("use post/windows/gather/ntds_location")
run_single("set SESSION #{sid}")
run_single("run")
end
2 - At the msf prompt, execute the above resource script:
msf > resource path-to-resource-script
Required Options
- SESSION: The session to run this module on.
Go back to menu.
Msfconsole Usage
Here is how the windows/gather/ntds_location post exploitation module looks in the msfconsole:
msf6 > use post/windows/gather/ntds_location
msf6 post(windows/gather/ntds_location) > show info
Name: Post Windows Gather NTDS.DIT Location
Module: post/windows/gather/ntds_location
Platform: Windows
Arch:
Rank: Normal
Provided by:
Stuart Morgan <[email protected]>
Compatible session types:
Meterpreter
Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
SESSION yes The session to run this module on.
Description:
This module will find the location of the NTDS.DIT file (from the
Registry), check that it exists, and display its location on the
screen, which is useful if you wish to manually acquire the file
using ntdsutil or vss.
Module Options
This is a complete list of options available in the windows/gather/ntds_location post exploitation module:
msf6 post(windows/gather/ntds_location) > show options
Module options (post/windows/gather/ntds_location):
Name Current Setting Required Description
---- --------------- -------- -----------
SESSION yes The session to run this module on.
Advanced Options
Here is a complete list of advanced options supported by the windows/gather/ntds_location post exploitation module:
msf6 post(windows/gather/ntds_location) > show advanced
Module advanced options (post/windows/gather/ntds_location):
Name Current Setting Required Description
---- --------------- -------- -----------
VERBOSE false no Enable detailed status messages
WORKSPACE no Specify the workspace for this module
Post Actions
This is a list of all post exploitation actions which the windows/gather/ntds_location module can do:
msf6 post(windows/gather/ntds_location) > show actions
Post actions:
Name Description
---- -----------
Evasion Options
Here is the full list of possible evasion options supported by the windows/gather/ntds_location post exploitation module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):
msf6 post(windows/gather/ntds_location) > show evasion
Module evasion options:
Name Current Setting Required Description
---- --------------- -------- -----------
Go back to menu.
Error Messages
This module may fail with the following error messages:
Check for the possible causes from the code snippets below found in the module source code. This can often times help in identifying the root cause of the problem.
Unable to find the location of NTDS.DIT
Here is a relevant code snippet related to the "Unable to find the location of NTDS.DIT" error message:
27:
28: def run
29: # Find the location of NTDS.DIT in the Registry
30: ntds = registry_getvaldata('HKLM\\SYSTEM\\CurrentControlSet\\Services\\NTDS\\Parameters', 'DSA Database file')
31: unless ntds
32: print_error('Unable to find the location of NTDS.DIT')
33: return
34: end
35:
36: if file?(ntds)
37: f = client.fs.file.stat(ntds)
NTDS.DIT is reportedly located at `<NTDS>', but the file does not appear to exist
Here is a relevant code snippet related to the "NTDS.DIT is reportedly located at `<NTDS>', but the file does not appear to exist" error message:
37: f = client.fs.file.stat(ntds)
38: print_line("NTDS.DIT is located at: #{ntds}")
39: print_line(" Size: #{f.size.to_s} bytes")
40: print_line(" Created: #{f.ctime.to_s}")
41: print_line(" Modified: #{f.mtime.to_s}")
42: print_line(" Accessed: #{f.atime.to_s}")
43: else
44: print_error("NTDS.DIT is reportedly located at `#{ntds}', but the file does not appear to exist")
45: end
46: end
47: end
Go back to menu.
Related Pull Requests
- #8716 Merged Pull Request: Print_Status -> Print_Good (And OCD bits 'n bobs)
- #6655 Merged Pull Request: use MetasploitModule as a class name
- #6648 Merged Pull Request: Change metasploit class names
- #6356 Merged Pull Request: Get NTDS.DIT location on a DC
Go back to menu.
See Also
Check also the following modules related to this module:
- post/windows/gather/ad_to_sqlite
- post/windows/gather/arp_scanner
- post/windows/gather/avast_memory_dump
- post/windows/gather/bitcoin_jacker
- post/windows/gather/bitlocker_fvek
- post/windows/gather/bloodhound
- post/windows/gather/cachedump
- post/windows/gather/checkvm
- post/windows/gather/dnscache_dump
- post/windows/gather/dumplinks
- post/windows/gather/enum_ad_bitlocker
- post/windows/gather/enum_ad_computers
- post/windows/gather/enum_ad_groups
- post/windows/gather/enum_ad_managedby_groups
- post/windows/gather/enum_ad_service_principal_names
- post/windows/gather/enum_ad_to_wordlist
- post/windows/gather/enum_ad_user_comments
- post/windows/gather/enum_ad_users
- post/windows/gather/enum_applications
- post/windows/gather/enum_artifacts
- post/windows/gather/exchange
- post/windows/gather/file_from_raw_ntfs
- post/windows/gather/get_bookmarks
- post/windows/gather/hashdump
- post/windows/gather/local_admin_search_enum
- post/windows/gather/lsa_secrets
- post/windows/gather/make_csv_orgchart
- post/windows/gather/memory_dump
- post/windows/gather/memory_grep
- post/windows/gather/netlm_downgrade
- post/windows/gather/ntds_grabber
- post/windows/gather/outlook
- post/windows/gather/phish_windows_credentials
- post/windows/gather/psreadline_history
- post/windows/gather/resolve_sid
- post/windows/gather/reverse_lookup
- post/windows/gather/screen_spy
- post/windows/gather/smart_hashdump
- post/windows/gather/tcpnetstat
- post/windows/gather/usb_history
- post/windows/gather/win_privs
- post/windows/gather/wmic_command
- post/windows/gather/word_unc_injector
Authors
- Stuart Morgan <stuart.morgan[at]mwrinfosecurity.com>
Version
This page has been produced using Metasploit Framework version 6.2.1-dev. For more modules, visit the Metasploit Module Library.
Go back to menu.