halis duraki/
- 0xduraki
Byteman is a bytecode manipulation tool for tweaking and changing Java application at load time and runtime. It work without the needs for recompilation. The modification is purely in memory, via Event Condition Action rule language - based on Java.
Write ECA based rules which you can inject using Byteman directives and command line application.
# => trace.btm
RULE trace main entry
CLASS ^CognitiveApp
METHOD main
AT ENTRY
IF TRUE
DO traceln("Byteman: Application loaded successfully. java.application.main() called.")
ENDRULE
Replace the CognitiveApp with any class handling the Main application login. Use JD-GUI to find for main()
functions. It’s important to leave ^
char because it indicates the regex pattern.
The following registers exists:
*.shortcut
%JAVABYTE_HOME%
environment in Windows/Linux (ie. setx
on Windows, or export
on Linux)bminstall.bat $PID
to inject Byteman in the JVM runtimebmsubmit.bat ..\scripts\trace.btm
to register Byteman scripttraceln
tagged calls# => WinNT injection example
> cd byteman/bin
> bminstall.bat $PID
> bmsubmit.bat ..\scripts\trace.btm
Cannot locate byteman JBoss modules plugin jar
redefine rule trace main entry
List of scripts and usage on Byteman Scripts. Just for reference.