Find the answer to your Linux question:
Results 1 to 3 of 3
Hi all, I have two questions for an exam on Wednesday. I can solve part of the question and It seems impossible for me with the rest. Please help me. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2010
    Posts
    14

    Hi everyone, I need your help urgently


    Hi all, I have two questions for an exam on Wednesday. I can solve part of the question and It seems impossible for me with the rest. Please help me.

    Question 1:

    Using netcat, nc(1), craft a valid http/1.1 request for getting http headers (not the html file itself!) for the main index page of www dot aalto dot fi. What request method did you use? Which headers did you need to send to the server? What was the status code for the request? Which headers did the server return? Explain the purpose of each header.

    I try to do this question with the command:

    nc -v www dot aalto dot fi 8080
    HEAD / HTML/1.1
    host: www dot aalto dot fi

    And it returns:
    200 OK
    Content-Length: 858
    Content-Type: text/html
    Last-Modified: Thu, 02 Sep 2010 12:46:01 GMT
    Client-Date: Mon, 27 Sep 2010 14:07:36 GMT
    ETag: "3bd02-0-3c7ca6c2"
    Accept-Ranges: bytes
    Content-Length: 0
    Connection: close
    X-Pad: avoid browser bug

    I really don't know what does it mean.

    Question 2:

    Using netcat, nc(1), start a bogus web server listening on the loopback interface port 8080. Verify with netstat(, that the server really is listening where it should be. Direct your browser to the bogus server and capture the User-Agent: header

    "Direct your browser to the bogus server and capture the User-Agent: header" I don't understand this question. Please help me. I am looking forward to your reply. Thank you so much.

  2. #2
    Just Joined!
    Join Date
    Feb 2009
    Posts
    22
    Quote Originally Posted by lovesunset21 View Post
    Question 2:

    Using netcat, nc(1), start a bogus web server listening on the loopback interface port 8080. Verify with netstat(, that the server really is listening where it should be. Direct your browser to the bogus server and capture the User-Agent: header

    "Direct your browser to the bogus server and capture the User-Agent: header" I don't understand this question. Please help me. I am looking forward to your reply. Thank you so much.
    to start a server using net cat issue this command
    nc -s 127.0.0.1 -l -p 8080

    to verify it using netstat issue this command:
    netstat -lnt

    and observe this kind of entry exists in the output.

    tcp 0 0 127.0.0.1:8080 0.0.0.0:* LISTEN


    Now open wireshark in and make it listen on interface lo

    Last, open your web browser and type this in the address bar
    h t t p : / / 127.0.0.1:8080
    (sorry i m not allowed to post any knind of URL)

    press enter and at this point in time you will see ur wireshark is showing you the HTTP request your browser has sent. This is know as your capture of the Http request. There will be a packet in it that shows the Http headers (basically the GET method of http). There among the Http Headers you will see you user Agent also. Ideally, it should show you the type of the client (called as user agnet) the request has come from.
    in my case, i used firefox so the user agent show

    User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.3) ..... blah..blah.....

  3. #3
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,733
    Quote Originally Posted by lovesunset21 View Post
    Hi all, I have two questions for an exam on Wednesday.
    Hello, and welcome to the forums!

    Homework type questions aren't allowed on the forums:

    http://www.linuxforums.org/forum/lin...ums-rules.html

    ...but we do wish you the very best of luck with the upcoming exam and hope you get a high score.
    oz

  4. $spacer_open
    $spacer_close

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •