-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide a CLI version #5
Comments
Hey there, any updates? |
Working on it! Hoping to have something to show soon. |
Just a quick update: I've added CLI support on the cli branch. I still need to test it against a larger set of files, so I'm not sure yet if there are unexpected issues. If you want to try it out, set it up like so:
The CLI script is located at lib/index-cli.js:
Once I'm confident it works as the webinterface does I will merge branch cli into master. Binary downloading/extraction will be added later |
Is there any requirements on nodejs?
|
Yes, you need at least Node 6.4 because it uses quite a few new features. If you're on Windows, get the latest "Current" version (8.1.x right now). If you're on Linux, you're better off building Node from source with this guide: https://github.com/nodejs/node/blob/master/BUILDING.md#building-nodejs-on-supported-platforms because most packages from package-managers are a bit out-of-date |
Thanks, I'll try a newer version. I'm on Mac, installed nodejs with homebrew |
It works, but for scripts like this,
Will there be actual output? So far the output looks like what a disassembler does,
|
That is what the output for the tracer should look like. It traces all function calls, as well as getting and setting values. (Note: the first 7 lines are always the same because of initializing WScript). It emulates its behaviour, but it is not a port of WScript. Objects and methods take the same arguments, return the expected value, throw the same errors etc as the original would. In addition to that, filesystem operations work as expected as well, but with a fake filesystem. The intended use-case is that you have a heavily obfuscated script, and instead of de-obfuscating it to see what it does (which can take quite a while even for experienced javascript deobfuscators), you simply run it against the emulator to see what is going on inside. In your example WScript.Echo takes arguments and returns For a more complete example, run the file called 'malwareExample.js' in the testfiles folder. This is a full de-obfuscated malware-downloader with its URLs removed, so it won't infect your machine but it shows exactly what the emulator is made to do. |
Thanks, I see why created this tool. I'll do more tests :-) |
Create a version of the emulator that can be run on command line.
Example usage:
wscript -i inputscript.js -o outfilename
which will then generate the files
outfilename-tracer.js
andoutfilename-vfs.json
Possible options:
Perhaps an option that does actually download files if the script asks for it? Would have to be a very explicit flag that isn't accidentally used
The text was updated successfully, but these errors were encountered: