Jump to content

curl captcha login


ntesla123

Recommended Posts

I'm trying to login to a vBulletin forum using a captcha login. I am, however, not able to download the captcha image.

 

This is the result I get when I try to get the captcha:

 

form.jpg

 

So how do I get the captcha image?

 

This is my current login code:

 

<?php
$user='username';
$pass='password';
$md5Pass = md5($pass);
$data = "do=login&vb_login_md5password=$md5Pass&vb_login_md5password_utf=$md5Pass&vb_login_username=$user&cookieuser=1";

$ch = curl_init();

curl_setopt ($ch, CURLOPT_URL, "http://www.****.com/login.php?do=login");
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
curl_setopt ($ch, CURLOPT_TIMEOUT, '10');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch,CURLOPT_POSTFIELDS,$data);
curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie.txt");
curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);

$store = curl_exec ($ch);
curl_close($ch);
echo $store;
?> 

 

Maybe the site looks for a cookie and only shows the captcha if it finds the cookie file?

Link to comment
https://forums.phpfreaks.com/topic/231901-curl-captcha-login/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.