The invention provides a dynamically updated
byte code security protection method, which comprises the following steps of: loading an agent program when an application program is started, acquiring and caching an
instrumentation object, receiving security detection logic and
instrumentation configuration information issued by a management end by the agent program through a communication mechanism with the management end, and storing the security detection logic and the
instrumentation configuration information in the application program; and the agent program translates the instrumentation logic issued by the management end into
byte codes by using the
byte code operation
library, generates a class file conversion object containing the instrumentation logic, registers the class file conversion object into an instrumentation object, and calls a class re-
conversion method of the instrumentation object to perform
byte code updating on a target class, thereby realizing dynamic
insertion of the instrumentation logic. And the updated
byte code takes effect immediately, and security vulnerabilities in the target method are detected and protected in real time. According to the method, the capability of quickly responding to the 0Day
vulnerability and blocking the 0Day
vulnerability in real time is realized, and the time for updating the protection logic is greatly shortened.