Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Telnet with Bad Request 400

Tags:

telnet

Have a look at the following post:

How to telnet google using command prompt?

I've tried the same thing, but keep getting a Bad Request! (400!) I'm working on a Windows 8 PRO machine. I just want to try a few things using Telnet, but as long as I keep getting this 400-error I can't really achieve much!

All I'm doing is the following:

o www.google.com 80 (PRESSING ENTER TWICE!!!)
GET / HTTP/1.1 (ENTER)
Host: www.google.com (PRESSING ENTER TWICE!!!)

Any help appreciated!

Bad Request!

like image 723
pdvries Avatar asked Apr 22 '13 09:04

pdvries


1 Answers

This problem can be solved by typing in the Telnet Commands exactly, so capitalize where needed and vice versa! Check this source for more detailed information on how to setup Telnet as a Instant HTTP Client. The source also explains that once you use a BACKSPACE to retype a command that the server receiving the command may interpret it as

<bs>

and if so, declares it as an illegal request! (This is what happened to me!)

Conclusion

It seems that you can communicate the Backspace-character properly if you have the host and client communicating properly! There's an article here that explains more about it on a technical level. To get this to work for the Windows Telnet Client, I do not know how and I'm not sure whether its possible! To get around this I would like to suggest using a program like PuTTY which is a free (MIT-licensed) Win32 Telnet and SSH client. There's an option available in the PuTTY client that allows you to change how the Backspace is generated in PuTTY, that is, which one is acceptable to you're host (if at all!)!

Please read the documentation section 4.4.1 for configuring this option "properly" (if all hosts are using this protocol; otherwise you probably need to read this article and somehow configure PuTTY to be accepted by you're host or vice versa!)!


Also, in the previous example I used Google which may need other parameters to get that working, but this may not have been the best choice to get a 200-status code immediately! Try bing.com instead (working for me at the moment!)!

o www.bing.com 80   (press ENTER twice!!!)
GET / HTTP/1.1      (press ENTER)
Host: www.bing.com  (press ENTER twice!!!)
like image 163
pdvries Avatar answered Oct 15 '22 08:10

pdvries