Guest User

Untitled

a guest
Jul 25th, 2018
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. Telnet server returning strange characters
  2. Client connected with the IP /127.0.0.1
  3. Client /127.0.0.1 has entered the username ÿûÿû ÿûÿû'ÿýÿûÿýdcole.
  4.  
  5. Socket client = serv.accept();
  6.  
  7. InetAddress clientip = client.getInetAddress();
  8.  
  9. out("Client connected with the IP " + clientip);
  10.  
  11. InputStream clientinput = client.getInputStream();
  12. OutputStream clientoutput = client.getOutputStream();
  13.  
  14. Scanner in = new Scanner(clientinput);
  15. clientoutput.write("Please enter your username: ".getBytes());
  16.  
  17. String username = in.nextLine();
  18. out("Client " + clientip + " has entered the username " + username + ".");
  19.  
  20. String pass = "Please enter the password for " + username + ": ";
  21. clientoutput.write(pass.getBytes());
  22.  
  23. String password = in.nextLine();
  24.  
  25. if (username.equals("dcole") && password.equals("test")) {
  26. clientoutput.write("rnCorrect password!".getBytes());
  27. } else {
  28. clientoutput.write("rnIncorrect password!".getBytes());
  29. }
Add Comment
Please, Sign In to add comment