cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: curl-users Digest, Vol 55, Issue 12

From: Marc Freimann <MSBSSK_at_gmx.de>
Date: Wed, 17 Mar 2010 12:46:20 +0100

Hello,

I think there are not enough information in my description:

I want to set the tcp push flag for the packets which curl create to download a file.

Regards,
-----------------------------------------------------------------
Marcus Schmitt - Customer Support Engineer - Web Security Appliances
IronPort Systems - A Cisco Business Unit

-------- Original-Nachricht --------
> Datum: Wed, 17 Mar 2010 12:00:02 +0100
> Von: curl-users-request_at_cool.haxx.se
> An: curl-users_at_cool.haxx.se
> Betreff: curl-users Digest, Vol 55, Issue 12

> Send curl-users mailing list submissions to
> curl-users_at_cool.haxx.se
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
> or, via email, send a message with subject or body 'help' to
> curl-users-request_at_cool.haxx.se
>
> You can reach the person managing the list at
> curl-users-owner_at_cool.haxx.se
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of curl-users digest..."
>
>
> Today's Topics:
>
> 1. Re: Posting with an automatic hidden post (Demetrius Michael)
> 2. Re: Posting with an automatic hidden post (Ralph Mitchell)
> 3. PUSH Flag when Download (Marc Freimann)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 16 Mar 2010 15:27:52 -0400
> From: Demetrius Michael <dem_z_at_mac.com>
> To: curl-users_at_cool.haxx.se
> Subject: Re: Posting with an automatic hidden post
> Message-ID: <3B87FC66-2833-46CD-9F13-3432260C9785_at_mac.com>
> Content-Type: text/plain; charset="us-ascii"
>
> Sorry for top posting, it's just the entire thread's been top posted. I
> also would like to know the answer for this.
>
> Because I'm very, very stuck.
>
> I have a phpbb forum, and every day I post the same material (the actual
> content changes, but the routine to get the content is the same).
> I've computerized the routine; now I'm trying computerize the login >
> start thread > post > log out bit.
>
> To login is easy, the session id is jammed into the cookie. Anything w/
> posting has a lot of hidden variables though.
>
> So what I've done is this:
>
> 1. $ curl - b cookies.txt - c cookies.txt URLTOPOST > savedfile1
> 2. parse the save file for hidden forms (in this case the fields turned
> out to be: "topic_cur_post_id=24718", "lastclick=1268762819",
> "creation_time=1268762819", "form_token=11d7810297885073332758c13ca11de86af52cc1")
> 3. Reformat for next curl command.
> 4. $ curl -b cookies.txt -c cookies.txt -F 'post=Submit' -F 'message=
> this is my test message ' -F 'disable_bbcode=0' -F 'disable_smilies=0' -F
> 'attach_sig=1' -F 'topictype=0'-F 'topic_cur_post_id=24718'-F
> 'lastclick=1268762819'-F 'creation_time=1268762819'-F
> 'form_token=11d7810297885073332758c13ca11de86af52cc1' URLTOPOST > savedfile2
>
> Ran #4, and the forum barked The submitted form was invalid. Try
> submitting again.
>
> When looking at the source code, the hidden variables changed!
> ("topic_cur_post_id=24718", "lastclick=1268762820", "creation_time=1268762821",
> "form_token=2d4945d0c0e392d41240935848d6e9780726108d")
>
> Is there any way for curl to get the content, without killing the session,
> then POST after I've parsed for the hidden variables? Because in this
> case, it seems I get the content twice (giving me two different hidden
> fields).... Or let me rephrase, is it possible to parse for those known hidden
> fields w/i the first command line?
>
> I appreciate any help!
>
> Demetrius.
>
>
> > From: Colleen R. Dick <platypus_at_proaxis.com>
> > Date: Tue, 03 Feb 2009 23:23:54 -0800
> > think about when a human does this. He goes to the URL and the key is
> > generated for him and he never knows about it. He just fills in the
> > visible part of the form and press submit. Presumably the data is
> > posted back to the same URL that made the form? The script processing
> > for that URL has to be able to detect whether data are being posted or
> > not. If data are being posted it is going to process them (presumably
> > what you want) and maybe return a new form or maybe not but you dont
> > care because you already got it to process your data. If you are doing
> > an automatic script you don't need to output anything, just figure out
> > what you want to post back and post it along with the scraped key. If
> > you are creating something for a human you need to make a proxy form
> > with the data fields you want him to type but no key. Then he submits
> > that to your script and in your processing you forward it all with the
> > scraped key back to the third party site. You may or may not be
> > successful depends on how the key is checked on their end. I know this
> > works because I wrote hacks for linkpoint gateway by scraping javascript
> > keys out of an outer frame and using them.
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> <http://cool.haxx.se/pipermail/curl-users/attachments/20100316/365fc32f/attachment.htm>
>
> ------------------------------
>
> Message: 2
> Date: Tue, 16 Mar 2010 20:26:28 -0400
> From: Ralph Mitchell <ralphmitchell_at_gmail.com>
> To: the curl tool <curl-users_at_cool.haxx.se>
> Subject: Re: Posting with an automatic hidden post
> Message-ID:
> <997a524e1003161726p2a934cb7n757f277371f1fa82_at_mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> On Tue, Mar 16, 2010 at 3:27 PM, Demetrius Michael <dem_z_at_mac.com> wrote:
>
> > Sorry for top posting, it's just the entire thread's been top posted. I
> > also would like to know the answer for this.
> >
> > Because I'm very, *very* stuck.
> >
> > I have a phpbb forum, and every day I post the same material (the actual
> > content changes, but the routine to get the content is the same).
> > I've computerized the routine; now I'm trying computerize the* login >
> > start thread > post > log ou*t bit.
> >
> > To login is easy, the session id is jammed into the cookie. Anything w/
> > posting has a lot of hidden variables though.
> >
> > So what I've done is this:
> >
> > 1. $ curl - b cookies.txt - c cookies.txt URLTOPOST > savedfile1
> > 2. parse the save file for hidden forms (in this case the fields turned
> out
> > to be: "*topic_cur_post_id=24718", "lastclick=1268762819",
> > "creation_time=1268762819",
> > "form_token=11d7810297885073332758c13ca11de86af52cc1"*)
> > 3. Reformat for next curl command.
> > 4. $ curl -b cookies.txt -c cookies.txt -F 'post=Submit' -F 'message=
> > this is my test message ' -F 'disable_bbcode=0' -F 'disable_smilies=0'
> -F
> > 'attach_sig=1' -F 'topictype=0'-F 'topic_cur_post_id=24718'-F
> > 'lastclick=1268762819'-F 'creation_time=1268762819'-F
> > 'form_token=11d7810297885073332758c13ca11de86af52cc1' URLTOPOST >
> savedfile2
> >
> > Ran #4, and the forum barked *The submitted form was invalid. Try
> > submitting again. *
> >
> > When looking at the source code, the hidden variables changed!
> > ("topic_cur_post_id=24718", "lastclick=1268762820",
> > "creation_time=1268762821",
> "form_token=2d4945d0c0e392d41240935848d6e9780726108d")
> >
> > Is there any way for curl to get the content, without killing the
> session,
> > then POST after I've parsed for the hidden variables? Because in this
> case,
> > it seems I get the content twice (giving me two different hidden
> fields)....
> > Or let me rephrase, is it possible to parse for those known hidden
> fields
> > w/i the first command line?
> >
>
> Do you really need to do that kind of form post?? I've screen-scraped a
> lot
> of web pages, including logging into 3 major travel sites to check flights
> and car rental availability, and I've never used the "-F" option.
>
> I think the server isn't recognising what you're posting, or there's
> something missing, so the server generates a new page so you can have
> another go. For example, creation_time is the time in
> seconds-since-the-epoch. Presumably that's when the page was generated to
> send to you. It'll have a new value every time. And last_click is one
> second earlier, which I guess records the time the server thinks you
> clicked
> the link.
>
> I would do the post like this:
>
> curl -b cookies.txt -c cookies.txt \
> -d 'post=Submit' \
> --data-urlencode 'message= this is my test message ' \
> -d 'disable_bbcode=0' \
> -d 'disable_smilies=0' \
> -d 'attach_sig=1' \
> -d 'topictype=0' \
> -d 'topic_cur_post_id=24718' \
> -d 'lastclick=1268762819' \
> -d 'creation_time=1268762819' \
> -d 'form_token=11d7810297885073332758c13ca11de86af52cc1' \
> URLTOPOST > savedfile2
>
> Do you have access to the server's log to see what error messages it might
> be recording??
>
> Ralph Mitchell
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> <http://cool.haxx.se/pipermail/curl-users/attachments/20100316/56462ff6/attachment.htm>
>
> ------------------------------
>
> Message: 3
> Date: Wed, 17 Mar 2010 10:18:21 +0100
> From: "Marc Freimann" <MSBSSK_at_gmx.de>
> To: curl-users_at_cool.haxx.se
> Subject: PUSH Flag when Download
> Message-ID: <20100317091821.136960_at_gmx.net>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hello,
>
> I have to check a problem with a loadbalancer. For this test it is
> necessary use curl for download this file. It is also needed for the file-download
> over curl that curl set the push flag when download the files.
>
> Is there a option or a special setting to do this ?
>
>
> Regards Marc
> --
> GMX DSL: Internet, Telefon und Entertainment f?r nur 19,99 EUR/mtl.!
> http://portal.gmx.net/de/go/dsl02
>
>
> ------------------------------
>
> _______________________________________________
> curl-users mailing list
> curl-users_at_cool.haxx.se
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
>
>
> End of curl-users Digest, Vol 55, Issue 12
> ******************************************

-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2010-03-17