Jump to content

help in captcha submitting


neel_143

Recommended Posts

here is two php pages in which in 1st page i retrieve captcha and submit
and in 2nd page it sends to a url n only then i can login to that site
the problem is that i retrieve captcha successfully
but cant connect to 2nd page
its totally lost the cookie or session n run separately and eventually i failed to login

 

cap.php-

<?php

set_time_limit(0);

$cookie = 'c:/xampp/htdocs/img/cookie.txt';

$agent = "Opera/9.80 (J2ME/MIDP; Opera Mini/7.1.32052/34.1697; U; en) Presto/2.8.119 Version/11.10";

$uid = $_REQUEST['uid'];
$pwd = $_REQUEST['pwd'];

$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,"http://ultoo.com/login.php");
curl_setopt($ch, CURLOPT_TIMEOUT, 0);
curl_setopt($ch,CURLOPT_COOKIEJAR,$cookie);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);

curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch,CURLOPT_REFERER,"http://ultoo.com/login.php");
$one=curl_exec($ch);

preg_match_all("/document.getElementById(.*?).value/",$one,$us);
$user = $us[1][10];

$user = str_replace('(', '', $user);
$user = str_replace(')', '', $user);
$user = str_replace("'", '', $user);

//die("<font color='red'><b>".$user."</b></font>");
flush();

$pass = $us[1][9];

$pass = str_replace('(', '', $pass);
$pass = str_replace(')', '', $pass);
$pass = str_replace("'", '', $pass);


$data1 = "$user=$uid&$pass=$pwd&RememberMe=1";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"http://ultoo.com/login.php");
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Content-Type: application/x-www-form-urlencoded","Accept: */*"));
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_REFERER, "http://ultoo.com/login.php");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,"$data1");


$ct = curl_exec( $ch );

if(stristr($ct,"number & password"))
{
echo "<font color='red'><b>Invalid U/P</b></font>";
}
else
{

if(stristr($ct,"secure.php"))
{
curl_setopt($ch, CURLOPT_URL,"http://ultoo.com/secure.php?zxcoiesesscd=");
curl_setopt( $ch, CURLOPT_USERAGENT, $agent );
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_AUTOREFERER, true);

$ct=curl_exec($ch);


preg_match_all("/document.getElementById(.*?).value/",$ct,$mbll);
$mbl = $mbll[1][5];

$mbl = str_replace('(', '', $mbl);
$mbl = str_replace(')', '', $mbl);
$mbl = str_replace("'", '', $mbl);

//die("<font color='red'><b>".$mbl."</b></font>");
flush();

$url = "http://ultoo.com/captcha.php";
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_AUTOREFERER, 1);
//curl_setopt($ch, CURLOPT_POST, 1);

$html=curl_exec($ch);
curl_close($ch);

$name = "img/".rand(1,99999).".png";
$myFile = $name;
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = $html;
fwrite($fh, $stringData);
fclose($fh);
}
}
?>
<center>
<img src=<?php
echo $name; ?>><br>
<form method=post action="play.php">
<input type=text name=c>
<input type=hidden name=img value=<?php
echo $name; ?>>
<?php

echo '<input type="hidden" name="mbl" value="'.$mbl.'">';

?>
<input type=submit name="submit" value=Earn>

 

and

play.php-
 

<?php
set_time_limit(0);

error_reporting(0);

$cookie = 'c:/xampp/htdocs/img/cookie.txt';


$c = $_REQUEST["c"];

$mbl = $_REQUEST["mbl"];

$agent = "Opera/9.80 (J2ME/MIDP; Opera Mini/7.1.32052/34.1697; U; en) Presto/2.8.119 Version/11.10";

$ch = curl_init();

$post_data2 = "$mbl=nlp&captcha=$c&loginButton=LOGIN";


curl_setopt($ch, CURLOPT_URL,"http://ultoo.com/secure.php");
curl_setopt ($ch, CURLOPT_HTTPHEADER, Array("Content-Type: application/x-www-form-urlencoded","Accept: */*"));
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data2);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_REFERER, "http://ultoo.com/login.php");


$dt = curl_exec($ch);
if(!stristr($dt,"mywallet.php"))
{
die("<font color='red'><b>Wrong Captcha.</b></font>");
flush();
}

?>

can any one give me a perfect solution to this?
i will b thankful to him for lifetime :)

Edited by neel_143
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.