• Sign in to Neowin Faster!

    Create an account on Neowin to contribute and support the site.

  • 0
Sign in to follow this  

Retrieving website data using TELNET

Question

donchen    9

Hi all,

I am currently taking a Networking Module.

My lecturer showed me something pretty cool.

$ telnet www.google.com 80

Connected to www.google.com

Escape character is '^]'.

GET http://www.google.com

And it actually returns something

How come I can't do the same thing at home ?

Share this post


Link to post
Share on other sites

15 answers to this question

Recommended Posts

  • 0
The_Decryptor    1,105

I've only managed to do it once, and I typed it out beforehand and piped it through, if I tried typing it by hand it ended up timing out on me.

Share this post


Link to post
Share on other sites
  • 0
McSmiggins    0

I think you actually want:

telnet <host> 80

GET / HTTP/1.1

Host: <url>

<hit return twice>

eg for google:

telnet www.google.com 80

GET / HTTP/1.1

Host: www.google.com

<hit return twice>

Also, be very sure to type it correctly the first time, the delete key is just sent as a character for telnet, so the actual command the server gets is a mess

Share this post


Link to post
Share on other sites
  • 0
donchen    9

yah. i did that. But i can't seem to get to connect. It get stuck at " Connecting to www.google.com ... "

decryptor: how do u type it out before hand ?

Share this post


Link to post
Share on other sites
  • 0
donchen    9

I did the following.

I fired up telnet form windows.

Microsoft Telnet>

Microsoft Telnet> open www.google.com 80

Connecting To www.google.com...

it just stays this way until connection timed out.

Share this post


Link to post
Share on other sites
  • 0
+BudMan    3,737

Well from you post -- it would seem he was on linux shell?

Works fine from there

$ telnet www.google.com 80

Trying 208.67.217.231...

Connected to google.navigation.opendns.com.

Escape character is '^]'.

get http://www.google.com

<html><head><meta http-equiv="content-type" content="text/html; charset=ISO-8859 -1"><title>Google</title><style>body,td,a,p,.h{font-family:arial,sans-serif}.h{f ont-size:20px}.h{color:#3366cc}.q{color:#00c}.ts td{padding:0}.ts{border-collaps e:collapse}#gbar{float:left;font-weight:bold;height:22px;

<snipped>

The MS telnet client is not very good ;) use cygwin if your stuck on a windows box

Share this post


Link to post
Share on other sites
  • 0
donchen    9

Yeah. My lecturer is on a Linux shell.

But whatever it is, it should also be working on windows right ?

I also tried using a telnet program call PUTTY. I got the same results.

What is wrong ? Could it be because i am behind a firewall ? Or i am on a router ?

Share this post


Link to post
Share on other sites
  • 0
markjensen    101

telnet www.google.com 80
get /

And I get the page served to me.

Worked on my Linux box. Worked on my wife's XP box.

Share this post


Link to post
Share on other sites
  • 0
donchen    9

Any idea why it is not working on my PC ?

mark, are you on a router ?

Share this post


Link to post
Share on other sites
  • 0
markjensen    101

Yeah, we have a router.

If you can ping google, you should be able to retrieve the webpage (with the get / command)

You are putting a space there, right?

Share this post


Link to post
Share on other sites
  • 0
Olemus    19

If your using vista telnet will come back as unrecognized.

Share this post


Link to post
Share on other sites
  • 0
Maximum Error    2

If you are using vista you will have to install the telnet client from the turn windows features section in control panel>programs........

Share this post


Link to post
Share on other sites
  • 0
donchen    9
Yeah, we have a router.

If you can ping google, you should be able to retrieve the webpage (with the get / command)

You are putting a space there, right?

I can ping google with no problem. I can't even connect to google with my telnet nonetheless typing the get / command.

If your using vista telnet will come back as unrecognized.

I used Vista's and also XP's ones also can't work.

If you are using vista you will have to install the telnet client from the turn windows features section in control panel>programs........

I have already on that feature and i can run telnet on Vista. Just can't connect to it.

Share this post


Link to post
Share on other sites
  • 0
+BudMan    3,737
telnet www.google.com 80
get /

And I get the page served to me.

Worked on my Linux box. Worked on my wife's XP box.

Yup works fine here on xp as well.. Just not as pretty ;)

post-14624-1191687897_thumb.jpg

Use the command as mark posted it.

Share this post


Link to post
Share on other sites
  • 0
donchen    9

anyone got any solution ?

Share this post


Link to post
Share on other sites
  • 0
+BudMan    3,737

yeah ;) use a web browser vs telnet to access http :rofl:

Or if you want to duplicate what your teacher was doing -- use the same telnet client/os he was -- ie linux.

You could try hitting it using the telnet under cygwin.

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.