Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

mTCP DOS - NC documentation issue (design bug)? (Announce)

posted by mbbrutman Homepage, Washington, USA, 20.07.2010, 15:22

Hi Arjay,

I missed that other thread - thanks for pointing it out!

As always, it depends on the server. http://www.cnn.com and http://www.brutman.com will happily give you a default page even though the header is technically wrong.

A proper telnet newline is a carriage return and linefeed pair. Your post implies that only the LF is needed. If so, that's news to me - I thought that HTTP was expecting telnet newlines, not just plain LFs.

(Just in case, I gave the user a command line option for sending the Enter key as a carriage return, or a CR/LF pair when using it interactively. Ctrl-J and Ctrl-Enter can be used for sending just a pure line feed, and Ctrl-M for sending a pure CR if anybody never needs that.)

I'm going to be doing wget shortly, so I'll crisp up the docs then.




> Just referenced the mTCP version of NC
> in this
> forum reply. To be honest I've been too busy with my own
> coding/away from the keyboard activities to test mTCP yet.
>
> However I did note the following line in
> http://brutman.com/mTCP/nc.txt:
>
> "(If you send "GET /" without the quotes and press Enter, you will get a
> web page back!)"
>
> I don't know if this is the case with the mTCP version of NC but this is
> wrong you shouldn't get a webpage back on most servers if you do the above.
> This is an example of a correct basic GET request as per the RFC's:
>
> "GET / HTTP/1.0[LF]" where [LF] = character 0Ah
>
> or
>
> "GET / HTTP/1.1[LF]" where [LF] = character 0Ah
>
> The above should also be case sensitive.
>
> However be aware that some servers are so badly coded (or on purpose) that
> even this basic test may not work, e.g. "GET / HTTP/1.1" will work
> but "GET / HTTP/1.0" will NOT work or the server may sit there
> waiting for a longer url to be requested etc.
>
> Note: 0Ah can often be obtained by [CTRL]+[ENTER]. For anyone interesting
> in scripting reading this also note many DOS based editors allow you to
> insert control codes via [CTRL ^P] and followed by [CTRL whatever] where
> whatever is the approrpriate combination required, e.g. [CTRL]+[P] then
> [CTRL]+[ENTER] or [CTRL]+[P] then [CTRL]+[B] to insert a bell. This is
> useful to know if for example you wish to feed a text file via redirection
> to something like netcat.
>
> The vast majority of telnet based servers will tend to respond with a
> header if you just send a few LineFeeds (CTRL+[ENTER]) or if that fails try
> sending Carriage Returns (ENTER)'s instead or CRLF, it depends on the
> server and if the programmer has read the RFC's etc. In the case of HTTP
> servers, using sending a HEAD request instead of a GET request is also
> useful.
>
> For anyone needing more info:
> http://www.google.com/search?q=http+get+telnet

---
mTCP - TCP/IP apps for vintage DOS machines!
http://www.brutman.com/mTCP

 

Complete thread:

Back to the forum
Board view  Mix view
22780 Postings in 2123 Threads, 402 registered users (0 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum