aadfPT / chriscontrol

Automatically exported from code.google.com/p/chriscontrol
0 stars 0 forks source link

Inability to connect to Win7 and Vista machines - Fixed [Code Mod] #10

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Thanks for the free software Chris - though 2b2 was a tad incomplete and had a 
few too many timeout issues I found. 

Could not get cad.exe working.... was unable to send C-A-D to Vista or Win7 
machines, and had trouble with getting through Windows firewall on a workgroup.

Not complaining, happy to help - I've had a stab at fixing some of the issues 
which weren't working for me (hope you don't mind). I've come up with a modded 
source that works very smoothly with Win7 and Vista and incorporates the new 
UVNC 1.0.9.5 which resolves the C-A-D issue using schooks.dll

NOTE: Discovered that on a workgroup, even if you have admin rights to the 
remote machine. The following may be required on the remote machine to allow 
access to hidden Admin shares. (Which ChrisControl uses to run)

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
"LocalAccountTokenFilterPolicy"=dword:00000001

See: http://support.microsoft.com/kb/951016
     http://support.microsoft.com/kb/942817

Shouldn't be a problem on a domain....

Also, I found I also had to disable UAC for admin accounts for it to work 100%

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]"F
ilterAdministratorToken"=dword:00000000

See http://www.wilderssecurity.com/showthread.php?t=184846

Need to test further - but this <could> potentially be automated (using sc and 
remote reg writing) to prepare remote PCs for Chriscontrol. Introducing an 
option:

[x] Enable Workgroup Admin$ access and disable UAC

.. or even just doing it behind the scenes .. see what you think.

Changes to this version
  - Updated UVNC to 1.0.9.5 (schooks) - works with cad

  - Implemented XP/Vista/7 Windows Firewall auto-exclusion adding
    --> Uses rctrlx (http://sites.google.com/site/4utils/projects) and netsh
    --> netsh has a -r switch (which would avoid the need for rctrlx or psexec), however just hangs when I test it mostly .. works fine with rctrlx
    --> rctrlx works better than psexec in most scenarios and has no commercial or private licensing restrictions

  - Multiple timing fixes and speedups ... feels a lot snappier now
    --> \VNCTemp more likely to be removed
    --> reduced CPU stealing in timing loops
    --> times out very quickly for dead IPs

  - Fixed potential bug with TCPStartup() being called without corresponding TCPShutdown() ... not sure but could have caused a memory leak?

  - Improved logic with testing for remote admin share connectability
    --> Will not try to connect / map drive twice in the same connect cycle

  - Tidied up some code functions somewhat (see what you think MapAdminDrive)

I am happy to share the code, however have not attached it here as I don't want 
to expose it without your consent.

Please reply and I can PM or attach.

Original issue reported on code.google.com by ccha...@gmail.com on 3 Feb 2011 at 2:56

GoogleCodeExporter commented 9 years ago
How do I get this?  This sounds like what I have been looking for for a long 
time now. Thank you.

Original comment by jpmea...@gmail.com on 27 May 2011 at 3:46

GoogleCodeExporter commented 9 years ago
Here's a copy of the source and executable that I made some changes to. I 
updated the version of winvnc and enabled the C-A-D sequence on Windows 7 
machines. I had problems getting the new winvnc to connect from a Windows 7 pc 
to an XP pc so it now detects the operating system and uses an older version of 
winvnc for targets running XP. 

Winvnc would also disconnect but keep running on the target computer when you 
logged a user off in Windows 7, keeping you from making a new connection and 
keeping chriscontrol from deleting the files. To fix this it will now also kill 
any winvnc processes running on the target pc before it tries to uninstall, 
allowing you to reconnect. However, it does still disconnect you.

Original comment by Tyler.Co...@gmail.com on 7 Jun 2011 at 5:06

Attachments:

GoogleCodeExporter commented 9 years ago
Hi Patrick / Tyler,

Apologies for the delayed response - was overseas and didn't check this page 
for a while. I note Tyler has uploaded a modded source, cool ... will download 
and give it a whirl - am busy with some other stuff, please give me a few days 
to test and compare to my own mod and report back.

I was a bit reticent to upload the source without getting any response from 
Chris, as we are in essence 'hijacking' his source / control process. Plus 
don't really want to become responsible for updating this app. However, seeing 
as we haven't heard from Chris for months, I am happy to release my version 
here if it will prove useful. Ofcourse, still happy to share source and 
handover back to Chris should he want to pick this up again.

I can definitely vouch for my mod version - been using it in the field from 
various platforms (Win7, W2k3, WXP), and it works well. I had to do some 
further development from that mentioned above to get it to stabilise ... 

I did find that C-A-D did not work reliably in all circumstances .. (depending 
on the UAC settings of the target comp). This is actually an issue with UVNC, 
though managed to get it working using a single version of UVNC from this 
branch:

http://forum.ultravnc.info/viewtopic.php?t=17476

.. which has some built in adaptive behaviour. Not sure if this is going to be 
incorporated as a permanent feature, though for now it works. 

I am aware of one small bug to fix, and I will review Tyler's version to see if 
I can glean anything I may have missed, and will post a full working version 
soon as I get a chance (can't promise any timescales but soon...) Will post 
more detail on the UVNC version tests I did for the C-A-D issue also.

Original comment by ccha...@gmail.com on 4 Jul 2011 at 1:05

GoogleCodeExporter commented 9 years ago
I didn't bother cleaning up my code after making my changes so I'm sure it's 
pretty ugly. My workplace has been using it for two months though and haven't 
ran into any issues that weren't isolated OS problems on the target PC. In 
these cases it would work fine after reinstalling windows.

Original comment by Tyler.Co...@gmail.com on 4 Jul 2011 at 1:13

GoogleCodeExporter commented 9 years ago
Hey Tyler,

Thanks for the update.

Don't worry 'bout the code mate, I'll just compare to Chris' original source to 
spot changes - should easily see what you did. 

Forgot to mention I also ran into the WinVNC issue not disconnecting, and did a 
similar thing to you with killing the process before removing, however 
sometimes schooks.dll becomes locked though and will not remove - it is related 
to the C-A-D implementation I think.

Also, in relation to UltraVNC and C-A-D. During my research I found the 
following:

UVNC versions earlier than 1.0.9.5 used cad.exe, which was a proprietary file 
to send the ctrl-alt-del.Version 1.0.9.5 started using the native windows 
'Secure Attention Sequence (SAS)' DLL that sends the command. (I believe this 
is Vista/Win7 though I think I only could get it to work in Win7)

http://www.insidetheregistry.com/regdatabase/viewvalue.aspx?valueid=2320

By Default, this is enabled only for 'Easy Access Applications', but not for 
Services. UVNC requires SAS to be enabled for services as well.

This means the following value must be set to 1 or 3

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System] 
"SoftwareSASGeneration"=dword:00000003

GPO:Administrative Templates\Windows Components\System\Windows Logon 
Options\Software Secure Attention Sequence ... Set to 'Services and Ease of 
Access applications'

However, given all the above, I found also that the SAS sequence is dependant 
on the state of UAC on the machine.... If UAC is enabled (I think), then SAS 
doesn't work, and a legacy solution like cad.exe is required to be used.

Hence why in the end, rather than implement all the logic, I gave up and went 
with the 1.0.8.2 modded branch of UVNC which automatically detects whether UAC 
is enabled or disabled and connects using the appropriate method. This has the 
side effect of working fine on Vista also.

Can I ask what versions of UVNC you are using for XP / Win7? as I cannot see 
any reference to cad.exe in your source.

Could I also ask that you please try the following test and confirm behaviour 
with your mod version:
--> On a Win7 PC - remove Chriscontrol totally from the PC .. Try toggling the 
state of UAC, restarting and reconnecting with Chriscontrol from scratch. Does 
it still allow you to send C-A-D?

If you can confirm the above, will help me ascertain whether you are observing 
the same behaviour I did.

regards - thecharliec

Original comment by ccha...@gmail.com on 4 Jul 2011 at 5:26

GoogleCodeExporter commented 9 years ago
Tyler, is it possible to add a feature to remotely enable RDP in your build?

Original comment by FunkyHou...@gmail.com on 13 Sep 2013 at 4:40

GoogleCodeExporter commented 9 years ago
I'm sure it's possible, but it's not likely to come from me. I changed jobs 
since I last worked on this and no longer actively use it or need to in my new 
role.

It should be a fun little project if you want to tackle it yourself. Making the 
changes I did was a great way to get familiar with this (pretty powerful) 
scripting language. I ended up taking what I learned from this and using it to 
make half a dozen other little apps to make my network admin job easier.

Original comment by Tyler.Co...@gmail.com on 13 Sep 2013 at 5:57