Russia Posted November 9, 2009 Share Posted November 9, 2009 I have this script, it checks if an account information is valid or not, then says if it is or not. It is not working for some reason. By the way, make a free account here and check, I have my own private accounts to check with: https://secure.runescape.com/m=create/index.ws Or use this login information (DO NOT CHANGE THE PASSWORD TO BE AN ASSHOLE) Username: codingforums Password: donotchange THIS IS NOT ADVERTISING, THIS IS TO MAKE AN ACCOUNT TO SEE IF IT WORKS. Edit $username and $password to check after. If I put legit information into the $username and $password it says Invalid. But if i put fake information into $username and $password it also says invalid, which is correct. <?php $username = "username"; $password = "password"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://weblogin.runescape.com/login.ws"); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "username=".$username."&password=".$password."&dest=title.ws&mod=www&ssl=0"); $pagedata = curl_exec($ch); curl_close($ch); if (preg_match("/Your login was successful. You will shortly be redirected to your destination./i", $pagedata)) { $valid = "Valid"; } elseif (preg_match("/Login Failed - Invalid Username or Password/i", $pagedata)) { $valid = "Invalid"; } else { $valid = "Cannot check! Too many invalid logins"; } echo $valid; ?> Does anyone notice the problem? Quote Link to comment Share on other sites More sharing options...
mrMarcus Posted November 9, 2009 Share Posted November 9, 2009 dude, take your username and password down, pronto .. not to rip into the integrity of anybody on this board, but you just never know. better to give out that kind of information (if at all), via private message or email, etc. EDIT: 'cause just writing, "DO NOT CHANGE THE PASSWORD TO BE AN ASSHOLE", is not enough to stop somebody from, well, changing your password. Quote Link to comment Share on other sites More sharing options...
Russia Posted November 9, 2009 Author Share Posted November 9, 2009 Nahh its okay its a brand new account, not even started tutorial island. Theres nothing on it basicly, and if someone does take it I can just recover with email address. Or you can make your own account. Also, can u see the problem? or an error in the coding? Quote Link to comment Share on other sites More sharing options...
mrMarcus Posted November 9, 2009 Share Posted November 9, 2009 do you need to hash the password before sending it via cURL? Quote Link to comment Share on other sites More sharing options...
Russia Posted November 9, 2009 Author Share Posted November 9, 2009 nope. It worked a few days ago, and now it wont. >.> You can try whatever u want to make it work. Quote Link to comment Share on other sites More sharing options...
mrMarcus Posted November 9, 2009 Share Posted November 9, 2009 something has changed, either on your end or theirs. starting with your end .. have you edited any code related to this cURL since it was last working? think hard. Quote Link to comment Share on other sites More sharing options...
Russia Posted November 9, 2009 Author Share Posted November 9, 2009 Nope, not at all. If you want to login the regular site, you can from here: https://secure.runescape.com/m=weblogin/loginform.ws?mod=www&ssl=0&dest=index.ws Quote Link to comment Share on other sites More sharing options...
mrMarcus Posted November 9, 2009 Share Posted November 9, 2009 <?php #credentials; $username = 'codingforums'; $password = 'donotchange'; #full URL; $feedUrl = 'https://weblogin.runescape.com/login.ws?username='.$username.'&password='.$password.'&dest=title.ws&mod=www&ssl=0'; #clear feed content var; $feedContent = ''; #initiate cURL function; $curl = curl_init(); #cURL options; curl_setopt($curl, CURLOPT_URL, $feedUrl); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_HEADER, 0); curl_setopt($curl, CURLOPT_TIMEOUT, 30 ); curl_setopt($curl, CURL_HTTP_VERSION_1_1, true); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_ENCODING, "gzip, deflate"); curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); #execute connection; $feedContent = curl_exec ($curl); #close connection; curl_close ($curl); if ($feedContent) { echo 'goodToGo'; } else { echo 'no good'; } ?> this works for me. Quote Link to comment Share on other sites More sharing options...
Russia Posted November 9, 2009 Author Share Posted November 9, 2009 Okay, it still doesnt work, I put fake information into the $username and $password it still says good to go. Quote Link to comment Share on other sites More sharing options...
Russia Posted November 9, 2009 Author Share Posted November 9, 2009 Bump. Quote Link to comment Share on other sites More sharing options...
mrMarcus Posted November 9, 2009 Share Posted November 9, 2009 You have been blocked from logging in, because too many requests have been made from your IP in a short space of time. Please try again in a few minutes. they zapped me, so you're gonna have to test. forgot your scraping preg_match() function .. also overlooked something .. changed out: curl_setopt($curl, CURLOPT_POST, 1); and replaced with: curl_setopt($curl, CURLOPT_GET, 1); try this code: <?php #credentials; $username = 'codingforums'; $password = 'donotchange'; #full URL; $feedUrl = 'https://weblogin.runescape.com/login.ws?username='.$username.'&password='.$password.'&dest=title.ws&mod=www&ssl=0'; #clear feed content var; $feedContent = ''; #initiate cURL; $curl = curl_init(); #cURL options; curl_setopt($curl, CURLOPT_URL, $feedUrl); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_HEADER, 0); curl_setopt($curl, CURLOPT_TIMEOUT, 30 ); curl_setopt($curl, CURL_HTTP_VERSION_1_1, true); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($curl, CURLOPT_GET, 1); curl_setopt($curl, CURLOPT_ENCODING, "gzip, deflate"); curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); #execute connection; $feedContent = curl_exec ($curl); #close connection; curl_close ($curl); if ($feedContent) { if (preg_match ("/Your login was successful. You will shortly be redirected to your destination./i", $feedContent)) { $valid = 'Valid'; } elseif (preg_match ("/Login Failed - Invalid Username or Password/i", $feedContent)) { $valid = 'Invalid'; } else { $valid = 'Cannot check! Too many invalid logins'; } echo $valid; } else { echo 'no connection'; } EDIT: no need to bump .. it's not like topic is on the fifth page or something. Quote Link to comment Share on other sites More sharing options...
mrMarcus Posted November 9, 2009 Share Posted November 9, 2009 was able to stop their script and see that POST is used and not GET; here is working script: <?php #credentials; $username = 'codingforums'; $password = 'donotchange'; #full URL; $feedUrl = 'https://weblogin.runescape.com/login.ws'; #clear feed content var; $feedContent = ''; #initiate cURL instance; $curl = curl_init(); #cURL options; curl_setopt($curl, CURLOPT_URL, $feedUrl); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_HEADER, 0); curl_setopt($curl, CURLOPT_TIMEOUT, 30 ); curl_setopt($curl, CURL_HTTP_VERSION_1_1, true); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, 'username='.$username.'&password='.$password.'&dest=title.ws&mod=www&ssl=0'); curl_setopt($curl, CURLOPT_ENCODING, "gzip, deflate"); curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); #execute connection; $feedContent = curl_exec ($curl); #close connection; curl_close ($curl); if ($feedContent) { if (preg_match ("/Your login was successful. You will shortly be redirected to your destination./i", $feedContent)) { $valid = 'Valid'; } elseif (preg_match ("/Login Failed - Invalid Username or Password/i", $feedContent)) { $valid = 'Invalid'; } else { $valid = 'Cannot check! Too many invalid logins'; } echo $valid; } else { echo 'no connection'; } ?> Quote Link to comment Share on other sites More sharing options...
Russia Posted November 9, 2009 Author Share Posted November 9, 2009 So it works for you? On my host it doesnt. Quote Link to comment Share on other sites More sharing options...
mrMarcus Posted November 9, 2009 Share Posted November 9, 2009 ya, returns 'Valid'; Quote Link to comment Share on other sites More sharing options...
Russia Posted November 9, 2009 Author Share Posted November 9, 2009 Whats a php code to test if curl is enabled? For me it wont work on my webhost. >.> Quote Link to comment Share on other sites More sharing options...
mrMarcus Posted November 9, 2009 Share Posted November 9, 2009 your script would break and you would receive a Fatal error if cURL was not installed on the server. you can create file, call it phpinfo.php, and place the following code in it: <?php phpinfo(); ?> save it, and upload it to your server. then, using your browser's 'Find' function, type in cURL support .. beside it you will see either enabled or disabled. delete phpinfo.php from server. Quote Link to comment Share on other sites More sharing options...
Russia Posted November 9, 2009 Author Share Posted November 9, 2009 Yep, I am able to find curl, and its enabled.... then why would it be saying its invalid... Maybe Im ipbanned? Quote Link to comment Share on other sites More sharing options...
Russia Posted November 9, 2009 Author Share Posted November 9, 2009 It wont work... U got any hosting websites I can try it on? Quote Link to comment Share on other sites More sharing options...
mrMarcus Posted November 9, 2009 Share Posted November 9, 2009 Yep, I am able to find curl, and its enabled.... then why would it be saying its invalid... Maybe Im ipbanned? try logging in on the site .. you'll see there if your ip is banned or not. Quote Link to comment Share on other sites More sharing options...
Russia Posted November 9, 2009 Author Share Posted November 9, 2009 It lets me login, now I tried it on a different server, it worked for like 10 minutes, now it no longer works. Quote Link to comment Share on other sites More sharing options...
Russia Posted November 10, 2009 Author Share Posted November 10, 2009 I just figured out why! They added a captcha to the site, so when u login 3 times incorrectly, it makes u solve a captcha... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.