From 81c77fb62209fff2bcce14e7d9740a5bd86fa381 Mon Sep 17 00:00:00 2001 From: onefang Date: Mon, 6 Sep 2021 21:23:33 +1000 Subject: Rejig how OhSilly detection works. --- OhSillyThreatDetector.lsl | 79 +++++++++++++++++++++++++---------------------- 1 file changed, 42 insertions(+), 37 deletions(-) (limited to 'OhSillyThreatDetector.lsl') diff --git a/OhSillyThreatDetector.lsl b/OhSillyThreatDetector.lsl index 24b3e43..2c808d2 100644 --- a/OhSillyThreatDetector.lsl +++ b/OhSillyThreatDetector.lsl @@ -9,7 +9,7 @@ // Since it sniffs on DEBUG_CHANNEL messages, and a script can't hear any message sent by scripts in the same prim, // you'll need to put this script in a prim without the naughty scripts you want to check. -// Naturally it looks as if OpenSim has decided that scripts sniffing DEBUG_CHANNEL is a bad idee now. +// Naturally it looks as if OpenSim has decided that scripts sniffing DEBUG_CHANNEL is a bad idea now. // Bits of this where taken from the script at the bottom of http://opensimulator.org/wiki/Threat_level @@ -23,32 +23,37 @@ integer WhichProbeFunction; // to tell us which function we're probing // OpenSim lies. list FunctionNames = [ -// "osAvatarName2Key", // low (it fails anyway) - "osAvatarPlayAnimation", // very high - "osAvatarStopAnimation", // very high - "osForceOtherSit", // very high -// "osGetAgentIP", // severe -// "osGetAgents", // none (it fails anyway) - "osGetAvatarList", // none (it fails anyway) - "osMakeNotecard", // high (describes what they where when making this decision) - "osGetNotecard", // very high (describes what they where when making this decision) - "osGetInventoryDesc", // - - "osGetNotecardLine", // very high (describes what they where when making this decision) - "osGetNumberOfNotecardLines", // very high - "osGetRegionSize", // - (it fails anyway) - "osGetRezzingObject", // none (it fails anyway) - "osIsNpc", // - (it fails anyway) - "osKey2Name", // low (it fails anyway) - "osMessageObject", // low (it fails anyway) - "osNpcSit", // high - "osSetSpeed", // moderate - "osTeleportAgent" // severe (it works anyway) + "osAvatarPlayAnimation", // very high + "osAvatarStopAnimation", // very high + "osForceOtherSit", // very high + "osGetAvatarList", // none + "osMakeNotecard", // high (describes what they where when making this decision) + "osGetNotecard", // very high (describes what they where when making this decision) + "osGetNotecardLine", // very high (describes what they where when making this decision) + "osGetNumberOfNotecardLines", // very high (describes what they where when making this decision) + "osGetInventoryDesc", // - + "osGetRegionSize", // - + "osGetRezzingObject", // none + "osIsNpc", // - + "osKey2Name", // low + "osMessageObject", // low + "osNpcSit", // high + "osSetSpeed", // moderate +// "osSetOwnerSpeed", // moderate (not in 0.9.0.2) + "osTeleportAgent", // severe + "osTeleportOwner" // none ]; list FunctionPermitted = []; // 0 = not permitted, 1 = permitted startProbe() { -// llSay(0, "Probing OhSilly threat system to see what OpenSim script functions we are allowed use -"); + string root = llKey2Name(llList2Key(llGetObjectDetails(llGetKey(), [OBJECT_ROOT]), 0)); + + llRegionSay(DEBUG_CHANNEL, "The '" + llGetObjectName() + "' prim in the object called '" + root + + "' belonging to '" + llKey2Name(llGetOwner()) + + "' might be about to spew OhSilly Threat Level system errors on the debug channel. " + + "Blame OpenSim developers for making this script jump through these hoops. Apologies. \n\n" + + "Probing OhSilly threat system to see what OpenSim script functions we are allowed use..."); WhichProbeFunction = -1; integer i = llGetListLength(FunctionNames); FunctionPermitted = []; @@ -73,7 +78,7 @@ default listen(integer channel, string name, key id, string message) { - key root = llList2Key(llGetObjectDetails(id, [OBJECT_ROOT]), 0); +// key root = llList2Key(llGetObjectDetails(id, [OBJECT_ROOT]), 0); // name is the name of the prim, id is the UUID of the prim. // Reports the name and UUID of the prim itself, not the object it's part of. // Naturally can't detect debugs from our own prim, even if it's a different script. @@ -96,9 +101,11 @@ From the source (NOTE: first version has no function name) - ("{0} permission denied. Script creator is not in the list of users allowed to execute this function and prim owner also has no permission.", function ("{0} permission denied. Script permissions error.", function -OpenSim 0.9.1 seems to not even send it to the DEBUG_CHANNEL for scripts anymore. +OpenSim 0.9.1 sends to DEBUG_CHANNEL, but scripts can't read that. +osForceOtherSit permission denied. Script creator is not in the list of users allowed to execute this function and prim owner also has no permission.(script: OhSillyThreatDetector event: timer at <754.7451, 311.6997, 23.24454>) */ - if (llGetLinkKey(LINK_ROOT) == root) +//llOwnerSay(message); +// if (llGetLinkKey(LINK_ROOT) == root) { integer f = llSubStringIndex(message, "permission denied. "); if (-1 != f) @@ -108,7 +115,7 @@ OpenSim 0.9.1 seems to not even send it to the DEBUG_CHANNEL for scripts anymore if (("OSSL" == llList2String(e, 0)) && ("Runtime" == llList2String(e, 1)) && ("Error:" == llList2String(e, 2))) function = llList2String(e, 3); llMessageLinked(LINK_SET, DEBUG_CHANNEL, function, "0"); -llOwnerSay("Found naughty function " + function); + llOwnerSay("Found naughty function " + function); llRegionSay(DEBUG_CHANNEL, "OPENSIM SUCKS!"); } } @@ -152,34 +159,28 @@ llOwnerSay("Found naughty function " + function); t += llList2String(FunctionNames, i) + "() "; } // llSay(0, s); - llSay(0, t); + llOwnerSay(t); return; } // llOwnerSay("Checking OpenSim function " + name + "()"); // say status - if ("osAvatarName2Key" == name) - osAvatarName2Key("John", "Smith"); - else if ("osAvatarPlayAnimation" == name) + if ("osAvatarPlayAnimation" == name) osAvatarPlayAnimation(BogusKey, BogusKey); else if ("osAvatarStopAnimation" == name) osAvatarStopAnimation(BogusKey, BogusKey); else if ("osForceOtherSit" == name) osForceOtherSit(BogusKey, llGetKey()); - else if ("osGetAgentIP" == name) - osGetAgentIP(BogusKey); - else if ("osGetAgents" == name) - osGetAgents(); else if ("osGetAvatarList" == name) osGetAvatarList(); else if ("osMakeNotecard" == name) // Out of order, so the others have something to read. osMakeNotecard("OhSillyThreatCard", [""]); else if ("osGetNotecard" == name) osGetNotecard("OhSillyThreatCard"); - else if ("osGetInventoryDesc" == name) - osGetInventoryDesc("inventory"); else if ("osGetNotecardLine" == name) osGetNotecardLine("OhSillyThreatCard", 0); else if ("osGetNumberOfNotecardLines" == name) osGetNumberOfNotecardLines("OhSillyThreatCard"); + else if ("osGetInventoryDesc" == name) + osGetInventoryDesc("inventory"); else if ("osGetRegionSize" == name) osGetRegionSize(); else if ("osGetRezzingObject" == name) @@ -187,15 +188,19 @@ llOwnerSay("Found naughty function " + function); else if ("osIsNpc" == name) osIsNpc(BogusKey); else if ("osKey2Name" == name) - osKey2Name(BogusKey); + osKey2Name(llGetOwner()); else if ("osMessageObject" == name) osMessageObject(llGetKey(), "G'day."); else if ("osNpcSit" == name) osNpcSit(BogusKey, llGetKey(), 0); else if ("osSetSpeed" == name) osSetSpeed(BogusKey, 1.0); +// else if ("osSetOwnerSpeed" == name) +// osSetOwnerSpeed(1.0); else if ("osTeleportAgent" == name) osTeleportAgent(BogusKey, ZERO_VECTOR, ZERO_VECTOR); + else if ("osTeleportAgent" == name) + osTeleportOwner(ZERO_VECTOR, ZERO_VECTOR); // If we got here, then the timer() handler didn't crash, which means the function it checked for // was actually permitted. So we update the list to indicate that we can use that particular function. -- cgit v1.1