Reputation: 143
I'm trying to reverse engineer a malicious JavaScript. When I initially load the side, JS code is injected that includes the -debugger- statement and injects breakpoints into my chrome developer console.
Reading through stackoverflow
Do you have any ideas how I could analyze / debug the script?
Actually I'm not even able to use the Console from the chrome developer tools because everything freezes.
Upvotes: 8
Views: 10934
Reputation: 31
visit chrome://version/
check v8 version
building v8 from source
edit src/ast/ast.h
class DebuggerStatement final : public Statement {
private:
friend class AstNodeFactory;
friend Zone;
-- explicit DebuggerStatement(int pos) : Statement(pos, kDebuggerStatement) {}
++ explicit DebuggerStatement(int pos) : Statement(pos, kEmptyStatement) {}
};
building v8 again
diff out.gn/x64.release/d8
patch chromium binary
Upvotes: 1
Reputation: 8539
you probably found the option to right-click the line next to the debugger
statement and select "Never pause here".
however if blackboxing does not work for you - the above won't work either.
you can use blackbox with a regex pattern, if applicable.
it probably won't work either because malicious codes often use window.eval
. in that case you override the window.eval
yourself. for example
window.eval=x=>console.log(x);
Upvotes: 6