Connexion a un forum grace a winsock...

joker888 Messages postés 38 Date d'inscription mardi 9 juillet 2002 Statut Membre Dernière intervention 23 août 2005 - 23 août 2005 à 22:39
Zlub Messages postés 809 Date d'inscription mercredi 11 octobre 2000 Statut Membre Dernière intervention 29 septembre 2010 - 24 août 2005 à 00:11
bonjour, je souhaite faire un petit programme en relation avec un forum, mais sur ce programme j'essay de me loguer.
J'ai sniffer les packet HTTP et je sais exactement ce que je doit envoyer, mais le probleme est que je ne me connecte pas au forum, au lieu de me renvoyer un HTTP 302, il me met un HTTP 200 et me renvoi sur une page me disant que je ne suis pas connecté...

Le forum est un phpBB et je pense que c'est du aux cookies, si quelqu'un pourrait m'aider, merci :)

Pour infos les requettes HTTP

Etape1 : Je lance une demande de page pour recuperer un SID :
GET /portal.php HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */*
Referer:
http://www.google.fr
Accept -Language: fr
Accept -Encoding: gzip , deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; FDM)
Host: hostduforum.com
Connection: Keep -Alive

Je recupere le SID et les cookies et j'envoi ca :

POST /login.php?sid=MONSIDRECUPERE HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */*
Referer: http://www.hostduforum.com/portal.php
Accept-Language: fr
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; FDM)
Host: oi.is.fun.free.fr
Content-Length: 109
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: MESCOOKIES


redirect=portal.php%3Fsid%3DMONSIDRECUPERE&username=LOGIN&password=PASSWORD&login=Connexion

Normalement il doit me retourner ca :


HTTP/1.1 302
Date: Tue, 23 Aug 2005 18:08:38 GMT
Server: Apache/ProXad [Aug 10 2005 14:04:53]
X-Powered-By: PHP/4.3.10
Set-Cookie: ...
Set-Cookie: ...
Location: URL DE REDIRECTION
Connection: close
Content-Type: text/html

Mais je recois une autre requette qui est :


HTTP/1.1 200 OK
Date: Tue, 23 Aug 2005 20:36:26 GMT
Server: Apache/ProXad [Aug 10 2005 14:04:53]
Cache-Control: private, pre-check=0, post-check=0, max-age=0
Expires: 0
Pragma: no-cache
X-Powered-By: PHP/4.3.10
Connection: close
Content-Type: text/html

Merci d'avance!!!!!!

1 réponse

Zlub Messages postés 809 Date d'inscription mercredi 11 octobre 2000 Statut Membre Dernière intervention 29 septembre 2010 8
24 août 2005 à 00:11
Salut,

Ah mon avis tu post pas au bon endroit ... essai de voir sur http://www.phpcs.com


++

Zlub
0
Rejoignez-nous