AFAIK, Windows remembers the network locations you've connected to (and tagged as Guest, Work or Home). It identifies them based on (possibly among other things) the domain name returned by the DHCP server and the MAC address of the default gateway.
On Windows 7 home at least, with the regedit
GUI, and as an admin user, I can get that information from HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList
.
However, when using reg query
or regedit /e
to get that information from the command line like:
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList" /s
I'm denied access NetworkList
and any of its sub-keys.
That works from an elevated cmd.exe
.
If I try to run that command over Cygwin sshd
(using reg
or /proc/registry
) or via kaspersky security center remote diagnostics utility (which lets me run commands on remote machines) or with SysInteral psexec
, then I can access NetworkList
but none of its sub-keys (no output returned). That part I can reproduce on Win7 Enterprise, Windows 10 and Windows 8.1 as well.
So how could one get access to those restricted section of the registry from Cygwin sshd
.
Alternatively, is there another way to access the list of network profiles (the information I'm most interested in is the DateCreated, DateLastConnected, Category (public, private), ProfileName (or any indication of what the SSID might have been for wifi networks), DnsSuffix and DefaultGatewayMac) that doesn't have such restrictions (from sshd
).
Or Alternatively, how to get access to the registry files or any other method I can get to that information from sshd
on Window 7 home, 8.1 or 10?
If anyone can explain the mechanism by which those seem to be hidden from me (AFAICT, the ACL for NetworkList is the same as for its parent or its subkeys), that would be great.
sshd
in any special way (other than runningssh-host-config
?). I just tested that it doesn't work for me in Win10, Win7 enterprise, win8.1. Tested withssh admin@host "reg query 'HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles' /s"
.debug1: Next authentication method: password
and the password is the Windows one.