I have created a script to connect to the remote server through SSH in Windows using Cygwin. The public and private key pair is generated using Putty Key-gen. The IP, port, private key etc., are shared using the Plink. For the security I have introduced my own exe along with the private key, which checks the hardware info like HDD serial number so that the users cannot connect to the server using any other hardware (By cloning or copying the program files). In server there will be one more application which audits the client hardware info and rejects the connection if finds new hardware which is not approved. Everything works fine but the problem is with the security.
As I mentioned, the credentials or private key information and other details are sent using the Plink. The problem is when the user connects to the server using this setup; the Plink sends the information to the server for authentication. Here the problem is that anyone can see the commands that are sent to Plink using Process explorer etc. Using this, anyone can access the server if they got the private key and its password with user’s password (My applications sends the hardware info to the server to another TCP port on the server (It is in parallel to the SSH connection, but it is separate connection). It does not work through the SSH tunneling. So, I have made my application to send the hardware information to the server initially, and then SSH server will make the connection by verifying the private key).
But, if the user gets the logic how SSH connection is made, he can directly send those command parameters to the Plink.exe and make the connection by using user’s private key and password. I will not have any control over this if done so.
Is there any way to mask these commadlines in Plink? If not please mention any other ways or alternate applications using which I can achieve the above task. Please help, Thank you in advance..