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. --- 1AOor2.lsl | 8 ++--- 1chatter.lsl | 19 ++++++++++-- 1ring.lsl | 2 -- OhSillyThreatDetector.lsl | 79 +++++++++++++++++++++++++---------------------- ~1ring.command.data.txt | 2 +- 5 files changed, 63 insertions(+), 47 deletions(-) diff --git a/1AOor2.lsl b/1AOor2.lsl index e336ab7..6bc6c2d 100644 --- a/1AOor2.lsl +++ b/1AOor2.lsl @@ -210,10 +210,10 @@ linky(integer num, string message, key id) { if (DEBUG_CHANNEL == num) { - if ("osAvatarPlayAnimation" == message) doAnim = (integer) id; - if ("osAvatarStopAnimation" == message) doAnim = (integer) id; - if ("osForceOtherSit" == message) doSit = (integer) id; - if ("osSetSpeed" == message) doSpeed = FALSE; + if ("osAvatarPlayAnimation" == message) {doAnim = (integer) id; setSetting(Owner, "OSANIM", id, fLINK);} + if ("osAvatarStopAnimation" == message) {doAnim = (integer) id; setSetting(Owner, "OSANIM", id, fLINK);} + if ("osForceOtherSit" == message) {doSit = (integer) id; setSetting(Owner, "OSSIT", id, fLINK);} + if ("osSetSpeed" == message) {doSpeed = (integer) id; setSetting(Owner, "OSSPEEH", id, fLINK);} } if ((id != ScriptKey) && (id != NULL_KEY)) return; list input = llParseStringKeepNulls(message, [lSEP], []); diff --git a/1chatter.lsl b/1chatter.lsl index b41df53..3c89a6f 100644 --- a/1chatter.lsl +++ b/1chatter.lsl @@ -11,6 +11,7 @@ key ScriptKey; key LibraryKey; key Owner; string URL; +key grid; list Commands; integer cNAME = 0; @@ -1106,6 +1107,8 @@ integer doThing(key id, string command, string fr, string cmd, string data, inte dt = llListReplaceList(dt, [], 0, 0); addEvent(time, fr + llDumpList2String(dt, " "), id); } + else if ("OHSILLYPROBE" == cmd) + llMessageLinked(LINK_SET, DEBUG_CHANNEL, "OHSILLYPROBE", llGetKey()); else { sendScript(them, lCMD, fr, [source, id, command, cmd, data]); @@ -1276,6 +1279,7 @@ init() VelTime = llGetTimeOfDay(); VelPos = llGetPos(); addEvent(300, "Musers", ScriptKey); + addEvent(30, "*.OHSILLYPROBE", ScriptKey); URLrequestID = llRequestURL(); } @@ -1288,6 +1292,7 @@ default d("\n\n1chatter resetting client scripts @ " + (string) Start + "\n"); ScriptName = llGetScriptName(); ScriptKey = llGetInventoryKey(ScriptName); LibraryKey = ScriptKey; + grid = osGetGridName(); init(); } @@ -1305,6 +1310,13 @@ d("\n\n1chatter resetting client scripts @ " + (string) Start + "\n"); llResetScript(); if (change & CHANGED_REGION) { + string newGrid = osGetGridName(); + + if (newGrid != grid) + { + grid = newGrid; + addEvent(30, "*.OHSILLYPROBE", ScriptKey); + } llReleaseURL(URL); URL = ""; URLrequestID = llRequestURL(); @@ -1501,8 +1513,9 @@ d("lSCAN " + llDumpList2String(input, " ~ ")); // Catch OhSillyThreatLevel messages, from the probe. if (channel == DEBUG_CHANNEL) { - key root = llList2Key(llGetObjectDetails(id, [OBJECT_ROOT]), 0); - if (llGetLinkKey(LINK_ROOT) == root) +llOwnerSay(message); +// key root = llList2Key(llGetObjectDetails(id, [OBJECT_ROOT]), 0); +// if (llGetLinkKey(LINK_ROOT) == root) { integer f = llSubStringIndex(message, "permission denied. "); if (-1 != f) @@ -1512,7 +1525,7 @@ d("lSCAN " + llDumpList2String(input, " ~ ")); 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); return; } } diff --git a/1ring.lsl b/1ring.lsl index f8bacdf..bd24067 100644 --- a/1ring.lsl +++ b/1ring.lsl @@ -722,8 +722,6 @@ s("YAY! Freeeeeee at last!!!!!"); osMessageObject(LeashKey, "URL|" + data); d("New URL " + URL); } - else if ("OHSILLYPROBE" == cmd) - llMessageLinked(LINK_SET, DEBUG_CHANNEL, "OHSILLYPROBE", llGetKey()); else if ("▲" == cmd) ; else if ((-1 == listFindString(Settings, fr + cmd, sSTRIDE)) && (-1 != set)) 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. diff --git a/~1ring.command.data.txt b/~1ring.command.data.txt index ffd190e..dee2639 100644 --- a/~1ring.command.data.txt +++ b/~1ring.command.data.txt @@ -130,6 +130,6 @@ w 1ring.MENU 31 -1ring.OHSILLYPROBE +1ring.NOP 31 \ No newline at end of file -- cgit v1.1