escaped char URL hiding

Discussion about the creation of websites in general, HTML, PHP, Java.

escaped char URL hiding

Postby Tencati on Mon Sep 11, 2006 12:39 am

Hy every one I've start this kinda "project" some time ago and I've ran into a problem Smile yeah I know it was going to happen some time. But back to the point I've been trying to encode the URL of a "secret page" so that any old idiot can't just look at it and come back later. Now I know that it's futile and a wast of time but I've figured that is an interresting wast of time which brings me to my problem I've escaped the URL and it works well but it prepends the current pages address to it which as u know kinda renders it useless and I can't don't understand wats wrong with it. So if any body have any idea as to wat the prob may be gimme a shout plz thanx. Just note I know that this is a generaly very stupid way to do it but it's not realy supose to be secure it's more to amuse my self so plz no flames as to how useless this is Very Happy
Nobody's insane its just a different opinion.
Tencati
Newbie
Newbie
 
Posts: 16
Joined: Mon Aug 07, 2006 2:03 am

Postby trick on Mon Sep 11, 2006 3:09 am

not really, unless you change the url or something there's nothing to keep the person from bookmarking it or copy-and-pasting the url.

Now if you only wanted somebody to see something once you could use cookies. But that's quite different. Plus, the Cookie Monster says "cookies are a sometimes food".
'The military don't start wars. Politicians start wars' - William Westmoreland
Image
trick
Contributer
Contributer
 
Posts: 74
Joined: Mon Aug 07, 2006 6:07 am

Postby De Kus on Mon Sep 11, 2006 7:58 am

Session Cookie (if handlesd as real cookie or as part of URL doesnt matter) is the only that comes into my mind. A php script can be made to provide content to only sessions of an age no longer than x sseconds (and simply deletes older sessions regularly).
But maybe thats not possible to your issue, I haven't fullyunderstood it. I only read something about URL not beeing valid forever Very Happy.
Image
User avatar
De Kus
Phoenix Veteran
Phoenix Veteran
 
Posts: 305
Joined: Mon Mar 14, 2005 2:15 pm
Location: Germany

Postby Tencati on Mon Sep 11, 2006 10:36 pm

I haven't fullyunderstood it. I only read something about URL not beeing valid forever
Well I'm kinda feather brained (I think thats wat u call it) so usualy ppl have difficalty understanding wat I'm trying to tell/ask them. Now back to topic wat I'm trying to do is the following:
site URL foo.com.
site to visit bar.com, or in escape chars "%62%61%72%2E%63%6F%6D"
Code: Select all

<body bgcolor="0000ff">
<a href="%62%61%72%2E%63%6F%6D"><font color="0000ff">a</font></a>



now wat that is suppose to do is the following u follow the link and in the address bar the following show up: http://%62%61%72%2E%63%6F%6D (u could hide the http aswell)
But in stead this is wat happens: http://foo.com/%62%61%72%2E%63%6F%6D or in normal chars; http://foo.com/bar.com

so it prepends the original directory/URL to the destination. It's also a problem if u put the destenation in a lower directory. Hope that clears it up Very Happy

off topic: De Kus if u don't mind me asking wats ur name mean coz in my language it means "the kiss" or "to kiss" or some thing like that any way just curiose Smile
Nobody's insane its just a different opinion.
Tencati
Newbie
Newbie
 
Posts: 16
Joined: Mon Aug 07, 2006 2:03 am

Postby De Kus on Mon Sep 11, 2006 10:48 pm

browsers translate these escaped characters automatically to human readable format. You cannot cloak an URL. Only way to hide the true URL is by using HTTP forward (in which case the browser knows the true URL, but usually doesnt show it) or run a proxy (in which case you could fully stealth the true URL).

PS: the name isn't meant to have a meaning in dutch.
Image
User avatar
De Kus
Phoenix Veteran
Phoenix Veteran
 
Posts: 305
Joined: Mon Mar 14, 2005 2:15 pm
Location: Germany

Postby Tencati on Tue Sep 12, 2006 4:19 am

In my browser it keeps the escaped chars but I don't have an other browser so I can't check it but I'll take ur advise just one last thing were can I find out more about HTTP foward the searches turned out blank. Well actualy I'm lieing but I thought I'd try my luck and if no luck then look a little harder Very Happy


off topic: I'm not dutch and can't speak it and I did look at the one german book that I have (a **small** dictanary) to see if I might b correct and from that I deducted my conclusion.
Nobody's insane its just a different opinion.
Tencati
Newbie
Newbie
 
Posts: 16
Joined: Mon Aug 07, 2006 2:03 am

Postby Scorch on Tue Sep 12, 2006 7:28 am

Hm, so you don't want people to visit the page all the time, only when -you/the code- wants to?

Then I'd guess that the easiest way is to use PHP. Like this:

Code: Select all
<?php
...

if (statement) {
   include("./include/foo.php");
}

...
?>


And at the -top- of foo.php, you write:

Code: Select all
<?php
if (!file_exists("./include/foo.php")) {
   die("Not allowed.")
}

/* Your code here */
?>


This will make your foo.php inaccessible whenever you don't want them to view it. Since you include foo.bar, that file will "jump down" one dir, and the file "./include/foo.php" will be there, so the script will excecute. Though if you just write "/include/foo.bar" in the URL, the file, which will be seen to foo.bar as "./include/include/foo.php", will not exist, so it returns false, not showing any content of the file.


Hope this was at least some help. Good luck.


EDIT: Typos.
Paranoid people live longer.
Scorch
Contributer
Contributer
 
Posts: 31
Joined: Mon Sep 11, 2006 5:53 am
Location: On a chair.

Postby De Kus on Tue Sep 12, 2006 7:46 am

i was rather thinking with "HTTP forward" about something like that:
Code: Select all
<?php
   header($_SERVER['SERVER_PROTOCOL'] . ' 307 Moved temporarily');
   header('Location: http://...');
?>
By HTTP declaration client should cache this only if declared in a cache-control or expire header and also rerequest the page from the original URL. This method is btw. often called transparent URL/domain forwarding and used by many domain offer services. But beware, somehow who requests the URL in way he can see the HTTP header, he agin will be able to read the URL, even if you escape it, its no big task to convert it into normal characters (just do a .htm file and add '<a href="#">link</a>', that simple file will show the correct name by just hovering (Mozilla) or right click + properties (Internet Explorer) it ^-^).

the other examples rather reflects the "proxy" idea Smile
Image
User avatar
De Kus
Phoenix Veteran
Phoenix Veteran
 
Posts: 305
Joined: Mon Mar 14, 2005 2:15 pm
Location: Germany

Postby Tencati on Tue Sep 12, 2006 3:45 pm

Well the reason I figured escaped chars was some one said (and I've seen it myself) never underestimate human stupidity so that would have kept the realy use happy clicky idiots out but I think I'll look into wat u guys have proposed and read a little more thanx for the advice it was realy helpfull Very Happy
Nobody's insane its just a different opinion.
Tencati
Newbie
Newbie
 
Posts: 16
Joined: Mon Aug 07, 2006 2:03 am

Postby Tim on Tue Sep 12, 2006 10:50 pm

Code: Select all
<a href="%62%61%72%2E%63%6F%6D">

If that was something like
Code: Select all
<a href="http://%62%61%72%2E%63%6F%6D">

It would work as you wanted. I'm not sure how much of the protocol bit you need, quite possibly only the final / but the above will work as you requested.
User avatar
Tim
root
root
 
Posts: 736
Joined: Thu Mar 10, 2005 6:31 am
Location: Australia

Postby trick on Thu Sep 28, 2006 7:37 pm

Tim: the first example is probably not what he wants.

Say your at http://somesite.com/along/path

the url 'mywebsite.org/coolpage' will take you to http://somesite.com/along/mywebsite.org/coolpage

the url '/mywebsite.org/coolpage' will go to http://somesite.com/mywebsite.org/coolpage

the url //mywebsite.org/coolpage or http://mywebsite.org/coolpage will take you to the right place.

As for the url-encoding, It's not really worth bothering. They can just copy and paste it if they want to, or bookmark the page.
'The military don't start wars. Politicians start wars' - William Westmoreland
Image
trick
Contributer
Contributer
 
Posts: 74
Joined: Mon Aug 07, 2006 6:07 am


Return to General Webmastering

Who is online

Users browsing this forum: No registered users and 1 guest

cron