Skip to content

Instantly share code, notes, and snippets.

@TUGOhost
Created September 8, 2022 05:30
Show Gist options
  • Save TUGOhost/9daaff96b137ea085eb54ddc874444f4 to your computer and use it in GitHub Desktop.
Save TUGOhost/9daaff96b137ea085eb54ddc874444f4 to your computer and use it in GitHub Desktop.
anti anti-frida
function antiAntiFrida() {
var strstr = Module.findExportByName(null, "strstr");
if (null !== strstr) {
Interceptor.attach(strstr, {
onEnter: function (args) {
this.frida = Boolean(0);
this.haystack = args[0];
this.needle = args[1];
if (this.haystack.readCString() !== null && this.needle.readCString() !== null) {
if (this.haystack.readCString().indexOf("frida") !== -1 ||
this.needle.readCString().indexOf("frida") !== -1 ||
this.haystack.readCString().indexOf("gum-js-loop") !== -1 ||
this.needle.readCString().indexOf("gum-js-loop") !== -1 ||
this.haystack.readCString().indexOf("gmain") !== -1 ||
this.needle.readCString().indexOf("gmain") !== -1 ||
this.haystack.readCString().indexOf("linjector") !== -1 ||
this.needle.readCString().indexOf("linjector") !== -1) {
this.frida = Boolean(1);
}
}
},
onLeave: function (retval) {
if (this.frida) {
retval.replace(ptr("0x0"));
}
}
})
console.log("anti anti-frida");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment