I established a telnet connection to a remote machine using the following program and now I wish to find the version of the firefox browser present on the remote computer. How do I do it?
Program for telnet connection:
package conn;
import org.springframework.*;
import javax.servlet.http.HttpServlet;
import org.apache.commons.net.telnet.TelnetClient;
public class BV1 extends HttpServlet
{
private TelnetClient telnet = new TelnetClient();
public BV1(String server, String user, String password )
{
try
{
telnet.connect(server, 3389);
System.out.println("Connected to : "+server);
telnet.getKeepAlive();
System.out.println("Is telnet connected : "+telnet.isConnected());
telnet.disconnect();
System.out.println("Is telnet connected : "+telnet.isConnected());
}
catch(Exception e)
{
e.printStackTrace();
}
}
private String getCurrentWorkingDirectory() {
// TODO Auto-generated method stub
return null;
}
public static void main(String args[])
{
try
{
BV1 telnet = new BV1("remotehost_server","username","password");
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
For this to work, ensure that one machine is in the TelnetClients group of the other.