Dispose of unmanaged resources used by the server's UnsafeStreamCodec
and JpgCompression (because it is pretty related to the
UnsafeStreamCodec). Made sure that the UnsafeStreamCodec was being
disposed of before being re-assigned.
Note: I did not reflect these changes to the client's UnsafeStreamCodec
because the implementation of the client's codec is a bit different in
the CommandHandler. This different implementation caused instability in
the client. In the server, I noticed decreased memory consumption and
decreased fluctuation in the memory used.
Setting objects to null would be optimized out. Clearing lists probably
would not be optimized out. There is no need to explicitly clear a list
of items or setting objects to null in C#. We must let the Garbage
Collector have its way.
Made the lock for the codec readonly. This makes it impossible for a
spot (excluding constructors) from touching the lock. Tampering with the
lock means that, if something acquires the lock and enters critical
code, the lock can be changed and the critical code's thread safety can
be violated.
Added a Load Balancer, this will try balancing all the proxy connections
over multiple clients (keep refreshing ipchicken.com to see the cool
effect)
Resolve the DNS Hostname of the Target server at the Remote Client to
reduce DNS Leaks
Added FrmMain instance null check to safely exit a thread in the
FrmKeylogger form in the case of client-server disconnection. The
FrmKeylogger spawns a thread that waits for the enabled button to be set
to true, after successfully receiving all the log files from the client.
If the server were to somehow not process the button being enabled it
would hang in the while loop leaving the entire process to be left in
memory due to the thread being open.
-added hookless keylogger class with unicode support
-logs on keylogger class are saved in html format
-added keylogger form using webbrowser to load the log as an html file
-added context menu keylogger option under surveillance
-started keylogger setting enable/disable on client file execution
(didn't complete this, wasn't sure how to do it properly. just added
the setting in the settings class and in program class for the logic.
only thing left is the server side stuff)
left todo:
-encryption/decryption of logs if desired
-options to enable/disable when building client, etc...
There exists a bug, when you decline the license the server crashs. Safe
exit is not needed anyways in the terms of use form as nothing special
happend yet.
Fixed a bug where changing resolutions while Remote Desktop is running
would crash both the client + server. This fix ensures that the Remote
Desktop features continues to run accurately after changing resolutions
on the client.
Rewrote the File Manager Form's 'lstDirectory_DoubleClick' method so it
is more clear, to prevent unnecessary strings being recreated, and
because it was making the same decision twice when it didn't need to.
Also placed the Setting Form's 'btnListen_Click' method in a try-finally
block so if anything goes wrong in the method, the state of it won't be
frozen (before, you would have to click out of the Form, discard
changes, then re-open. Perhaps it would be advisable to notify the user
of an issue with the listening if it failed...
Fixed a potential CrossThreadException. Would have gotten an error if this method was called by a different Thread because FrmSi's 'lstSystem' would be accessed by the wrong Thread.
Compacted the validation on frmBuilder's btnBuild_Click(object,
EventArgs) method. This is a slight optimization, but it does help
remove the repetitive else statements.
Made sure the server disposed of the Socket when Server.Listen(ushort)
is called if the Socket was created before (called Server.Listen(ushort)
previously but stopped listening).
added try catch blocks due to server application crashing while closing
the remote desktop form. If timed right, while closing the remote
desktop form, the command handler would be in the midst of accessing an
already disposed form causing server to hang.