[ ] Thursday, 23 October 2014 [ ]

VNC on MacMini

Found this article: Manage VNC / screen sharing password remotely which explains where the vnc password is stored and how to view it using perl:


sudo cat /Library/Preferences/com.apple.VNCSettings.txt | perl -wne 'BEGIN { @k = unpack "C*", pack "H*", "1734516E8BA8C5E2FF1C39567390ADCA"}; chomp; @p = unpack "C*", pack "H*", $_; foreach (@k) { printf "%c", $_ ^ (shift @p || 0) }; print "\n"'
hello
 

$ perl -we 'BEGIN { @k = unpack "C*", pack "H*", "1734516E8BA8C5E2FF1C39567390ADCA"}; $_ = <>; chomp; s/^(.{8}).*/$1/; @p = unpack "C*", $_; foreach (@k) { printf "%02X", $_ ^ (shift @p || 0) }; print "\n"' | sudo tee /Library/Preferences/com.apple.VNCSettings.txt
hello
7F513D02E4A8C5E2FF1C39567390ADCA
With ssvnc the vncpasswd command is called vncstorepw.

vnc


$Id: diary,v 1.38 2025/01/01 22:43:54 fred Exp $