How to stop data copy ?

Started on the old forum in January 2012 · view the original in the archive · old links redirect here

14 replies · 1,205 views · started 14 years ago · 1 min read

7 participants
tejassoni Junior · 29 posts #1

Frds some people has copy my site data. Now how to safe my site data from mass data copier script ?

plz buddy.

i knw that ek code aata he jo load.php me add krne ka hota he but i havnt that code.

mFreak Developer · 66 posts #2

If you provide direct links to files anybody can make a data copier. dont use direct links.

$("#mfreak").find(".head brain").clone();

Progress:

[|||___________________________] : 5%

Output:

Memory limit reached, unable to complete operation.

Support answer:

Try using a super uber strong mega computer to reach at least 10%.

👋

tejassoni Junior · 29 posts #3

i dont use direct links. But some people copy data from mass data copier.

now any soluction ?

mFreak Developer · 66 posts #4

Could you suply us with your site url?

$("#mfreak").find(".head brain").clone();

Progress:

[|||___________________________] : 5%

Output:

Memory limit reached, unable to complete operation.

Support answer:

Try using a super uber strong mega computer to reach at least 10%.

👋

farukhbhai Newbie · 3 posts #5

Abe Saale Ek File bana .htaccess Apne Root Folder me jaha Script rakhi hai Aur Ye Code Paste kar de Uss me Aur Save kar dena File Name Sshould be .htaccess

Code is :

ErrorDocument 404 Domain

tejassoni Junior · 29 posts #6

@dont use up words. And i knw .httaccss trick.

but it not working.

GumSlone Administrator Principal · 1,690 posts #7

farukhbhai wrote: Abe Saale Ek File bana .htaccess Apne Root Folder me jaha Script rakhi hai Aur Ye Code Paste kar de Uss me Aur Save kar dena File Name Sshould be .htaccess

Code is :

ErrorDocument 404 Domain

next time write your posts in English

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

antony2kx Developer · 94 posts #10

It called hot link protection

there are several methods of doing this 1. is to not use direct links for example

http://bla.com/files/thebones.gif

that could be http://bla.com/file.php?name=thebones.gif or http://bla.com/file.php?id=1etc

this way you could check a number of things

if this is has not been lead to from your site (referer) then you could just kill the request for example

file.php
<?php

$name = isset($_GET['name']) ? trim($_GET['name']) : null;

if($name===null)
{
  die();
}
else
{
   if(isset($_SERVER['HTTP_REFERER']) && preg_match("/bla\.com/", $_SERVER['HTTP_REFERER']))
   {
      if(file_exists("some_directory/$name"))  
      { 
          header("location:some_directory/$name");
          exit;
       }
        else
      {
         die();
         // kill file request file does not exists
      }
   }

}

?>

that example could be altered using a curl request

so there are others ways like using an md5 check some

generating a random key

like $session['key'] = uniqid(); //everytime someone visits the site //store this in datbase and then check upon file downloads

please use your head

GumSlone Administrator Principal · 1,690 posts #11

antony2kx wrote: It called hot link protection

there are several methods of doing this 1. is to not use direct links for example

http://bla.com/files/thebones.gif

that could be http://bla.com/file.php?name=thebones.gif or http://bla.com/file.php?id=1etc

this way you could check a number of things

if this is has not been lead to from your site (referer) then you could just kill the request for example

file.php
<?php

$name = isset($_GET['name']) ? trim($_GET['name']) : null;

if($name===null)
{
  die();
}
else
{
   if(isset($_SERVER['HTTP_REFERER']) && preg_match("/bla\.com/", $_SERVER['HTTP_REFERER']))
   {
      if(file_exists("some_directory/$name"))  
      { 
          header("location:some_directory/$name");
          exit;
       }
        else
      {
         die();
         // kill file request file does not exists
      }
   }

}

?>

that example could be altered using a curl request

so there are others ways like using an md5 check some

generating a random key

like $session['key'] = uniqid(); //everytime someone visits the site //store this in datbase and then check upon file downloads

please use your head

nice code example, but you need to extend it, you should enable empty referrer,

also if the referrer url looks like this:

http://another-domain.com/?bla.com

it will be detected as a valid referrer by your code.

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

antony2kx Developer · 94 posts #12

GumSlone wrote: nice code example, but you need to extend it, you should enable empty referrer,

also if the referrer url looks like this:

http://another-domain.com/?bla.com

it will be detected as a valid referrer by your code.

i understand you completely gumslone using ^ as negation sign will tell the script that the url must look like that from start

edited code

<?php

$name = isset($_GET['name']) ? trim($_GET['name']) : null;

if($name===null)
{
  die();
}
else
{
   $ref = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ' ';
   $host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : ' ';
   $pragma = isset($_SERVER['HTTP_PRAGMA']) ? $_SERVER['HTTP_PRAGMA'] : ' ';
   if($ref!==' ' && preg_match("/^bla\.com/i", $ref) && preg_match("/^bla\.com/i", $host) && $pragma=='no-cache') // this should prevent it
   {
      if(file_exists("some_directory/$name"))  
      { 
          header("location:some_directory/$name");
          exit;
       }
        else
      {
         die();
         // kill file request file does not exists
      }
   }

}

?>

Added after 22 minutes:

another way is to use object relation database

for example

creating an instance of a file each time it is request

so a table called

temp_downloads

file_name file_path exp_time link

when user click download link

insert info into temp table

then generate a link to that file

mysql_query("DELETE FROM temp_downloads WHERE exp_time<'".time()."'");

http://bla.com/file.php?link=jdhdjhgd

$link = isset($_GET['link']) ? mysql_real_escape_string(trim($_GET['link'])) : '';

$query = mysql_query("SELECT file_path FROM temp_downloads WHERE link='".$link."'");

if(mysql_num_rows($query)>0)
{
   $file_object = mysql_fetch_object($query);
   if(file_exists($file_object->file_path))
   {
      header("location:$file_object->file_path);
      exit;
   }
   else
   { 
       echo "file does not exists";
   }
}
else
{
   echo "link has expired";
}

after all this then u can pretty the url using rewrite engine

RewriteEngine on

RewriteRule ^file.php?link=([a-zA-z0-9]+)$?    file/$1 [L]
tejassoni Junior · 29 posts #13

thanx buddy. But where place i add dis code ?

my site download file is load.php and file id is load.php?id=2352 etc.

arnage Lead · 811 posts #14

tejassoni wrote: thanx buddy. But where place i add dis code ?

my site download file is load.php and file id is load.php?id=2352 etc.

Ahhh come on! Why are you asking for questions when you don't have a clue what to do with the answer?!

This is the ultimate help for you: ULTIMATE HELPER 😛

<!DOCTYPE html PUBLIC "-//***WAPFORUM**.**RS***

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close