Jump to content

[SOLVED] cURL


supermerc

Recommended Posts

Hey

 

Ive tried countless things, I read up on cURL and im still not able to do what I wanted with cURL.

 

Im logging in to a website / game call outwar using cURL, and I have no problem at that point, but the page i want to go to crew_vault.php is protected by a security word, so when you go to crew_vault.php it bring you to security_prompt.php to answer your security question, once you submit it brings you to crew_vault.php.

 

For some reason it wont post the variables, which are

 

prompt_number=12

answer=myanswer

security_submitted=Continue

 

<form method="post" action="security_prompt.php">

			<input type="hidden" name="prompt_number" value="12" />
							What is your favorite movie?<br>
<input type="password" name="answer" value="" size="20" maxlength="30"> <br />
			<input type="submit" value="Continue" name="security_submitted" />
		</form>

 

Now this is the code I currently have, what it does is simply brings me to security_prompt.php and does nothing for all i know.

 

<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://quiver.outwar.com/myaccount.php');
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, 'login_username=username&login_password=pass');
curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, 'http://quiver.outwar.com/security_prompt.php?suid=55726&serverid=6');
$store = curl_exec ($ch);
curl_setopt($ch, CURLOPT_URL, 'http://quiver.outwar.com/security_prompt.php');
    curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, 'prompt_number=12&answer=answer&security_submitted=Continue');
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$result1 = curl_exec($ch);
echo strip_tags($result1);

curl_close ($ch);

?>

 

If anyone could help me i've been messing around this for days!

Link to comment
Share on other sites

as far as i know even if u do 2 curl_exec one after another they will not be as good as hitting one page after another. PHP is stateless....

 

you will have to try something like Snoopy class..it is a browser simulator , but i m not sure how elegantly it works !!

 

Google for Snoopy.class.php

Link to comment
Share on other sites

From what I understand I think I need to get it installed by my host and thats not an option, however I dont see why cURL couldnt do this job, if someone is experienced with curl and would like me to send them the info to the game so they can try for themselves please dont hesitate!

Link to comment
Share on other sites

as far as i know even if u do 2 curl_exec one after another they will not be as good as hitting one page after another. PHP is stateless....

 

The reason why I put 2 one after the other is because the logging in brings you to your account where you can manage all your character, but to go on the site you must select a character, which is what im doing by adding suid=55726&serverid=6 ad the end of one of them.

Link to comment
Share on other sites

1) Firing 2 CURL requests back to back doesnt mean that it is hitting both pages one after another. It executes as if 2 differnet users are trying to open these pages in 2 different browsers. u need to login to open second page, so it will not work.

 

2) u dont need to isntall snoopy, u can just download and include it. it is a PHP class.

Link to comment
Share on other sites

You know why this has gone unsolved? (Sorry I am just tired of it being bumped).

 

A, we cannot login to that site to see what you are even talking about without being very proactive and creating an account (which I do not care to do).

 

B, the security question, if it is an image and it is like a Captcha, you would need OCR technology to even begin to break that.

 

C, If it is not, then essentially it should work, why it is not I really do not know as we cannot really view that site to see what is happening.

 

Figured I would let you know why no one was responding.

Link to comment
Share on other sites

Ok then, so the issue is cURL is not posting the values for the security page and being redirected to the right page? Correct? If I am not mistaken, don't you have to re-put the

curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookie.txt');

portion in for the second curl call or am I wrong?

 

If you do not, and cURL does not carry that over, it would not know what/where the cookies. I could be wrong because I never used cURL extensively, but yea. That would be my suggestion from the code and just a logical knowledge of cURL.

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.