What is ptap? ptap (Protector Tap) is a standard function to be used by authors of security patches. Once they trap an intrusion, they call ptap function which automatically bans the offending ip.
Do I need Protector? ptap writes the IP number into Protector. If Protector does not exist, then the information is emailed to admin.
Can I employ ptap in my existing code? Yes, find the existing security patches, e.g. "intvar[$_Get...]" and modify them to use the function. The next post will have an example of use.
function ptap($comments, $severity_level) {
//protector tap, intercepts hack attempts and writes them to Protector tables, and/or emails admin
//Version 1.0 March 29, 2004
//By: steven11
//input: $comments: add comments to make clear what the problem is
//$severity_level: B (for Ban), W (for warning, don't ban, just send warning to admin)
global $db, $prefix, $userdata;
$send_always = 1; //<< set this to one, to always send a message to admin
//does Protector exist
$protector= file_exists("banned.gif"); //database independ. way of doing things...
$severity_level = strtoupper($severity_level); //prevent input case problem
if (intval($HTTP_GET_VARS[POST_TOPIC_URL]).'' != $HTTP_GET_VARS[POST_TOPIC_URL])
ptap("hack attemp here", "B");
Note: to make the "not equate" above work, note the (.'') !!
How to test? Just view a topic, and then manipulate the 't' parameters in the URL: make it non-numeric e.g. t=12aabb instead of t=123
this will result in the offending IP being banned. If you do it from your own pc, you can still get into admin, at which place you can simply delete the entry (via Protector).
Hi EscortCossie,
Glad you see this as having value. Just use the code before you use Raven's (I have not looked at Raven's but this should work), and comment out the "exit" (one before the last line). Then the code would put the offending IP into Protector, and simply come back to you.
(note: you can also comment out email(....) if you wish, not to get duplicate emails).
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum