PDA

View Full Version : Hack by subdomains.



kotel
08-21-2008, 01:44 AM
Situation, i have domain : super.com (who have a big PR).
I create user, and this user can create subdomain :any.super.com!!!

It's very bad!Because users can upload DORWAYS.

How i can solve this problem? How i can decline create subdomain for domen if user no owner of this domain?

smtalk
08-21-2008, 02:03 AM
http://help.directadmin.com/item.php?id=203

kotel
08-21-2008, 02:28 AM
Thank you very much!But i found errors in this faq.
First, file must have name domain_create_pre.sh (!).

And then i modified script to "multi check" (if you have more than 1 domain name for checking), use :

#!/usr/local/bin/php
<?
$reserved = array('');
$domain = getenv("domain");
$res=FALSE;

for ($i=0;$i<=count($reserved)-1;$i++)
{
if(strstr($domain, ".".$reserved[$i]))
{
$res=TRUE;
}

}

if ($res === FALSE) { exit(0); }
else
{
echo "SAS SAYS:Sorry it's not your domain name!";
exit(1);
}
?>




You can insert in array $reserved unlimited count of domain names ;)