Octal

HTTP Get command terminates telnet.

17 posts in this topic

When I connect to a website using telnet, and type "get / HTTP/1.1" the telnet window closes. I hit enter twice too.

I am running ubuntu 6.06 Dapper, if that changes anything.

Share this post


Link to post
Share on other sites
Be VERY careful which web site you telnet to... Could have a bad outcome.

Alk3

Share this post


Link to post
Share on other sites
[quote name='Alk3' post='203186' date='Aug 21 2006, 12:00 AM']
Be VERY careful which web site you telnet to... Could have a bad outcome.

Alk3
[/quote]
As in police?

Or as in, that is what is terminating the window.

Share this post


Link to post
Share on other sites
[quote name='Octal' post='203188' date='Aug 20 2006, 11:21 PM']
[quote name='Alk3' post='203186' date='Aug 21 2006, 12:00 AM']
Be VERY careful which web site you telnet to... Could have a bad outcome.

Alk3
[/quote]
As in police?

Or as in, that is what is terminating the window.
[/quote]


As in if you don't have permission from the website you telnet to, some people can count that as a computer crime.

Share this post


Link to post
Share on other sites
Once you issue the GET command, it's just going to output some of the header HTML and then close the connection, that's normal as GET is just a short command.

Share this post


Link to post
Share on other sites
[quote name='Perf-149' post='203190' date='Aug 21 2006, 12:26 AM']
[quote name='Octal' post='203188' date='Aug 20 2006, 11:21 PM']
[quote name='Alk3' post='203186' date='Aug 21 2006, 12:00 AM']
Be VERY careful which web site you telnet to... Could have a bad outcome.

Alk3
[/quote]
As in police?

Or as in, that is what is terminating the window.
[/quote]


As in if you don't have permission from the website you telnet to, some people can count that as a computer crime.
[/quote]

But on their end, they can't tell the difference between you telnetting there, and you surfing them through Internet Explorer. This isn't accessing unauthorized ressources, but publicly released webpages. So I'm surprised to see you write that. :huh:

Share this post


Link to post
Share on other sites
[quote name='Seal' post='203225' date='Aug 21 2006, 07:05 AM']
[quote name='Perf-149' post='203190' date='Aug 21 2006, 12:26 AM']
[quote name='Octal' post='203188' date='Aug 20 2006, 11:21 PM']
[quote name='Alk3' post='203186' date='Aug 21 2006, 12:00 AM']
Be VERY careful which web site you telnet to... Could have a bad outcome.

Alk3
[/quote]
As in police?

Or as in, that is what is terminating the window.
[/quote]


As in if you don't have permission from the website you telnet to, some people can count that as a computer crime.
[/quote]

But on their end, they can't tell the difference between you telnetting there, and you surfing them through Internet Explorer. This isn't accessing unauthorized ressources, but publicly released webpages. So I'm surprised to see you write that. :huh:
[/quote]
Yes, that may be, but for starting, I will get the permission from the web administrator which I do have.

Edit: Thanks tehbiz. I missed your post earlier. Edited by Octal

Share this post


Link to post
Share on other sites
When telnetting in, you could always enter in fake HTTP fields, so that it looks like a standard web
browser, instead of a telnet connection, but it's probably not a big deal... at all.

User-Agent: Mozilla/5.0 Edited by stderr

Share this post


Link to post
Share on other sites
type:

get / HTTP/1.1 *enter*
connection: keepalive (or keep-alive or something, i forget) *enter*
*enter*

and it wont terminate

Share this post


Link to post
Share on other sites
[quote name='Alk3' post='203186' date='Aug 21 2006, 12:00 AM']
Be VERY careful which web site you telnet to... Could have a bad outcome.
[/quote]

There is nothing wrong with telnetting to port 80 on a WebServer and interacting with the web server.

There could be a bad outcome if the telnet port was left open on the webserver and you happen to use it for malicious activity.

Share this post


Link to post
Share on other sites
a web browser connects to the server in almost exactally the same way telnet does, except that it is automated to fill in forms and get the data to interpret, no computer crime here telnet away

Share this post


Link to post
Share on other sites
[quote name='n3xg3n' post='203442' date='Aug 22 2006, 02:40 PM']
type:

get / HTTP/1.1 *enter*
connection: keepalive (or keep-alive or something, i forget) *enter*
*enter*

and it wont terminate
[/quote]
That helped, but both of them still terminated the telnet window. I'm going to search around for articles about this though.

Share this post


Link to post
Share on other sites
It is within the HTTP 1.1 standard that all clients must supply a host field in the headers. This allows one server to host multiple websites in a virtualhost. Otherwise every single domain would need its own IP, that would get old fast. If you're not supplying one then you're giving an invalid request which may or may not be completely ignored. Also in HTTP 1.1 all connecetions are assumed to be keep-alive unless stated otherwise.

Here's a full set of headers based on my default firefox ones that I have used in php

$host would be the domain and $path would be the URI of the specific page you want to request.

[code] $out = "GET " . $path . " HTTP/1.1\r\n"
. "Host: " . $host . "\r\n"
. "Connection: Close\r\n"
. "Accept: text/xml,application/xml,application/xhtml xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5\r\n"
. "Accept-Language: en-us,en;q=0.5\r\n"
. "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n"
. "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6\r\n"; [/code]

Share this post


Link to post
Share on other sites
first, make sure when you're telnetting to a [b]webserver[/b] you mean THE webserver ie address:80 and not simply the URI/IP that points to the server itself....cos then it'd be just corky and get wouldn't work anyhow.

That being said; whatever telnet application you are using sounds like it closes the window automagically when it closes off connection, try using the consol version of telnet as the "window" will remain open even when the connection is severed.

As far as law is concerned you needn't any permission, by running a webserver they have given implicit agreement to your accessing their system ON port 80 for the purpose of retrieving the files related to the site, html, php output, etc. so you needn't get any permission, they won't know the difference, if this was a cause for legal action google's proprieters would be in a deep dark dungeon, cos google surely doesn't use IE to access webservers ;p.... Edited by rEph

Share this post


Link to post
Share on other sites
[quote name='rEph' post='203623' date='Aug 23 2006, 04:04 PM']
first, make sure when you're telnetting to a [b]webserver[/b] you mean THE webserver ie address:80 and not simply the URI/IP that points to the server itself....cos then it'd be just corky and get wouldn't work anyhow.

That being said; whatever telnet application you are using sounds like it closes the window automagically when it closes off connection, try using the consol version of telnet as the "window" will remain open even when the connection is severed.

As far as law is concerned you needn't any permission, by running a webserver they have given implicit agreement to your accessing their system ON port 80 for the purpose of retrieving the files related to the site, html, php output, etc. so you needn't get any permission, they won't know the difference, if this was a cause for legal action google's proprieters would be in a deep dark dungeon, cos google surely doesn't use IE to access webservers ;p....
[/quote]

Thanks for everyone's replies... I know I didnt create this thread, but it is very informing. :devil: Edited by Alk3

Share this post


Link to post
Share on other sites
From what you're doing, it sounds like you're running telnet directly.
Try doing "Start > Run > cmd" first, then doing "telnet servername 80". Normally, once it's got the web page, telnet exits, and if you had it running standalone, then the window would also close. Running it from under cmd means that when it exits, you can still see everything.

Share this post


Link to post
Share on other sites
[quote name='DarkCow' post='204152' date='Aug 26 2006, 08:09 PM']
From what you're doing, it sounds like you're running telnet directly.
Try doing "Start > Run > cmd" first, then doing "telnet servername 80". Normally, once it's got the web page, telnet exits, and if you had it running standalone, then the window would also close. Running it from under cmd means that when it exits, you can still see everything.
[/quote]

I think you missed the part about the parent running UBUNTU and not Windows.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now