Hack by subdomains.

kotel

Verified User
Joined
Sep 15, 2006
Messages
27
Location
Russia
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?
 
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 :
PHP:
#!/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 ;)
 
Last edited:
Back
Top