PDA

View Full Version : Web Designer Protection Script. PHP and ASP


nsr81
09-24-2001, 08:35 PM
Hi everybody,

In one of my previous posts, I asked if someone could translate an ASP script into PHP for me. Well I got "lemon" to do just that.
He has translated the ASP script into PHP and made it shorter by dropping one of the three ASP files. Thank so much for that buddy.
Anyway, Here goes:

Description:
========
A server side script designed to give the web designer a chance to get back at those customers who don't pay or do something else to piss the designer off.

Authors:
=====
ASP version : the original version written by "Dm" of www.guistuff.com forums.
PHP version: Translated and modified from the original version by our very own lemon (http://forum.100megswebhosting.com/member.php?s=&action=getinfo&userid=191).

Files:
===
Attached are: Protect_asp.zip and Protect_php.zip
Protect_asp.zip has 3 ASP files which I have not gone into to learn how to use.
Protect_php.zip has 2 PHP files, index.new, and readme.txt.

How To:
=====
These are the comments directly from lemon (http://forum.100megswebhosting.com/member.php?s=&action=getinfo&userid=191)'s email on how to use the script.

Some words about the original script:

This script deletes only file the name you have provided. You have to pass the names of the files one-by-one to the protection script (this is pissing off more than a customer who doesn't pay). I could make script more independent - I mean you are running it and it goed through the directory on the web and deletes anything it meets on his way :)
This script doesn't generate any html file with explanation why site is down. I am not sure that it is possible to create a new page using PHP, that is why I will use rename function applying it to the file index.new
There is seems to be a mistake in the decoding script (maybe it is made by me). It is really very interesting and I will find out where the mistake is, but while this encryption is made only to protect your script being executed by another user and it won't protect your script in case your site will be hacked and someone will get the code of the script. That is why I can't see the reason why I should use so heavy script to encode pair words. I can offer to you to use base64_encode function to encrypt your information. It will give you less protection, but in this case it doesn't matter. As I have said - if your site wasn't hacked - nobody will know the password you are using. And you can also reverse symbols in the string before encoding using strrev function. Just another protection :) Don't forget, that the best protection ever created - is not to say anyone you have placed this script on the web site :)
Anyway - these 2 .php files attached are doing absolutely the same job and has absolutely the same structure as that 3 .asp files provided by you. Sorry it took so long, but I was trying to find a bug in the first version.

index.html - the file to be deleted [ replace it with index.php if necessary, you won't find it in the zip file, since it will already be there]
index.new - the file to be renamed [ costumize this file anyway you want using html and/or php]

Password for protect.php is "password" [don't forget to change it.]

Run this page: gencommand.php?pass=password&file=index.html

You will get the code to put into your web browser's address line.

Copy it there and hit enter. Old index.htm will be removed and index.new file will be renamed to index.html.

This is even more than that script does :) I hope you will be able to modify it the way you want :)


My comments are in [ ].
This will be an ongoing project as it should accept a directory and delete the contents of directory recursively. If any of you guys modify this script please let the rest of us know about any advances you make. I'll do the same if I'm successfull at making any changes.

Regards,

nsr81

nsr81
09-24-2001, 08:36 PM
Sorry, vB allows to attach only one file per post.

Here's the second attachement: protect_php.zip.

lemon
10-02-2001, 04:58 AM
Just took a look at the code once again. There was a mistake in protect.php file. Instead of using is_null, we should use !isset. Sorry for that. The corrected file is being attached.

Regards,
:)

lemon
10-02-2001, 04:59 AM
That was not a critical mistake, but anyway... :)