cURL / Mailing Lists / curl-users / Single Mail


Hash & redirect, try to work with cURL like web browser behaviour

From: Florian Bidabé <>
Date: Sat, 14 Mar 2009 19:42:43 +0100


I'm a young network administrator (I've finished my studies many months ago)

 I've discovered cURL few weeks ago, and I am impassioned about it, it's incredible what this light program is able to do.

In fact, I've progressed a lot (using and mastering different parameters) but I discover regularly different problems.

By example:

à CAPCHAR, but I don't think that's possible to break it, or jump it (or maybe with a POST ASCII/binary php injection ?!)

à Hash generation by server et recovering (or keeping back) by cURL

à Redirect web page


I've aggravating problems with these two last

The server send me a webpage with a relative redirect URL (and not absolute), and I don't know how I can do in order to automatically launch the server web page result with cURL :


I type :

Curl -d "var1=value1&var2=value2&var3=value3"


Server answer :

HTTP/1.1 200 OK

Date: Sat, 14 Mar 2009 04:48:47 GMT

Server: Apache/2.2.4 (Unix) mod_ssl/2.2.4 OpenSSL/0.9.7a PHP/4.3.8

X-Powered-By: PHP/5.2.1

Expires: Thu, 19 Nov 1981 08:52:00 GMT

Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0

Pragma: no-cache

Set-Cookie: PHPSESSID=4985d403c4c8b7b2240e7c32ae33455d; path=/; domain=.yrd-webapp

Connection: close

Content-Type: text/html


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">


<html xmlns="">


                               <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />


                               <meta http-equiv="Refresh" content="0;URL=confirmation.htm?subscriber=new&hash=85d8a419534cbe07fa9bd7a63ebd6f7243ac4d30" />






GET /fs/webapv2/fr/confirmation.htm?subscriber=new&hash=85d8a419534cbe07fa9bd7a63ebd6f7243ac4d30 HTTP/1.0

Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/, application/msword, */*


Accept-Language: fr

User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)


Proxy-Connection: Keep-Alive

Pragma: no-cache




So I can save the result as a file and manually read it, I can recover the hash code and re create a absolute URL (the domain web site)


So manually, I can launch the correct URL (with GET option) with cURL but not automatically, and it's what I would like to do.


Is it possible please ? I really want to learn how doing this.

Thx a lot



List admin:
Received on 2009-03-14