Computer Science Canada

[Tutorial] Password Protecting Your Pages

Author:  void [ Sun May 25, 2003 4:19 pm ]
Post subject:  [Tutorial] Password Protecting Your Pages

This is a VERY simple way to pass protect your web page..not very attractive but it works
code:

<html>
<head>
<title>password 1</title>
<script LANGUAGE="javascript">
var wrong="pass1.htm";   
// password...   
var password="WHAT";   
// prompts the user this...   
var name = prompt("WHAT is the password???","");   
// if... else statement... right, confirm this, wrong, go to wrong...   
if (name == password) {(confirm("Welcome!"))}   
else {location.href=wrong}
</script>
</head>
<body>
<p>
YOU HAVE CORRECTLY GUESSED THE PASS WORD
</body>
</html>

The password is "WHAT" copy the program to ur text document and save as pass1.htm NOT pass1.html, if you do then change the variable wrong to pass1.html because thats the site that its redirected to when the pass is wrong

Edit:
Note: THIS IS NOT A FOOLPROOF METHOD!!!
It is easy to bypass, If you very important things to protect, use .ht access & .htpasswd, as it is harder to get through. But if it is not available, I guess this will have to do

Author:  JSBN [ Sun May 25, 2003 4:28 pm ]
Post subject: 

while u did forget my little warning which i added, it is good. +5

Author:  void [ Sun May 25, 2003 4:32 pm ]
Post subject: 

i thought ppl would realize that coz i said "VERY simple" program...as in it not very complex encrypting..thus making it easy to bypass, in fact, if your smart enough, you can save the web page to your desktop, then edit the page and remove the pass script and then reload the site.....(beginners hacking...lolz)...ill save the MODS breath

MY EDIT: WE DO NOT ENCOURAGE HACKING, IN FACT WE CONDEMN IT EVEN THO MORE THAN HALF OF US DO IT Wink LOLZ (you cant sue us now!!)

Author:  PHP God [ Mon May 26, 2003 6:55 am ]
Post subject: 

I would have taken bits. He just practically taught us all how those little passwrods work that PPL have on geocities. jk man. I've seen that tut b4 tho.

Author:  octopi [ Mon May 26, 2003 10:33 pm ]
Post subject: 

Best way, is to use apache itself

Make a '.htaccess' file


code:
AuthType Basic
AuthUserFile /path/to/your/directory/.htpasswd
AuthName "Members Area"
require valid-user


you will need to encrypt the password using the crypt function of Perl.
http://www.hof-berlin.de/crypt.php3
will do it for you.

Author:  Homer_simpson [ Mon May 26, 2003 10:45 pm ]
Post subject: 

how to hack a page protected that way :
open the page goto view > source copy and paste the page and remove the password part... i think that would do =/

Author:  JSBN [ Tue May 27, 2003 6:52 am ]
Post subject: 

actually... homer, .htpasswd & .htaccess files are a little more complicated than that. because there will still be a .htacess file on the server. You cant remove it.

Author:  Homer_simpson [ Tue May 27, 2003 7:26 am ]
Post subject: 

no, i'm talking about the first way that was mentioned...

Author:  CHUTHAN20 [ Fri May 28, 2004 7:59 pm ]
Post subject:  simple

visit this address to almost evrything.


[url]http://www.dynamicdrive.com
[/url]

Author:  blackwhite [ Tue Jul 13, 2004 5:30 pm ]
Post subject: 

hotscripts has some cool pwd protecting scripts. actually, they have everything.


: