hacker.org Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
Your Turn, Part Two
Goto page Previous  1, 2, 3, 4  Next
 
Reply to topic    hacker.org Forum Index » Challenges View previous topic
View next topic
Your Turn, Part Two
Author Message
bsguedes



Joined: 24 Feb 2009
Posts: 103
Location: Porto Alegre

Post Reply with quote
Hey guys, I solved it.

Thanks to everyone who posted. The error? A newline character AFTER the last '>'
I was worried checking the code and trying different string functions and the answer was always there.

However, the browser didn't show the newline, only when looking in the source code of the webpage.

Well, thanks again Very Happy
Wed Jul 27, 2011 4:47 pm View user's profile Send private message
AMindForeverVoyaging
Forum Admin


Joined: 28 May 2011
Posts: 493
Location: Germany

Post Reply with quote
Well, glad that bsguedes solved it Smile
Mine still don't work Sad

Could anybody recommend to me a webspace provider which does allow access to the server logs on their free accounts?
Wed Jul 27, 2011 5:13 pm View user's profile Send private message
DaymItzJack



Joined: 29 Oct 2009
Posts: 106

Post Reply with quote
Generally if you have a friend with a server or hosting, they can give you some space. If you cannot find anyone else, I'd be happy to host a .php file for you just to solve this challenge. Send me a PM if you're interested.
Wed Jul 27, 2011 8:50 pm View user's profile Send private message
c0mp4ct



Joined: 16 Oct 2010
Posts: 3

Post Reply with quote
Code:
0000000: 6e6f 0a       no.


Any hint for me to remove 0a? echo "no" is in the file.
Wed Jul 27, 2011 9:29 pm View user's profile Send private message
DaymItzJack



Joined: 29 Oct 2009
Posts: 106

Post Reply with quote
c0mp4ct wrote:
Code:
0000000: 6e6f 0a       no.


Any hint for me to remove 0a? echo "no" is in the file.


I'm confused as what you're even trying to do.
Wed Jul 27, 2011 10:50 pm View user's profile Send private message
megabreit



Joined: 03 Jan 2009
Posts: 141

Post Reply with quote
All depends on your internet connection. I ran a web server on my local PC and (temporarily) forwarded the port through my DSL router. Dyndns will be a big help with this setup...
This way you have access to the logs and can experiment.

And BTW: One doesn't have to use PHP to solve this challenge. Other languages are more flexible for this actual purpose Smile
Thu Jul 28, 2011 12:56 am View user's profile Send private message
CodeX



Joined: 17 Oct 2008
Posts: 350

Post Reply with quote
as for c0mp4ct I think the simulation to your problem will probably will be my post on the bottom of the last page. i.e. how to avoid the '\n' with PHP
Thu Jul 28, 2011 2:48 am View user's profile Send private message
AMindForeverVoyaging
Forum Admin


Joined: 28 May 2011
Posts: 493
Location: Germany

Post Reply with quote
megabreit wrote:
All depends on your internet connection. I ran a web server on my local PC and (temporarily) forwarded the port through my DSL router. Dyndns will be a big help with this setup...
This way you have access to the logs and can experiment.


I think I'll try that. I have no idea why this challenge must be so much trouble, especially for the rather simple thing it is asking for. Nevertheless your suggestion seems like a good a way to get a fully-accessible web server.

markobr wrote:
Yep, to me it sends 8 requests and accepts answers in text/plain.


Actually, does it have to be text/plain? When I use curl, I see the following:

Quote:

<= Recv header, 25 bytes (0x19)
0000: 43 6f 6e 74 65 6e 74 2d 54 79 70 65 3a 20 74 65 Content-Type: te
0010: 78 74 2f 68 74 6d 6c 0d 0a xt/html..


EDIT: Answering my own question: At least setting the header explicitly to 'Content-Type: text/plain' does not fix it... at least not on its own. Might still be necessary to do it, or it might not.
Thu Jul 28, 2011 7:31 am View user's profile Send private message
megabreit



Joined: 03 Jan 2009
Posts: 141

Post Reply with quote
Maybe it's time to read the challenge text again? And maybe again... Can you show me the line where it says what content type to use? Rolling Eyes
Thu Jul 28, 2011 9:33 pm View user's profile Send private message
AMindForeverVoyaging
Forum Admin


Joined: 28 May 2011
Posts: 493
Location: Germany

Post Reply with quote
It is not specified, just like the answer when SETting a variable. Which might be where the problem lies. Or it might not. How am I supposed to know when I haven't found out yet? Rolling Eyes
Thu Jul 28, 2011 9:43 pm View user's profile Send private message
megabreit



Joined: 03 Jan 2009
Posts: 141

Post Reply with quote
This is why it's called "challenge" Smile
Thu Jul 28, 2011 9:46 pm View user's profile Send private message
DaymItzJack



Joined: 29 Oct 2009
Posts: 106

Post Reply with quote
I don't see why anyone would have trouble with this challenge. All you need is basic programming skills and a server. Did I just have it easy when I did it? My code is literally 7 lines long and worked first time.
Thu Jul 28, 2011 10:33 pm View user's profile Send private message
AMindForeverVoyaging
Forum Admin


Joined: 28 May 2011
Posts: 493
Location: Germany

Post Reply with quote
DaymItzJack wrote:
I don't see why anyone would have trouble with this challenge.


Did you read the whole thread? Wink

DaymItzJack wrote:
All you need is basic programming skills and a server. Did I just have it easy when I did it? My code is literally 7 lines long and worked first time.


The problem might be not in the program logic itself, but in the setup/configuration. At least that seems like a not-so-unlikely explanation for the script arguably working fine when being accessed manually.
Fri Jul 29, 2011 6:18 am View user's profile Send private message
AMindForeverVoyaging
Forum Admin


Joined: 28 May 2011
Posts: 493
Location: Germany

Post Reply with quote
Phew, finally made it.

Hint: If you do this challenge in PHP then don't use $_SESSION variables - they need enabled cookies for the standard approach (which just about every website on the planet uses) to work. To be honest, I find it a bit strange that we are supposed to use cookies in other challenges (e.g. 'Type Fastest'), but here they are most likely not supported...
Sun Jul 31, 2011 4:09 pm View user's profile Send private message
megabreit



Joined: 03 Jan 2009
Posts: 141

Post Reply with quote
What makes you think that there is only 1 valid way of setting up a web server?? I hope you learned that there is no such 1 way! One goal of all these challenges is to learn! Especially with hacker.org there is everything valid and appropriate that makes you find the solution... even the strangest thing. And if the challenge is setup to not use cookies or even gets confused by cookies... so what? Find out a way to do it within the present environment! Strange is normal and no reason to complain Shocked
Sun Jul 31, 2011 10:33 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    hacker.org Forum Index » Challenges All times are GMT
Goto page Previous  1, 2, 3, 4  Next
Page 3 of 4

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.