Windows Forensic

Windows Registry

Windows Forensic - 图1

Enumeration

  1. require 'win32/registry'
  2. # List keys
  3. keyname = 'SOFTWARE\Clients'
  4. access = Win32::Registry::KEY_ALL_ACCESS
  5. Win32::Registry::HKEY_LOCAL_MACHINE.open(keyname, access).keys
  6. # List all MAC address keys
  7. keyname= 'SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\Unmanaged'
  8. access = Win32::Registry::KEY_ALL_ACCESS
  9. Win32::Registry::HKEY_LOCAL_MACHINE.open(ketname, access).keys
  10. keyname= 'SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\Unmanaged'
  11. access = Win32::Registry::KEY_ALL_ACCESS
  12. Win32::Registry::HKEY_LOCAL_MACHINE.open(keyname, access) do |reg|;
  13. reg.each_key{|k, v| puts k, v}
  14. end

Note: KEY_ALL_ACCESS enables you to write and deleted. The default access is KEY_READ if you specify nothing.