Thread subject: Security Override :: Not sure what I'm doing wrong in programming 1

Posted by apex123 on 01/17/2014 08:44:36
#1

HI, I have completed a number of this type of challenge on other websites, but this one doesn't seem to be working the same. I can't seem to get the entire source code, I only have like half of it (and not the half that I need either). I'm using php curl, can anyone offer any advice?

Edit: I can't view any part that would be in the body tags! WTF?!?!?!?

This makes no sense at all. If I set my $url variable to
Code
$url ="http://securityoverride.org/challenges/programming/";



and echo the output I get the full source code, the same that I would if I opened up firebug while on the page. However, as soon as I change the variable to
Code
$url ="http://securityoverride.org/challenges/programming/1/";



or
Code
$url ="http://securityoverride.org/challenges/programming/1/index.php";



the output ends at the first body tag. What is going on?

Edited by apex123 on 01/17/2014 13:23:45

Posted by apex123 on 01/18/2014 15:54:51
#2

Please, someone tell me WTF is wrong with this:

Code
<?php
    $url = "http://securityoverride.org/challenges/programming/1/index.php";
    $cookies = "PHPSESSID=xxx;fusion_user=xxx";
    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_COOKIE, $cookies);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

    $output = curl_exec($ch);
   
    echo $output;
?>



This should echo all of the source code for the page, but instead it only echoes to the opening body tag. Why though? It doesn't make sense :(

Posted by Merlin21 on 01/18/2014 22:46:47
#3

Look at those pages when your logged in and when your logged out. Its your cookies.
Can be accessed without a log in
Code
$url ="http://securityoverride.org/challenges/programming/";



Can't
Code
$url ="http://securityoverride.org/challenges/programming/1/";



Can't
Code
$url ="http://securityoverride.org/challenges/programming/"1/index.php;



Edited by Merlin21 on 01/18/2014 22:47:21

Posted by apex123 on 01/19/2014 07:02:20
#4

Thanks for the reply Merlin. but It's not my cookies lol. I replaced them with 'xxx' when I copied and pasted the code into my previous post.

Posted by apex123 on 01/19/2014 07:31:58
#5

Well, I solved it. In case anyone is interested, I had to add
Code
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);



to my code. Thanks for all your help lol!

Posted by Merlin21 on 01/19/2014 11:05:53
#6

i haven't done the challenge my self yet I was just giving it my best guess. But im glad you got it working.

Posted by 2laXt3rmn8r on 01/19/2014 12:49:13
#7

LOL

Posted by 2laXt3rmn8r on 01/19/2014 12:50:05
#8

that was directed at apex by the way. He is just a funny guy.:)