Click to See Complete Forum and Search --> : A little challange for you guys... ;)


AdamBrill
03-27-2003, 11:14 PM
Ok, I decided to find out once and for all if you can hide the source. So, I created a site to try to hide it and want you guys to try to get it. :D The site is: http://www.code4ever.com/hide/ Let me know if you get it! :p BTW, if you get it, let me know how... ;) Also, I put a comment in the code telling you that you found it, so that you will know... Good Luck! :D

Jick
03-27-2003, 11:22 PM
I could see the source in every way with IE. But I don't think I understand. Hope that helps. :D

AdamBrill
03-27-2003, 11:24 PM
No, you could see my back up source. :p If you actually saw it, then what did my comment say?

Jick
03-27-2003, 11:25 PM
Ohh ok I get it cool it works. Nice job. :D

Jick
03-27-2003, 11:28 PM
BTW. Did you get my private message? It has to do with phpbb and its in the cgi forum and the post is called 'Please Help!' so see if you or anybody can help me. Thanks. :D

khaki
03-27-2003, 11:43 PM
Wow Adam...
guess what?

a blank page.
is that what you are hiding?

Netscape7 shows nothing (nothing but a sea of white).
Opera6.02 same thing.
EI5.0 crashes.

"TRY AGAIN"?
code.php?

is there a point to hiding source code that nobody would care about?
You stumped me, i guess.
(and no... i don't think that i'd steal it... so, good job. LOL)

?
k

AdamBrill
03-28-2003, 07:48 AM
Ok, there were few bugs in it. I forgot to test it in anything besides IE6... :rolleyes: Anyway, it works for me now in IE6, Opera, and Netscape 6 and 7. So, it should be better now... :p
Originally posted by khaki
is there a point to hiding source code that nobody would care about?I didn't say that I actually want to hide my source... I just wanted to see if it could be done.
Originally posted by khaki
(and no... i don't think that i'd steal it... so, good job. LOL)Well, either way, you didn't see the code, so couldn't have stole it if you wanted to. ;) Just so you know...

khaki
03-28-2003, 09:03 AM
Ok, there were few bugs in it. I forgot to test it in anything besides IE6... Anyway, it works for me now in IE6, Opera, and Netscape 6 and 7. So, it should be better now...hmm... still not working for me (Opera6.02, Netscate7.0, IE5.0... athough it doesn't crash IE now).I didn't say that I actually want to hide my source... I just wanted to see if it could be done.Your using server-side code. It's true nature can be concealed. You've proven a proven point. I have countless ASP pages that actually produce data :eek: ... and the source code shows only the data .... not the code that generated it... so.... the world is already a step ahead of you there.Well, either way, you didn't see the code, so couldn't have stole it if you wanted to. Just so you know...And like I said... it's a blank page. There is nothing that you have accomplished other than to "hide" your source code in such a way that it produces nothing on the page. In other words... you've succeeded in hiding both the source AND the content. Until you can actually paint something to the screen with that code... it seems pointless.
(although it did seem to get mjdimick all excited for some reason... so you got that going for you. lol).

But... I played along :rolleyes:
(hey... why not)

mystified...
k

DaiWelsh
03-28-2003, 09:27 AM
I think the idea is that this method could be used to protect javascript code from the world, not server-side code.

I will take a crack at it when I am back in the office, is it using the referer to not output the content if called directly? If so, I should be able to psych it out by passing a fake referer string - we will see..

khaki
03-28-2003, 09:47 AM
DaiWelsh wrote: I think the idea is that this method could be used to protect javascript code from the world, not server-side code.Well... I think that I understand that (I may be playing devil's advocate here... but I'm not stupid).

My point is...
Where is the Javascript generated result (or any generated result) on the page itself?
If the PHP page (as protected as it may be) cannot paint anything to the screen when I click the link (http://www.code4ever.com/hide/)... then who cares what is behind the source code in the first place?

I'll admit that the Javascript code is hidden (I guess)... but I've got some Javascript code written on a piece of paper right in front of me that is equally hidden (I can see it, but the rest of you can't).

My point is, that it too produces no output to the screen that you can see. So what good is hiding it if it doesn't do anything?

This is getting stupid now. I'm not even looking to debate it.
Adam posted a thread that indicated a challenge. I was curious.
I see nothing when I veiw the link.
I don't understand the challenge of that.
Maybe it's just me.

Fair enough though.
I'm not looking to create a stir.
I'll just accept this for wahtever it is.
But... sorry.... I just don't get it.

:confused: k

DaiWelsh
03-28-2003, 09:54 AM
Khaki, chill, relax, let the soothing music wash over you :cool:

I was not having a pop, for all I knew you might not have understood the purpose of the exercise, which would not have made you dumb.

To answer your question I assume that

Try to get the source... Pretty sweet, eh?

is written by a javascript document.write, but I dont know for sure because I cant see the source code :D

If that is the case then of course the javascript could do anything you like on the actual site it is the principle that counts.

pyro
03-28-2003, 10:09 AM
Khaki-

In IE6, NN7, Opera 7, and Mozilla 1.2, I see Try to get the source... Pretty sweet, eh? Printed to my screen. However, I do not see the source of this file. If I veiw source, I don't see <b>Try to get the source...</b> <i>Pretty sweet, eh?</i> or anything. I also do not see the unknown comment that AdamBrill stated was there.

Originally posted by Khaki
not the code that generated it... so.... the world is already a step ahead of you there.
What you don't seem to see is that AdamBrill has hidden the code the PHP page generates. The trick is not hiding the server side code, and AdamBrill knows that.

khaki
03-28-2003, 10:15 AM
Khaki, chill, relax, let the soothing music wash over you yes... i know.
(stressful time for me now... i guess. whatever... sorry)

but... ;) ...

When I view the link, I do not see :

Try to get the source... Pretty sweet, eh?
(i won't give another run-down of the browsers that i used)
I didn't know that that page had anything on it at all, because when I veiw the link...
I see NOTHING.

So to me...
the Javascript code would either be:
document.write('<body bgcolor=#ffffff>')
... which would be pretty boring (lol)
or it just doesn't work at all.

That's all.

maybe a bit worked-up... but not mad... and definietly not trying to be mean...
:( k

DaiWelsh
03-28-2003, 10:17 AM
ah ok, I misread your post as saying it did not show up in some of the browsers you tried, not all of them, my bad

barcode
03-28-2003, 10:21 AM
ist this thw code ?

<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
<script language=javascript>

function doOnload(){
document.getElementById('theIFrame').src="code.php";
}
function window.open(){
alert("notta... ;)");
}
</script>
</head>

<body>
<noscript>
<center><b>Please enable javascript to view this page...</b></center></noscript>
<div id="theDiv">
</div>
<div id="temp" style="position:absolute; top:-1000px; left:-1000px;">
<iframe src="code.php">this is a test</iframe>
</div>
<form name=documentElement>
<input type=hidden name=outerHTML>
</form>
</body>

</html>

khaki
03-28-2003, 10:33 AM
Yes barcode...
that is the source of the page.

And on all 3 of my browsers it produces a blank white page.

I understand that the PHP page contains something... and that it will not allow itself to be accessed directly...
but since it generates no output on 3 versions of browser... I'm having difficulty understanding the challenge aspect.

This is best left to those of you who can see the output. Without it... it just doesn't offer any challenge.

Just write code and who cares if anyone can see it or not (even if it sucks! lol).

(and Pyro.... i understand about the php generated code. gee... does everybody think that i have completely lost my marbles? ugh)

thinking about crawling back into bed...
k

AdamBrill
03-28-2003, 11:38 AM
Originally posted by khaki
Just write code and who cares if anyone can see it or not (even if it sucks! lol).Well, everyone sucessfully missed my point... :rolleyes: First of all, what I am hiding is client-side code, not server-side. It seems like DaiWelsh and Pyro were the only two to figure what I meant... :D You must have missed this:Originally posted by AdamBrill
I didn't say that I actually want to hide my source... I just wanted to see if it could be done.
As I said there, I don't plan on using this to hide my code, I only want to see if it can be done(since it is such a popular topic). I don't know what to tell you about your browsers... It works fine for me in the same browsers that you listed, so... :)

barcode - That is just the front code. What I want you to try to get is the code with this:

<b>Try to get the source...</b> <i>Pretty sweet, eh?</i>

and it also has a comment(so I know if you actually find it :p). So, let me know if any of you get it! :D

DaveSW
03-28-2003, 11:46 AM
Your code is evidently so well hidden that I get a blank page too in IE6

Dave

khaki
03-28-2003, 12:28 PM
Dave wrote: Your code is evidently so well hidden that I get a blank page too in IE6Finally (maybe I'm not crazy after all. lol).
Maybe you should start a new thread Adam, where you only ask who can and cannot see the text on that page... and what browser/version they are using.

It seems like you PHP guys are having no trouble... maybe you guys with PHP loaded on your machines are getting different results than those of us who don't.

and P L E A S E stop saying that I am missing all of your "points"! (and questioning my understanding of server-side and client-side scripts).
Can you please stop all of this?

I acknowledge the skills that you guys have... but it's frustrating to be made to feel like a fool simply because I can't see the text on your page.
Yikes! I really like you guys... but c'mon.

sigh... all of these "points" are starting to hurt...
k

Nedals
03-28-2003, 01:26 PM
Adam, now look what you have done. :)

I'm using IE5.0 and IE6.0 and both display a page that has

Try to get the source... Pretty sweet, eh?

at the top. Checking the source code reveals what barcode found which is not the source for the displayed page. I don't understand why kahki and DaveSw cannot see this page. That might be an interesting problem to solve.

That said, I could not get to the page source. How about a clue. :)

Neverwhere
03-28-2003, 01:31 PM
im using IE6 and i can see the try and get the source... pretty cool huh stuff... but i also cannot see the source of the code... nicely written

khaki
03-28-2003, 01:48 PM
Well... I guess that I'm not invited to this party (it's still just a wasteland of white space for me :( ).

But I would like to know how you did it Adam (and how come all of these other Javascript brainiacs haven't been able to come up with this themselves).

Personally I don't beleive in hiding code (FREE THE WIDE WORLD WEB!!!) but I would like to be in on a cool secret ;) ).

Can you post how you did it (and then maybe I can load it onto my bro's server and see if I am able to view it that way)?

:rolleyes: k

(and I'm really sorry if I'm suddenly a bit "ornery"... but my high school sweetheart is in Iraq with the 1st Marine Expeditionary Force and I'm scared sh*tless. Please don't lose patience with me guys... i really need this distraction in my life right now. Forgiven?)

Jona
03-28-2003, 01:49 PM
Ok. Here's what I've got. When you type in http://www.code4ever.com/hide/index.html you get a blank page in IE6. When you type in http://www.code4ever.com/hide/ you get the same thing. But when you click the link that Adam gave you get a message, "Try to get the source... Pretty sweet, eh?" The src of the IFrame in that page is code.php but the code.php file is only viewable from the index.html page. When going to http://www.code4ever.com/hide/code.php you will see the message, "TRY AGAIN!!!!!!!!! :P"

Jona
03-28-2003, 01:51 PM
Adam, you did most of this server-side, right? Your functions on the index.html page are executed in the code.php file, right? And you get the ID of the IFrame (code.php where the code is stored) and disallow it, right? Something like that.

Oh, and when I said you type in http://www.code4ever.com/hide/ and get a blank page I was wrong, it was the same as when you click the link. :p

catchup
03-28-2003, 01:53 PM
it must be a form using the get method... just my guess

Jona
03-28-2003, 01:56 PM
Wait! What if I had 3 frames, and in one the index.html page, in the second one have a page that gets the ID of "temp" in the first frame, and in the third one print the innerHTML of it!?

Jona
03-28-2003, 01:59 PM
Originally posted by catchup
it must be a form using the get method... just my guess

I just checked, it ignores all ?variablename=variablevalue suffixes.

Phil Karras
03-28-2003, 02:10 PM
Here's you comment:
<div id="theDiv"><b>Try to get the source...</b> <i>Pretty sweet, eh?</i><!--this is the source. You found it! Congradulations... :)--></div>

Used NS7.0 and simply asked it to save the file.

AdamBrill
03-28-2003, 03:05 PM
Good job, Phil. ;) I tried that in IE and it didn't work... hmm.... now I have to try to think of a work-around for that. :D If I find one, I'll let you know... ;) Until then, "WE HAVE A WINNER!!!!" :p

havey
03-28-2003, 03:14 PM
can you explain how this works?

Jona
03-28-2003, 04:09 PM
It doesn't work in IE (the save thing, I mean). How'd you disable saving in IE, Adam? Oh, and can we see the code.php source code? Just to see what you're doing?

havey
03-28-2003, 05:10 PM
I'm with Jona...

Pleeeeeease.....

can you send it to me kev55ker@yahoo.com ?

thanks

AdamBrill
03-29-2003, 10:47 AM
Well... no. If you give me a good reason to give it to you, I might, but besides that... :p I don't like it when people hide their source, so you'd have to give me a pretty good reason of why you want to hide it. ;) So, I'm awaiting your replies... :cool: BTW, I'm still working on getting it to work in Netscape... ;)

DaiWelsh
03-30-2003, 08:13 AM
<html>

<head>

</head>

<body>



<script language=javascript>source='<b>Try to get the source...</b> <i>Pretty sweet, eh?</i><!--this is the source. You found it! Congradulations... :)-->';top.document.getElementById('theDiv').innerHTML=source;top.document.getElementById('temp').innerHT ML='';</script></body>

</html>

And I did not use browser save function ;)

Dai

AdamBrill
03-30-2003, 08:20 AM
Ok.... How did you get it then??? ;)

DaiWelsh
03-31-2003, 01:41 AM
About 20 lines of perl code (not counting included module code). I wont post it as a) you didnt seem to want everyone onto the secret b) it was a knock together so I am not exactly bragging about the structure of the code ;) However if you want it I can mail it or put it up for download.

It is not hard to write anyway if you know the relevant perl libraries.

Dai

Phil Karras
03-31-2003, 08:06 AM
I guess we could do the same thing with Java, I should try iy sometime, but hey, I did with good ol' standard Netscape 7.0! SO, until he finds a way around that one, why bother having to do any programming to get the source?

Jona
03-31-2003, 10:01 PM
Originally posted by AdamBrill
Well... no. If you give me a good reason to give it to you, I might, but besides that... :p I don't like it when people hide their source, so you'd have to give me a pretty good reason of why you want to hide it. ;) So, I'm awaiting your replies... :cool: BTW, I'm still working on getting it to work in Netscape... ;)

I wasn't interested in hiding my source code at all. I have no reason to, as a matter of fact, a lot of times I perfer people see my source. :D Actually I was interested in seeing how you did it, not using it myself.

Originally posted by DaiWelsh
About 20 lines of perl code (not counting included module code). I wont post it as a) you didnt seem to want everyone onto the secret b) it was a knock together so I am not exactly bragging about the structure of the code However if you want it I can mail it or put it up for download.

It is not hard to write anyway if you know the relevant perl libraries.

Perl! Yah, isn't it possible to view server-side source code with Perl? I'm more than certain it is. I used javaScript to get the source of HTML files, but Adam got me stuck there... JavaScript can't get it all. :) BTW, the script is at http://geocities.com/god_loves_07/viewsource.html
(if that doesn't work, try changing the extention to .htm)

havey
04-01-2003, 01:19 AM
Unless you can stop image theift with the code its pretty much usless to me, by interesting non the less, maybe a stepping stone to something. Thats my reason.