Vivid Lust Posted January 2, 2008 Share Posted January 2, 2008 Is there any way to enter something into the url bar when this script is running to make it think you have been authed? This site in run by a new sysadmin who does not know much about web configuration The script it located at http://moo.com/moo.php Attempt to make the script think you are authed by entering the correct URI. Here is the script (me.php): <?php $user =$_GET['user']; $pass = $_GET['pass']; if (isAuthed($user,$pass)) { $passed=TRUE; } if ($passed==TRUE) { echo 'you win'; } ?> <form action="me.php" method="get"> <input type="text" name="user" /> <input type="password" name="pass" /> </form> <?php function isAuthed($a,$b) { return FALSE; } ?> Thanks loads in advanced!! Link to comment https://forums.phpfreaks.com/topic/84171-make-this-script-authed-by-injecting-uri/ Share on other sites More sharing options...
p2grace Posted January 2, 2008 Share Posted January 2, 2008 Just looking at that code it isn't being authenticated. It's calling the function to check for authentication but it will always return false. Link to comment https://forums.phpfreaks.com/topic/84171-make-this-script-authed-by-injecting-uri/#findComment-428463 Share on other sites More sharing options...
revraz Posted January 2, 2008 Share Posted January 2, 2008 Which is why you won't win. Link to comment https://forums.phpfreaks.com/topic/84171-make-this-script-authed-by-injecting-uri/#findComment-428467 Share on other sites More sharing options...
Vivid Lust Posted January 2, 2008 Author Share Posted January 2, 2008 is there a way to enter something into the url to make the script think you are authed? Link to comment https://forums.phpfreaks.com/topic/84171-make-this-script-authed-by-injecting-uri/#findComment-428471 Share on other sites More sharing options...
revraz Posted January 2, 2008 Share Posted January 2, 2008 Look at the function function isAuthed($a,$b) { return FALSE; } the only result is FALSE. Link to comment https://forums.phpfreaks.com/topic/84171-make-this-script-authed-by-injecting-uri/#findComment-428473 Share on other sites More sharing options...
Vivid Lust Posted January 2, 2008 Author Share Posted January 2, 2008 Could you use javascipt? php? to make it true in the url? Link to comment https://forums.phpfreaks.com/topic/84171-make-this-script-authed-by-injecting-uri/#findComment-428498 Share on other sites More sharing options...
p2grace Posted January 2, 2008 Share Posted January 2, 2008 If you want it to be true, just change the FALSE to true in the authentication function. function isAuthed($a,$b) { return true; } Link to comment https://forums.phpfreaks.com/topic/84171-make-this-script-authed-by-injecting-uri/#findComment-428510 Share on other sites More sharing options...
p2grace Posted January 2, 2008 Share Posted January 2, 2008 If you want to do it through the url do this: function isAuthed($a,$b) { if(isset($_GET['auth'])){ if($_GET['auth'] == 1){ return true; }else{ return false; } }else{ return false; } } The url would be: me.php?auth=1 Link to comment https://forums.phpfreaks.com/topic/84171-make-this-script-authed-by-injecting-uri/#findComment-428513 Share on other sites More sharing options...
revraz Posted January 2, 2008 Share Posted January 2, 2008 I'm guessing this is some contest or riddle. Link to comment https://forums.phpfreaks.com/topic/84171-make-this-script-authed-by-injecting-uri/#findComment-428518 Share on other sites More sharing options...
Vivid Lust Posted January 2, 2008 Author Share Posted January 2, 2008 Without changing the script... This site in run by a new sysadmin who does not know much about web configuration The script it located at http://moo.com/moo.php Attempt to make the script think you are authed by entering the correct URI. Here is the script (me.php): Link to comment https://forums.phpfreaks.com/topic/84171-make-this-script-authed-by-injecting-uri/#findComment-428521 Share on other sites More sharing options...
p2grace Posted January 2, 2008 Share Posted January 2, 2008 You would have to use some sort of php injection, passing php code through the url. My guess would be somehow passing $passed = true through the url. Link to comment https://forums.phpfreaks.com/topic/84171-make-this-script-authed-by-injecting-uri/#findComment-428529 Share on other sites More sharing options...
Vivid Lust Posted January 2, 2008 Author Share Posted January 2, 2008 I'm guessing this is some contest or riddle. Its on HTS... not saying more than that. And can you enter php straight into the url? Link to comment https://forums.phpfreaks.com/topic/84171-make-this-script-authed-by-injecting-uri/#findComment-428539 Share on other sites More sharing options...
p2grace Posted January 2, 2008 Share Posted January 2, 2008 Not that I know of, but I can't think of any other way to do it. Link to comment https://forums.phpfreaks.com/topic/84171-make-this-script-authed-by-injecting-uri/#findComment-428544 Share on other sites More sharing options...
trq Posted January 2, 2008 Share Posted January 2, 2008 The entire point of HTS is for you to figure out the problems. This really, is not the place. Link to comment https://forums.phpfreaks.com/topic/84171-make-this-script-authed-by-injecting-uri/#findComment-428546 Share on other sites More sharing options...
Vivid Lust Posted January 2, 2008 Author Share Posted January 2, 2008 Ive been trying to do it for dayyys Link to comment https://forums.phpfreaks.com/topic/84171-make-this-script-authed-by-injecting-uri/#findComment-428551 Share on other sites More sharing options...
Vivid Lust Posted January 2, 2008 Author Share Posted January 2, 2008 Something like: me.php?user=foo&pass=bar&passed=1 ??? Link to comment https://forums.phpfreaks.com/topic/84171-make-this-script-authed-by-injecting-uri/#findComment-428698 Share on other sites More sharing options...
p2grace Posted January 2, 2008 Share Posted January 2, 2008 I don't think that will work because the script never looks for $_GET['passed']. You would have to use actual php injection (if that's possible). Link to comment https://forums.phpfreaks.com/topic/84171-make-this-script-authed-by-injecting-uri/#findComment-428703 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.