http headers

Discussion in 'NZ Computing' started by Shane, Aug 20, 2005.

  1. Shane

    Shane Guest

    Having a go at making an app that logs into a website, nothing too
    complicated, but.....
    I keep getting a 302 (file temporarily moved)
    heres how I got as far as I have

    telnet <someones server> 80
    POST /somestuff/login.asp HTTP/1.1
    Host <someones server>
    Content-Length: 35

    name=fred-dagg&password=smellsfunny

    HTTP/1.1 200 OK
    Server: Microsoft-IIS/5.0
    Date: Sat, 20 Aug 2005 20:37:27 GMT
    Pragma: no-cache
    Content-Length: 11785
    Content-Type: text/html
    Expires: Sun, 24 Nov 2002 19:37:26 GMT
    Set-Cookie: somestuff; path=/
    Set-Cookie: someother stuff; path=/
    Set-Cookie: yet more stuff; path=/
    Set-Cookie: Session Cookie I need to keep stateful connection; path=/
    Cache-control: no-cache, no-store, no-check, must-revalidate, private

    ##so far so good
    ##but when I send

    GET /path/to/some/goodies HTTP/1.1


    ##I get a 302

    sometimes this happens because I havent sent a cookie back, sometimes it
    happens before I even get a chance to send the cookie (as above)
    If I send the correct cookie I still get a 302
    but.. if I use firefox or some other browser, the resource exists, at the
    correct path

    STUMPED -_-
    any help appreciated
    well almost any
    :)

    --
    Hardware, n.: The parts of a computer system that can be kicked

    The best way to get the right answer on usenet is to post the wrong one.
     
    Shane, Aug 20, 2005
    #1
    1. Advertising

  2. Shane

    ChrisOD Guest

    In article <-a-geek.net>, Shane wrote:
    > Having a go at making an app that logs into a website, nothing too
    > complicated, but.....
    > I keep getting a 302 (file temporarily moved)
    > heres how I got as far as I have
    >
    > telnet <someones server> 80
    > POST /somestuff/login.asp HTTP/1.1
    > Host <someones server>
    > Content-Length: 35
    >
    > name=fred-dagg&password=smellsfunny
    >
    > HTTP/1.1 200 OK
    > Server: Microsoft-IIS/5.0
    > Date: Sat, 20 Aug 2005 20:37:27 GMT
    > Pragma: no-cache
    > Content-Length: 11785
    > Content-Type: text/html
    > Expires: Sun, 24 Nov 2002 19:37:26 GMT
    > Set-Cookie: somestuff; path=/
    > Set-Cookie: someother stuff; path=/
    > Set-Cookie: yet more stuff; path=/
    > Set-Cookie: Session Cookie I need to keep stateful connection; path=/
    > Cache-control: no-cache, no-store, no-check, must-revalidate, private
    >
    > ##so far so good
    > ##but when I send
    >
    > GET /path/to/some/goodies HTTP/1.1
    >
    >
    > ##I get a 302
    >
    > sometimes this happens because I havent sent a cookie back, sometimes it
    > happens before I even get a chance to send the cookie (as above)
    > If I send the correct cookie I still get a 302
    > but.. if I use firefox or some other browser, the resource exists, at the
    > correct path
    >
    > STUMPED -_-
    > any help appreciated
    > well almost any
    >:)
    >

    I've had similar problems with some app servers and HTTP conversations.
    What has helped me is installing a local proxy server such as:
    http://www.tcpiq.com/tcpIQ/ProxyWorkbench/
    then point firefox at 127.0.0.1 (as a proxy)
    Then the app will log all the conversation.

    That's a windows app but I'm sure sourceforge will have similar linux apps

    Chris
     
    ChrisOD, Aug 20, 2005
    #2
    1. Advertising

  3. Shane

    Shane Guest

    On Sun, 21 Aug 2005 10:50:22 +1200, ChrisOD wrote:

    > In article <-a-geek.net>, Shane
    > wrote:
    >> Having a go at making an app that logs into a website, nothing too
    >> complicated, but.....
    >> I keep getting a 302 (file temporarily moved) heres how I got as far as
    >> I have
    >>
    >> telnet <someones server> 80
    >> POST /somestuff/login.asp HTTP/1.1
    >> Host <someones server>
    >> Content-Length: 35
    >>
    >> name=fred-dagg&password=smellsfunny
    >>
    >> HTTP/1.1 200 OK
    >> Server: Microsoft-IIS/5.0
    >> Date: Sat, 20 Aug 2005 20:37:27 GMT
    >> Pragma: no-cache
    >> Content-Length: 11785
    >> Content-Type: text/html
    >> Expires: Sun, 24 Nov 2002 19:37:26 GMT Set-Cookie: somestuff; path=/
    >> Set-Cookie: someother stuff; path=/
    >> Set-Cookie: yet more stuff; path=/
    >> Set-Cookie: Session Cookie I need to keep stateful connection; path=/
    >> Cache-control: no-cache, no-store, no-check, must-revalidate, private
    >>
    >> ##so far so good
    >> ##but when I send
    >>
    >> GET /path/to/some/goodies HTTP/1.1
    >>
    >>
    >> ##I get a 302
    >>
    >> sometimes this happens because I havent sent a cookie back, sometimes it
    >> happens before I even get a chance to send the cookie (as above) If I
    >> send the correct cookie I still get a 302 but.. if I use firefox or some
    >> other browser, the resource exists, at the correct path
    >>
    >> STUMPED -_-
    >> any help appreciated
    >> well almost any
    >>:)
    >>

    > I've had similar problems with some app servers and HTTP conversations.
    > What has helped me is installing a local proxy server such as:
    > http://www.tcpiq.com/tcpIQ/ProxyWorkbench/ then point firefox at 127.0.0.1
    > (as a proxy) Then the app will log all the conversation.
    >
    > That's a windows app but I'm sure sourceforge will have similar linux apps
    >
    > Chris


    excellent, that has given me a couple of ideas
    if I can get NetCat to do similar I will, else I will have a crack with
    that one.. Im sure I can rustle up a copy of ME somewhere :)
    Thanks


    --
    Hardware, n.: The parts of a computer system that can be kicked

    The best way to get the right answer on usenet is to post the wrong one.
     
    Shane, Aug 21, 2005
    #3
  4. Shane

    ChrisOD Guest

    In article <-a-geek.net>, Shane wrote:
    > On Sun, 21 Aug 2005 10:50:22 +1200, ChrisOD wrote:
    >
    >> In article <-a-geek.net>, Shane
    >> wrote:
    >>> Having a go at making an app that logs into a website, nothing too
    >>> complicated, but.....
    >>> I keep getting a 302 (file temporarily moved) heres how I got as far as
    >>> I have
    >>>
    >>> telnet <someones server> 80
    >>> POST /somestuff/login.asp HTTP/1.1
    >>> Host <someones server>
    >>> Content-Length: 35
    >>>
    >>> name=fred-dagg&password=smellsfunny
    >>>
    >>> HTTP/1.1 200 OK
    >>> Server: Microsoft-IIS/5.0
    >>> Date: Sat, 20 Aug 2005 20:37:27 GMT
    >>> Pragma: no-cache
    >>> Content-Length: 11785
    >>> Content-Type: text/html
    >>> Expires: Sun, 24 Nov 2002 19:37:26 GMT Set-Cookie: somestuff; path=/
    >>> Set-Cookie: someother stuff; path=/
    >>> Set-Cookie: yet more stuff; path=/
    >>> Set-Cookie: Session Cookie I need to keep stateful connection; path=/
    >>> Cache-control: no-cache, no-store, no-check, must-revalidate, private
    >>>
    >>> ##so far so good
    >>> ##but when I send
    >>>
    >>> GET /path/to/some/goodies HTTP/1.1
    >>>
    >>>
    >>> ##I get a 302
    >>>
    >>> sometimes this happens because I havent sent a cookie back, sometimes it
    >>> happens before I even get a chance to send the cookie (as above) If I
    >>> send the correct cookie I still get a 302 but.. if I use firefox or some
    >>> other browser, the resource exists, at the correct path
    >>>
    >>> STUMPED -_-
    >>> any help appreciated
    >>> well almost any
    >>>:)
    >>>

    >> I've had similar problems with some app servers and HTTP conversations.
    >> What has helped me is installing a local proxy server such as:
    >> http://www.tcpiq.com/tcpIQ/ProxyWorkbench/ then point firefox at 127.0.0.1
    >> (as a proxy) Then the app will log all the conversation.
    >>
    >> That's a windows app but I'm sure sourceforge will have similar linux apps
    >>
    >> Chris

    >
    > excellent, that has given me a couple of ideas
    > if I can get NetCat to do similar I will, else I will have a crack with
    > that one.. Im sure I can rustle up a copy of ME somewhere :)
    > Thanks
    >
    >

    I'm sure nc can do it.
    It's just basically logging everything.

    Or you could try
    wget -o mylog.file -v url://mysecretstuff/ms.asp
     
    ChrisOD, Aug 21, 2005
    #4
  5. Shane

    Shane Guest


    >>> That's a windows app but I'm sure sourceforge will have similar linux
    >>> apps
    >>>
    >>> Chris

    >>
    >> excellent, that has given me a couple of ideas if I can get NetCat to do
    >> similar I will, else I will have a crack with that one.. Im sure I can
    >> rustle up a copy of ME somewhere :) Thanks
    >>
    >>

    > I'm sure nc can do it.
    > It's just basically logging everything.
    >
    > Or you could try
    > wget -o mylog.file -v url://mysecretstuff/ms.asp


    a bit of work later and I have half of the answer
    They wanted all FOUR cookies they set
    BUT......
    now Im hitting a 500 server error :)
    this is fun :)

    thanks for the hint, and best of luck getting RB to engage you in an adult
    convo ;-)


    --
    Hardware, n.: The parts of a computer system that can be kicked

    The best way to get the right answer on usenet is to post the wrong one.
     
    Shane, Aug 21, 2005
    #5
  6. Shane

    Enkidu Guest

    Shane wrote:
    > Having a go at making an app that logs into a website, nothing too
    > complicated, but.....
    > I keep getting a 302 (file temporarily moved)
    > heres how I got as far as I have
    >
    > telnet <someones server> 80
    > POST /somestuff/login.asp HTTP/1.1
    > Host <someones server>
    > Content-Length: 35
    >
    > name=fred-dagg&password=smellsfunny
    >
    > HTTP/1.1 200 OK
    > Server: Microsoft-IIS/5.0
    > Date: Sat, 20 Aug 2005 20:37:27 GMT
    > Pragma: no-cache
    > Content-Length: 11785
    > Content-Type: text/html
    > Expires: Sun, 24 Nov 2002 19:37:26 GMT
    > Set-Cookie: somestuff; path=/
    > Set-Cookie: someother stuff; path=/
    > Set-Cookie: yet more stuff; path=/
    > Set-Cookie: Session Cookie I need to keep stateful connection; path=/
    > Cache-control: no-cache, no-store, no-check, must-revalidate, private
    >
    > ##so far so good
    > ##but when I send
    >
    > GET /path/to/some/goodies HTTP/1.1
    >
    >
    > ##I get a 302
    >

    You should then parse the 302 response to get the new
    location of the page. Do another GET to get the page. On
    subsequent requests for the page you should still first do a
    GET for the original page.

    Cheers,

    Cliff

    --

    Barzoomian the Martian - http://barzoomian.blogspot.com
     
    Enkidu, Aug 21, 2005
    #6
  7. Shane

    Shane Guest

    On Sun, 21 Aug 2005 16:26:59 +1200, Enkidu wrote:

    > Shane wrote:


    >> ##I get a 302
    >>

    > You should then parse the 302 response to get the new location of the
    > page. Do another GET to get the page. On subsequent requests for the page
    > you should still first do a GET for the original page.
    >
    > Cheers,
    >
    > Cliff


    Heh, thats the thing, I get nothing but the error page
    or got.. as you can see further into the thread I discovered the error was
    cookie related, and now I get 500's (and Im crossing my fingers Im not
    breaking anything server side as its not my server)

    --
    Hardware, n.: The parts of a computer system that can be kicked

    The best way to get the right answer on usenet is to post the wrong one.
     
    Shane, Aug 21, 2005
    #7
  8. In article <-a-geek.net>,
    Shane <-a-geek.net> wrote:

    >##but when I send
    >
    >GET /path/to/some/goodies HTTP/1.1
    >
    >
    >##I get a 302


    Just a note that the "Host:" header line is mandatory with HTTP 1.1.
     
    Lawrence D’Oliveiro, Aug 21, 2005
    #8
  9. Shane

    Harry Guest

    ChrisOD wrote:

    > In article <-a-geek.net>, Shane
    > wrote:
    >> Having a go at making an app that logs into a website, nothing too
    >> complicated, but.....
    >> I keep getting a 302 (file temporarily moved)
    >> heres how I got as far as I have
    >>
    >> telnet <someones server> 80
    >> POST /somestuff/login.asp HTTP/1.1
    >> Host <someones server>
    >> Content-Length: 35
    >>
    >> name=fred-dagg&password=smellsfunny
    >>
    >> HTTP/1.1 200 OK
    >> Server: Microsoft-IIS/5.0
    >> Date: Sat, 20 Aug 2005 20:37:27 GMT
    >> Pragma: no-cache
    >> Content-Length: 11785
    >> Content-Type: text/html
    >> Expires: Sun, 24 Nov 2002 19:37:26 GMT
    >> Set-Cookie: somestuff; path=/
    >> Set-Cookie: someother stuff; path=/
    >> Set-Cookie: yet more stuff; path=/
    >> Set-Cookie: Session Cookie I need to keep stateful connection; path=/
    >> Cache-control: no-cache, no-store, no-check, must-revalidate, private
    >>
    >> ##so far so good
    >> ##but when I send
    >>
    >> GET /path/to/some/goodies HTTP/1.1
    >>
    >>
    >> ##I get a 302
    >>
    >> sometimes this happens because I havent sent a cookie back, sometimes it
    >> happens before I even get a chance to send the cookie (as above)
    >> If I send the correct cookie I still get a 302
    >> but.. if I use firefox or some other browser, the resource exists, at the
    >> correct path
    >>
    >> STUMPED -_-
    >> any help appreciated
    >> well almost any
    >>:)
    >>

    > I've had similar problems with some app servers and HTTP conversations.
    > What has helped me is installing a local proxy server such as:
    > http://www.tcpiq.com/tcpIQ/ProxyWorkbench/
    > then point firefox at 127.0.0.1 (as a proxy)
    > Then the app will log all the conversation.
    >
    > That's a windows app but I'm sure sourceforge will have similar linux apps
    >


    Much easier just to put your nic in promiscuous mode and use tcpdump.
    Or even use strace.
     
    Harry, Aug 21, 2005
    #9
  10. Shane

    Harry Guest

    Shane wrote:

    >
    >>>> That's a windows app but I'm sure sourceforge will have similar linux
    >>>> apps
    >>>>
    >>>> Chris
    >>>
    >>> excellent, that has given me a couple of ideas if I can get NetCat to do
    >>> similar I will, else I will have a crack with that one.. Im sure I can
    >>> rustle up a copy of ME somewhere :) Thanks
    >>>
    >>>

    >> I'm sure nc can do it.
    >> It's just basically logging everything.
    >>
    >> Or you could try
    >> wget -o mylog.file -v url://mysecretstuff/ms.asp

    >
    > a bit of work later and I have half of the answer
    > They wanted all FOUR cookies they set
    > BUT......
    > now Im hitting a 500 server error :)
    > this is fun :)
    >
    > thanks for the hint, and best of luck getting RB to engage you in an adult
    > convo ;-)
    >
    >


    As a general rule you should observe what the response to the GET contains.
    If it contains Set-Cookie headers then your app should just cache the
    cookies. Naturally your app also looks up the cookie cache and sends
    any relevent cookie when doing a GET or POST.
     
    Harry, Aug 21, 2005
    #10
  11. Shane

    ChrisOD Guest

    In article <>, Harry wrote:
    > ChrisOD wrote:
    >
    >> In article <-a-geek.net>, Shane
    >> wrote:
    >>> Having a go at making an app that logs into a website, nothing too
    >>> complicated, but.....
    >>> I keep getting a 302 (file temporarily moved)
    >>> heres how I got as far as I have
    >>>
    >>> telnet <someones server> 80
    >>> POST /somestuff/login.asp HTTP/1.1
    >>> Host <someones server>
    >>> Content-Length: 35
    >>>
    >>> name=fred-dagg&password=smellsfunny
    >>>
    >>> HTTP/1.1 200 OK
    >>> Server: Microsoft-IIS/5.0
    >>> Date: Sat, 20 Aug 2005 20:37:27 GMT
    >>> Pragma: no-cache
    >>> Content-Length: 11785
    >>> Content-Type: text/html
    >>> Expires: Sun, 24 Nov 2002 19:37:26 GMT
    >>> Set-Cookie: somestuff; path=/
    >>> Set-Cookie: someother stuff; path=/
    >>> Set-Cookie: yet more stuff; path=/
    >>> Set-Cookie: Session Cookie I need to keep stateful connection; path=/
    >>> Cache-control: no-cache, no-store, no-check, must-revalidate, private
    >>>
    >>> ##so far so good
    >>> ##but when I send
    >>>
    >>> GET /path/to/some/goodies HTTP/1.1
    >>>
    >>>
    >>> ##I get a 302
    >>>
    >>> sometimes this happens because I havent sent a cookie back, sometimes it
    >>> happens before I even get a chance to send the cookie (as above)
    >>> If I send the correct cookie I still get a 302
    >>> but.. if I use firefox or some other browser, the resource exists, at the
    >>> correct path
    >>>
    >>> STUMPED -_-
    >>> any help appreciated
    >>> well almost any
    >>>:)
    >>>

    >> I've had similar problems with some app servers and HTTP conversations.
    >> What has helped me is installing a local proxy server such as:
    >> http://www.tcpiq.com/tcpIQ/ProxyWorkbench/
    >> then point firefox at 127.0.0.1 (as a proxy)
    >> Then the app will log all the conversation.
    >>
    >> That's a windows app but I'm sure sourceforge will have similar linux apps
    >>

    >
    > Much easier just to put your nic in promiscuous mode and use tcpdump.
    > Or even use strace.
    >


    Why Harry would you need promiscuous mode?
    tcpdump will work just fine by itself.
    But you get all the crapola.
    With nc you would just get the http conversation.
     
    ChrisOD, Aug 21, 2005
    #11
  12. Shane

    Harry Guest

    ChrisOD wrote:

    > In article <>, Harry wrote:
    >> ChrisOD wrote:
    >>
    >>> In article <-a-geek.net>, Shane
    >>> wrote:
    >>>> Having a go at making an app that logs into a website, nothing too
    >>>> complicated, but.....
    >>>> I keep getting a 302 (file temporarily moved)
    >>>> heres how I got as far as I have
    >>>>
    >>>> telnet <someones server> 80
    >>>> POST /somestuff/login.asp HTTP/1.1
    >>>> Host <someones server>
    >>>> Content-Length: 35
    >>>>
    >>>> name=fred-dagg&password=smellsfunny
    >>>>
    >>>> HTTP/1.1 200 OK
    >>>> Server: Microsoft-IIS/5.0
    >>>> Date: Sat, 20 Aug 2005 20:37:27 GMT
    >>>> Pragma: no-cache
    >>>> Content-Length: 11785
    >>>> Content-Type: text/html
    >>>> Expires: Sun, 24 Nov 2002 19:37:26 GMT
    >>>> Set-Cookie: somestuff; path=/
    >>>> Set-Cookie: someother stuff; path=/
    >>>> Set-Cookie: yet more stuff; path=/
    >>>> Set-Cookie: Session Cookie I need to keep stateful connection; path=/
    >>>> Cache-control: no-cache, no-store, no-check, must-revalidate, private
    >>>>
    >>>> ##so far so good
    >>>> ##but when I send
    >>>>
    >>>> GET /path/to/some/goodies HTTP/1.1
    >>>>
    >>>>
    >>>> ##I get a 302
    >>>>
    >>>> sometimes this happens because I havent sent a cookie back, sometimes
    >>>> it happens before I even get a chance to send the cookie (as above)
    >>>> If I send the correct cookie I still get a 302
    >>>> but.. if I use firefox or some other browser, the resource exists, at
    >>>> the correct path
    >>>>
    >>>> STUMPED -_-
    >>>> any help appreciated
    >>>> well almost any
    >>>>:)
    >>>>
    >>> I've had similar problems with some app servers and HTTP conversations.
    >>> What has helped me is installing a local proxy server such as:
    >>> http://www.tcpiq.com/tcpIQ/ProxyWorkbench/
    >>> then point firefox at 127.0.0.1 (as a proxy)
    >>> Then the app will log all the conversation.
    >>>
    >>> That's a windows app but I'm sure sourceforge will have similar linux
    >>> apps
    >>>

    >>
    >> Much easier just to put your nic in promiscuous mode and use tcpdump.
    >> Or even use strace.
    >>

    >
    > Why Harry would you need promiscuous mode?
    > tcpdump will work just fine by itself.
    > But you get all the crapola.
    > With nc you would just get the http conversation.


    Tcpdump usually uses promiscuous mode.
    Unless you want it to drop packets.
     
    Harry, Aug 21, 2005
    #12
  13. Shane

    Enkidu Guest

    Shane wrote:
    > On Sun, 21 Aug 2005 16:26:59 +1200, Enkidu wrote:
    >>
    >> You should then parse the 302 response to get the new
    >> location of the page. Do another GET to get the page.
    >> On subsequent requests for the page you should still
    >> first do a GET for the original page.

    >
    > Heh, thats the thing, I get nothing but the error page
    > or got.. as you can see further into the thread I
    > discovered the error was cookie related, and now I get
    > 500's (and Im crossing my fingers Im not
    > breaking anything server side as its not my server)
    >

    The error says that something bad happened in the script
    that you are calling. Probably you are supplying it with
    incorrect paramters or not all the required paramaters.

    How are you making these calls? When you do a GET for a page
    the response consists of the headers and the page itself.
    You need to process the whole response, not just the page
    itself.

    Incidentally, if you were causing 500 errors on one of my
    servers, I'd probably respond by doing something really
    nasty to your connection. Like feed your IP address and/or
    Domain Name to a black-list. Or DDOS you. In the nicest
    possible way of copurse. <grin> Then I'd fix the 500 error.

    In so far as you affecting other users of the server - it's
    unlikely IMO.

    Cheers,

    Cliff

    --

    Barzoomian the Martian - http://barzoomian.blogspot.com
     
    Enkidu, Aug 21, 2005
    #13
  14. Shane

    Enkidu Guest

    Harry wrote:
    > ChrisOD wrote:
    >
    >
    >>In article <>, Harry wrote:
    >>
    >>>ChrisOD wrote:
    >>>
    >>>
    >>>>In article <-a-geek.net>, Shane
    >>>>wrote:
    >>>>
    >>>>>Having a go at making an app that logs into a website, nothing too
    >>>>>complicated, but.....
    >>>>>I keep getting a 302 (file temporarily moved)
    >>>>>heres how I got as far as I have
    >>>>>
    >>>>>telnet <someones server> 80
    >>>>>POST /somestuff/login.asp HTTP/1.1
    >>>>>Host <someones server>
    >>>>>Content-Length: 35
    >>>>>
    >>>>>name=fred-dagg&password=smellsfunny
    >>>>>
    >>>>>HTTP/1.1 200 OK
    >>>>>Server: Microsoft-IIS/5.0
    >>>>>Date: Sat, 20 Aug 2005 20:37:27 GMT
    >>>>>Pragma: no-cache
    >>>>>Content-Length: 11785
    >>>>>Content-Type: text/html
    >>>>>Expires: Sun, 24 Nov 2002 19:37:26 GMT
    >>>>>Set-Cookie: somestuff; path=/
    >>>>>Set-Cookie: someother stuff; path=/
    >>>>>Set-Cookie: yet more stuff; path=/
    >>>>>Set-Cookie: Session Cookie I need to keep stateful connection; path=/
    >>>>>Cache-control: no-cache, no-store, no-check, must-revalidate, private
    >>>>>
    >>>>>##so far so good
    >>>>>##but when I send
    >>>>>
    >>>>>GET /path/to/some/goodies HTTP/1.1
    >>>>>
    >>>>>
    >>>>>##I get a 302
    >>>>>
    >>>>>sometimes this happens because I havent sent a cookie back, sometimes
    >>>>>it happens before I even get a chance to send the cookie (as above)
    >>>>>If I send the correct cookie I still get a 302
    >>>>>but.. if I use firefox or some other browser, the resource exists, at
    >>>>>the correct path
    >>>>>
    >>>>>STUMPED -_-
    >>>>>any help appreciated
    >>>>>well almost any
    >>>>>:)
    >>>>>
    >>>>
    >>>>I've had similar problems with some app servers and HTTP conversations.
    >>>>What has helped me is installing a local proxy server such as:
    >>>>http://www.tcpiq.com/tcpIQ/ProxyWorkbench/
    >>>>then point firefox at 127.0.0.1 (as a proxy)
    >>>>Then the app will log all the conversation.
    >>>>
    >>>>That's a windows app but I'm sure sourceforge will have similar linux
    >>>>apps
    >>>>
    >>>
    >>>Much easier just to put your nic in promiscuous mode and use tcpdump.
    >>>Or even use strace.
    >>>

    >>
    >>Why Harry would you need promiscuous mode?
    >>tcpdump will work just fine by itself.
    >>But you get all the crapola.
    >>With nc you would just get the http conversation.

    >
    > Tcpdump usually uses promiscuous mode.
    > Unless you want it to drop packets.
    >

    Tcpdump only uses promiscuous mode to listen to all traffic
    on an ethernet. If you are only interested in traffic to and
    from your NIC registered IP address, you don't need
    promiscuous mode.

    Cheers,

    Cliff

    --

    Barzoomian the Martian - http://barzoomian.blogspot.com
     
    Enkidu, Aug 21, 2005
    #14
  15. Shane

    Harry Guest

    Enkidu wrote:

    > Shane wrote:
    >> On Sun, 21 Aug 2005 16:26:59 +1200, Enkidu wrote:
    >>>
    >>> You should then parse the 302 response to get the new
    > >> location of the page. Do another GET to get the page.
    > >> On subsequent requests for the page you should still
    > >> first do a GET for the original page.

    >>
    >> Heh, thats the thing, I get nothing but the error page
    >> or got.. as you can see further into the thread I
    > > discovered the error was cookie related, and now I get
    > > 500's (and Im crossing my fingers Im not
    >> breaking anything server side as its not my server)
    >>

    > The error says that something bad happened in the script
    > that you are calling. Probably you are supplying it with
    > incorrect paramters or not all the required paramaters.


    No kidding!

    >
    > How are you making these calls? When you do a GET for a page
    > the response consists of the headers and the page itself.
    > You need to process the whole response, not just the page
    > itself.
    >
    > Incidentally, if you were causing 500 errors on one of my
    > servers, I'd probably respond by doing something really
    > nasty to your connection. Like feed your IP address and/or
    > Domain Name to a black-list. Or DDOS you. In the nicest
    > possible way of copurse. <grin> Then I'd fix the 500 error.
    >


    You must lead a lonely existence.

    > In so far as you affecting other users of the server - it's
    > unlikely IMO.


    How does an error affect other users?
     
    Harry, Aug 21, 2005
    #15
  16. Shane

    Harry Guest

    Enkidu wrote:

    > Harry wrote:
    >> ChrisOD wrote:
    >>
    >>
    >>>In article <>, Harry wrote:
    >>>
    >>>>ChrisOD wrote:
    >>>>
    >>>>
    >>>>>In article <-a-geek.net>, Shane
    >>>>>wrote:
    >>>>>
    >>>>>>Having a go at making an app that logs into a website, nothing too
    >>>>>>complicated, but.....
    >>>>>>I keep getting a 302 (file temporarily moved)
    >>>>>>heres how I got as far as I have
    >>>>>>
    >>>>>>telnet <someones server> 80
    >>>>>>POST /somestuff/login.asp HTTP/1.1
    >>>>>>Host <someones server>
    >>>>>>Content-Length: 35
    >>>>>>
    >>>>>>name=fred-dagg&password=smellsfunny
    >>>>>>
    >>>>>>HTTP/1.1 200 OK
    >>>>>>Server: Microsoft-IIS/5.0
    >>>>>>Date: Sat, 20 Aug 2005 20:37:27 GMT
    >>>>>>Pragma: no-cache
    >>>>>>Content-Length: 11785
    >>>>>>Content-Type: text/html
    >>>>>>Expires: Sun, 24 Nov 2002 19:37:26 GMT
    >>>>>>Set-Cookie: somestuff; path=/
    >>>>>>Set-Cookie: someother stuff; path=/
    >>>>>>Set-Cookie: yet more stuff; path=/
    >>>>>>Set-Cookie: Session Cookie I need to keep stateful connection; path=/
    >>>>>>Cache-control: no-cache, no-store, no-check, must-revalidate, private
    >>>>>>
    >>>>>>##so far so good
    >>>>>>##but when I send
    >>>>>>
    >>>>>>GET /path/to/some/goodies HTTP/1.1
    >>>>>>
    >>>>>>
    >>>>>>##I get a 302
    >>>>>>
    >>>>>>sometimes this happens because I havent sent a cookie back, sometimes
    >>>>>>it happens before I even get a chance to send the cookie (as above)
    >>>>>>If I send the correct cookie I still get a 302
    >>>>>>but.. if I use firefox or some other browser, the resource exists, at
    >>>>>>the correct path
    >>>>>>
    >>>>>>STUMPED -_-
    >>>>>>any help appreciated
    >>>>>>well almost any
    >>>>>>:)
    >>>>>>
    >>>>>
    >>>>>I've had similar problems with some app servers and HTTP conversations.
    >>>>>What has helped me is installing a local proxy server such as:
    >>>>>http://www.tcpiq.com/tcpIQ/ProxyWorkbench/
    >>>>>then point firefox at 127.0.0.1 (as a proxy)
    >>>>>Then the app will log all the conversation.
    >>>>>
    >>>>>That's a windows app but I'm sure sourceforge will have similar linux
    >>>>>apps
    >>>>>
    >>>>
    >>>>Much easier just to put your nic in promiscuous mode and use tcpdump.
    >>>>Or even use strace.
    >>>>
    >>>
    >>>Why Harry would you need promiscuous mode?
    >>>tcpdump will work just fine by itself.
    >>>But you get all the crapola.
    >>>With nc you would just get the http conversation.

    >>
    >> Tcpdump usually uses promiscuous mode.
    >> Unless you want it to drop packets.
    >>

    > Tcpdump only uses promiscuous mode to listen to all traffic
    > on an ethernet. If you are only interested in traffic to and
    > from your NIC registered IP address, you don't need
    > promiscuous mode.


    Perhaps you should tell tcpdump about this useless piece of info.
     
    Harry, Aug 21, 2005
    #16
  17. In article <>,
    Harry <> wrote:

    >Enkidu wrote:
    >
    >> Tcpdump only uses promiscuous mode to listen to all traffic
    >> on an ethernet. If you are only interested in traffic to and
    >> from your NIC registered IP address, you don't need
    >> promiscuous mode.

    >
    >Perhaps you should tell tcpdump about this useless piece of info.


    Checking the tcpdump man page on my Linux box, it only seems to require
    promiscuous mode under Solaris. There's no warning about requiring it in
    the Linux section.
     
    Lawrence D'Oliveiro, Aug 22, 2005
    #17
  18. Shane

    Enkidu Guest

    Harry wrote:
    > Enkidu wrote:
    >
    >
    >>Harry wrote:
    >>
    >>>ChrisOD wrote:
    >>>
    >>>
    >>>
    >>>>In article <>, Harry wrote:
    >>>>
    >>>>
    >>>>>ChrisOD wrote:
    >>>>>
    >>>>>
    >>>>>
    >>>>>>In article <-a-geek.net>, Shane
    >>>>>>wrote:
    >>>>>>
    >>>>>>
    >>>>>>>Having a go at making an app that logs into a website, nothing too
    >>>>>>>complicated, but.....
    >>>>>>>I keep getting a 302 (file temporarily moved)
    >>>>>>>heres how I got as far as I have
    >>>>>>>
    >>>>>>>telnet <someones server> 80
    >>>>>>>POST /somestuff/login.asp HTTP/1.1
    >>>>>>>Host <someones server>
    >>>>>>>Content-Length: 35
    >>>>>>>
    >>>>>>>name=fred-dagg&password=smellsfunny
    >>>>>>>
    >>>>>>>HTTP/1.1 200 OK
    >>>>>>>Server: Microsoft-IIS/5.0
    >>>>>>>Date: Sat, 20 Aug 2005 20:37:27 GMT
    >>>>>>>Pragma: no-cache
    >>>>>>>Content-Length: 11785
    >>>>>>>Content-Type: text/html
    >>>>>>>Expires: Sun, 24 Nov 2002 19:37:26 GMT
    >>>>>>>Set-Cookie: somestuff; path=/
    >>>>>>>Set-Cookie: someother stuff; path=/
    >>>>>>>Set-Cookie: yet more stuff; path=/
    >>>>>>>Set-Cookie: Session Cookie I need to keep stateful connection; path=/
    >>>>>>>Cache-control: no-cache, no-store, no-check, must-revalidate, private
    >>>>>>>
    >>>>>>>##so far so good
    >>>>>>>##but when I send
    >>>>>>>
    >>>>>>>GET /path/to/some/goodies HTTP/1.1
    >>>>>>>
    >>>>>>>
    >>>>>>>##I get a 302
    >>>>>>>
    >>>>>>>sometimes this happens because I havent sent a cookie back, sometimes
    >>>>>>>it happens before I even get a chance to send the cookie (as above)
    >>>>>>>If I send the correct cookie I still get a 302
    >>>>>>>but.. if I use firefox or some other browser, the resource exists, at
    >>>>>>>the correct path
    >>>>>>>
    >>>>>>>STUMPED -_-
    >>>>>>>any help appreciated
    >>>>>>>well almost any
    >>>>>>>:)
    >>>>>>>
    >>>>>>
    >>>>>>I've had similar problems with some app servers and HTTP conversations.
    >>>>>>What has helped me is installing a local proxy server such as:
    >>>>>>http://www.tcpiq.com/tcpIQ/ProxyWorkbench/
    >>>>>>then point firefox at 127.0.0.1 (as a proxy)
    >>>>>>Then the app will log all the conversation.
    >>>>>>
    >>>>>>That's a windows app but I'm sure sourceforge will have similar linux
    >>>>>>apps
    >>>>>>
    >>>>>
    >>>>>Much easier just to put your nic in promiscuous mode and use tcpdump.
    >>>>>Or even use strace.
    >>>>>
    >>>>
    >>>>Why Harry would you need promiscuous mode?
    >>>>tcpdump will work just fine by itself.
    >>>>But you get all the crapola.
    >>>>With nc you would just get the http conversation.
    >>>
    >>>Tcpdump usually uses promiscuous mode.
    >>>Unless you want it to drop packets.
    >>>

    >>
    >>Tcpdump only uses promiscuous mode to listen to all traffic
    >>on an ethernet. If you are only interested in traffic to and
    >>from your NIC registered IP address, you don't need
    >>promiscuous mode.

    >
    > Perhaps you should tell tcpdump about this useless piece of info.
    >

    Some NICs ignore the request to be put into promiscuous
    mode. Most switches do not broadcast packets to all ports -
    they will only connect one port to another, so promiscuous
    mode is useless. In most cases promiscuous mode is as useful
    as an appendix is to you or I.

    Cheers,

    Cliff

    --

    Barzoomian the Martian - http://barzoomian.blogspot.com
     
    Enkidu, Aug 22, 2005
    #18
  19. Shane

    Enkidu Guest

    Harry wrote:
    > Enkidu wrote:
    >
    >
    >>Shane wrote:
    >>
    >>>On Sun, 21 Aug 2005 16:26:59 +1200, Enkidu wrote:
    >>>
    >>>>You should then parse the 302 response to get the new

    >>
    >> >> location of the page. Do another GET to get the page.
    >> >> On subsequent requests for the page you should still
    >> >> first do a GET for the original page.

    >>
    >>>Heh, thats the thing, I get nothing but the error page
    >>>or got.. as you can see further into the thread I

    >>
    >> > discovered the error was cookie related, and now I get
    >> > 500's (and Im crossing my fingers Im not

    >>
    >>>breaking anything server side as its not my server)
    >>>

    >>
    >>The error says that something bad happened in the script
    >>that you are calling. Probably you are supplying it with
    >>incorrect paramters or not all the required paramaters.

    >
    > No kidding!
    >
    >>How are you making these calls? When you do a GET for a page
    >>the response consists of the headers and the page itself.
    >>You need to process the whole response, not just the page
    >>itself.
    >>
    >>Incidentally, if you were causing 500 errors on one of my
    >>servers, I'd probably respond by doing something really
    >>nasty to your connection. Like feed your IP address and/or
    >>Domain Name to a black-list. Or DDOS you. In the nicest
    >>possible way of copurse. <grin> Then I'd fix the 500 error.

    >
    > You must lead a lonely existence.
    >
    >>In so far as you affecting other users of the server - it's
    >>unlikely IMO.

    >
    > How does an error affect other users?
    >

    Well, apart from anything else it could reserve resources
    and not free them on error, eventually crashing the machine.

    Cheers,

    Cliff

    --

    Barzoomian the Martian - http://barzoomian.blogspot.com
     
    Enkidu, Aug 22, 2005
    #19
  20. Shane

    Harry Guest

    Enkidu wrote:

    > Harry wrote:
    >> Enkidu wrote:
    >>
    >>
    >>>Shane wrote:
    >>>
    >>>>On Sun, 21 Aug 2005 16:26:59 +1200, Enkidu wrote:
    >>>>
    >>>>>You should then parse the 302 response to get the new
    >>>
    >>> >> location of the page. Do another GET to get the page.
    >>> >> On subsequent requests for the page you should still
    >>> >> first do a GET for the original page.
    >>>
    >>>>Heh, thats the thing, I get nothing but the error page
    >>>>or got.. as you can see further into the thread I
    >>>
    >>> > discovered the error was cookie related, and now I get
    >>> > 500's (and Im crossing my fingers Im not
    >>>
    >>>>breaking anything server side as its not my server)
    >>>>
    >>>
    >>>The error says that something bad happened in the script
    >>>that you are calling. Probably you are supplying it with
    >>>incorrect paramters or not all the required paramaters.

    >>
    >> No kidding!
    >>
    >>>How are you making these calls? When you do a GET for a page
    >>>the response consists of the headers and the page itself.
    >>>You need to process the whole response, not just the page
    >>>itself.
    >>>
    >>>Incidentally, if you were causing 500 errors on one of my
    >>>servers, I'd probably respond by doing something really
    >>>nasty to your connection. Like feed your IP address and/or
    >>>Domain Name to a black-list. Or DDOS you. In the nicest
    >>>possible way of copurse. <grin> Then I'd fix the 500 error.

    >>
    >> You must lead a lonely existence.
    >>
    >>>In so far as you affecting other users of the server - it's
    >>>unlikely IMO.

    >>
    >> How does an error affect other users?
    >>

    > Well, apart from anything else it could reserve resources
    > and not free them on error, eventually crashing the machine.
    >


    Oh? So you are talking about MS servers?
    Doesn't surprise me because the first time I encountered and
    tested IIS I discovered that it would miss requests because it
    only parsed the first part of a TCP packet and disarded the rest.
    Hardly the sort of quality one would expect from a wealthy company.

    Have you any evidence for your outlandish claim?
     
    Harry, Aug 22, 2005
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. geewhiz

    How to copy email headers Moz 1.5

    geewhiz, Nov 5, 2003, in forum: Firefox
    Replies:
    17
    Views:
    769
    dantu
    Nov 7, 2003
  2. Andy Low

    HTTP Headers

    Andy Low, May 20, 2004, in forum: Cisco
    Replies:
    1
    Views:
    473
    AnyBody43
    May 20, 2004
  3. a.nonny mouse
    Replies:
    2
    Views:
    1,121
  4. Scott
    Replies:
    1
    Views:
    8,891
    ScottF
    Aug 4, 2004
  5. milan_9211

    HTTP SOAP/HTTP GET/HTTP POST

    milan_9211, Jan 10, 2011, in forum: Software
    Replies:
    0
    Views:
    3,133
    milan_9211
    Jan 10, 2011
Loading...

Share This Page