Skip to content

Instantly share code, notes, and snippets.

@kohyuk91
Last active February 19, 2021 03:29
Show Gist options
  • Save kohyuk91/9edafe88c3601fe813f871ae662214ef to your computer and use it in GitHub Desktop.
Save kohyuk91/9edafe88c3601fe813f871ae662214ef to your computer and use it in GitHub Desktop.
Dealing with Maya Malicious Script Nodes
// Sets the scriptJob ID for the exploit to an invalid value, so Maya never actually runs the malicious code.
global int $autoUpdateAttrEd_aoto_int;
$autoUpdateAttrEd_aoto_int = -1;
from maya import cmds , mel
import maya.OpenMaya
mel.eval("global int $autoUpdateAttrEd_aoto_int;$autoUpdateAttrEd_aoto_int = -1;")
def killMaliciousScriptNodes(clientData):
maliciousScriptNodes = cmds.ls(["vaccine_gene", "breed_gene", "MayaMelUIConfigurationFile"], typ="script")
for maliciousScriptNode in maliciousScriptNodes:
cmds.delete(maliciousScriptNode)
print("Deleted {}".format(maliciousScriptNode))
maya.OpenMaya.MSceneMessage.addCallback(maya.OpenMaya.MSceneMessage.kAfterSceneReadAndRecordEdits, killMaliciousScriptNodes)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment