1. Using the .htaccess file
2. By a core hack
1. Using the .htaccess file
The first and easy method is using the .htraccess file. Most of you may have known that there is a file called htaccess.txt is in your Joomla root. Rename it to the .htaccess and open in favorite text editor .Add the following code :
##### Start ?tp=1 prevention ######
RewriteCond %{QUERY_STRING} tp=(.*)
RewriteRule ^(.*)$ index.php [F,L]
##### End ?tp=1 prevention ###### Please note that not every hosting is not supporting .htaceess and there is a chance that your site may goes down after incluiding this and also this trick will not work for all cases.