oalabs / frida-wshook Goto Github PK
View Code? Open in Web Editor NEWScript analysis tool based on Frida.re
Script analysis tool based on Frida.re
Hello,
First of all, thank you very much for releasing frida-wshook.
I've tried to run the script with the current version of frida.re (12.6.16) and it seems that the script does not work correctly with this version.
I've managed to get it to successfully run with an older version of frida by using a pip install frida==10.1
to force a downgrade successfully.
I've tested with a simple ShellExec script (testing.js
)
var shell = WScript.CreateObject("WScript.Shell");
shell.Run("calc.exe");
And here is the result:
> C:\Python27\python.exe .\frida-wshook.py .\testing.js
[*] x64 detected..using SysWOW64
[*] Setting Script Vars...
Setting Script Vars...
[*] Hooking Process 4992
Press ctrl-c to kill the process...
Microsoft (R) Windows Script Host Version 5.812
Copyright (C) Microsoft Corporation. All rights reserved.
[!] Warning: Instrumentation script has been destroyed!
[!] CScript process has terminated!
process-terminated
Traceback (most recent call last):
File ".\frida-wshook.py", line 53, in on_detach
print ' |- Process Id: %s' % message.pid
AttributeError: 'unicode' object has no attribute 'pid'
I believe the format of some structures changed in frida which requires probably some changes in the script. Additionally, I had to prefix script vars such as "ADDRESS_FAMILY" with "var " in order to remove some errors.
Dropping this issue for awareness - I will try to get a pull request if I get more time to look at it.
1、add 'var' before js var for example NAMESPACE
2、del 'stdcall'
3、detached callback seems change the parameters,only leave 'reason' parameter left
Some scripts which call WScript.Shell.Run can cause an error to be thrown when the WaitOnReturn Parameter is set to True causing the command to be run synchronously
Example:
Set oShell = CreateObject("WScript.Shell") oShell.Run "cmd /c ping.exe 127.0.0.1 -n 250 > nul",0,1 WScript.Quit 0
Error: wsrun_fail.vbs(3, 1) WshShell.Run: Unable to wait for process.
Workaround
To work around the issue you can insert On Error Resume Next
the line before the command which throws the error.
Although frida-wshook is hooking the windows API call, The error looks to be thrown before ShellExecute is called.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.