# ja-netfilter 2022.2.0
### A Java Instrumentation Framework
## Usage
* download from the [releases page](https://gitee.com/ja-netfilter/ja-netfilter/releases)
* add `-javaagent:/absolute/path/to/ja-netfilter.jar` argument (**Change to your actual path**)
* add as an argument of the `java` command. eg: `java -javaagent:/absolute/path/to/ja-netfilter.jar -jar executable_jar_file.jar`
* some apps support the `JVM Options file`, you can add as a line of the `JVM Options file`.
* **WARNING: DO NOT put some unnecessary whitespace characters!**
* or execute `java -jar /path/to/ja-netfilter.jar` to use `attach mode`.
* for **Java 17** you have to add at least these `JVM Options`:
```
--add-opens=java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED
--add-opens=java.base/jdk.internal.org.objectweb.asm.tree=ALL-UNNAMED
```
* edit your plugin config files: `${lower plugin name}.conf` file in the `config` dir where `ja-netfilter.jar` is located.
* the `config`, `logs` and `plugins` directories can be specified through **the javaagent args**.
* eg: `-javaagent:/path/to/ja-netfilter.jar=appName`, your config, logs and plugins directories will be `config-appname`, `logs-appname` and `plugins-appname`.
* if no javaagent args, they default to `config`, `logs` and `plugins`.
* this mechanism will avoid extraneous and bloated `config`, `logs` and `plugins`.
* run your java application and enjoy~
## Config file format
```
[ABC]
# for the specified section name
# for example
[URL]
EQUAL,https://someurl
[DNS]
EQUAL,somedomain
# EQUAL Use `equals` to compare
# EQUAL_IC Use `equals` to compare, ignore case
# KEYWORD Use `contains` to compare
# KEYWORD_IC Use `contains` to compare, ignore case
# PREFIX Use `startsWith` to compare
# PREFIX_IC Use `startsWith` to compare, ignore case
# SUFFIX Use `endsWith` to compare
# SUFFIX_IC Use `endsWith` to compare, ignore case
# REGEXP Use regular expressions to match
```
## Debug info
* the `ja-netfilter` will **NOT** output debugging information by default
* add environment variable `JANF_DEBUG=1` (log level) and start to enable it
* or add system property `-Djanf.debug=1` (log level) to enable it
* log level: `NONE=0`, `DEBUG=1`, `INFO=2`, `WARN=3`, `ERROR=4`
## Debug output
* the `ja-netfilter` will output debugging information to the `console` by default
* add environment variable `JANF_OUTPUT=value` and start to change output medium
* or add system property `-Djanf.output=value` to change output medium
* output medium value: [`NONE=0`, `CONSOLE=1`, `FILE=2`, `CONSOLE+FILE=3`, `WITH_PID=4`]
* eg: `console` + `file` + `pid file name` = 1 + 2 + 4 = 7, so the `-Djanf.output=7`
## Plugin system
* for developer:
* view the [scaffold project](https://gitee.com/ja-netfilter/ja-netfilter-sample-plugin) written for the plugin system
* compile your plugin and publish it
* just use your imagination~
* for user:
* download the jar file of the plugin
* put it in the subdirectory called `plugins` where the ja-netfilter.jar file is located
* enjoy the new capabilities brought by the plugin
* if the file suffix is `.disabled.jar`, the plugin will be disabled
没有合适的资源?快使用搜索试试~ 我知道了~
Java Instrumentation Framework.rar
共39个文件
java:30个
txt:2个
xml:1个
需积分: 5 0 下载量 105 浏览量
2023-06-20
06:25:49
上传
评论
收藏 44KB RAR 举报
温馨提示
反射提供的功能,能在运行时(动态)的 1.获取一个类的所有成员变量和方法 2.创建一个类的对象 a.获取对象成员变量&赋值 b.调用对象的方法 c.判断对象所属的类 在注入内存马的过程当中,我们可能需要用到反射机制,例如注入一个servlet型的内存马,我们需要使用反射机制来获取当前的context,然后将恶意的servlet(wrapper)添加到当前的context的children中。 在使用Java反射机制时,主要步骤包括: ①获取 目标类型的Class对象 ②通过 Class 对象分别获取Constructor类对象、Method类对象 & Field 类对象 ③通过 Constructor类对象、Method类对象 & Field类对象分别获取类的构造函数、方法&属性的具体信息,并进行后续操作 2.3.2 java instrumentation Instrumentation是Java提供的一个来自JVM的接口,该接口提供了一系列查看和操作Java类定义的方法,例如修改类的字节码、向classLoader的classpath下加入jar文件等。
资源推荐
资源详情
资源评论
收起资源包目录
Java Instrumentation Framework.rar (39个子文件)
Java Instrumentation Framework
新建文本文档.txt 19B
ja-netfilter-master
mvnw.cmd 7KB
pom.xml 7KB
src
main
resources
6c81ec87e55d331c267262e892427a3d93d76683.txt 0B
java
com
janetfilter
core
Initializer.java 1KB
Dispatcher.java 4KB
Environment.java 3KB
utils
ProcessUtils.java 2KB
WhereIsUtils.java 2KB
StringUtils.java 989B
DateUtils.java 2KB
commons
ConfigParser.java 3KB
DebugInfo.java 8KB
enums
RuleType.java 584B
plugin
PluginClassLoader.java 1KB
PluginManager.java 4KB
PluginEntry.java 486B
MyTransformer.java 3KB
PluginConfig.java 691B
models
FilterRule.java 1KB
rulers
SuffixICRuler.java 228B
Ruler.java 149B
EqualICRuler.java 207B
KeywordICRuler.java 229B
KeywordRuler.java 199B
RegExpRuler.java 239B
SuffixRuler.java 198B
PrefixRuler.java 200B
PrefixICRuler.java 230B
EqualRuler.java 195B
attach
VMLauncher.java 3KB
VMDescriptor.java 960B
VMSelector.java 4KB
Launcher.java 3KB
LICENSE 34KB
.mvn
wrapper
maven-wrapper.properties 1020B
mvnw 10KB
.gitignore 72B
README.md 3KB
共 39 条
- 1
资源评论
野生的狒狒
- 粉丝: 3393
- 资源: 2436
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- (源码)基于ESP8266的WebDAV服务器与3D打印机管理系统.zip
- (源码)基于Nio实现的Mycat 2.0数据库代理系统.zip
- (源码)基于Java的高校学生就业管理系统.zip
- (源码)基于Spring Boot框架的博客系统.zip
- (源码)基于Spring Boot框架的博客管理系统.zip
- (源码)基于ESP8266和Blynk的IR设备控制系统.zip
- (源码)基于Java和JSP的校园论坛系统.zip
- (源码)基于ROS Kinetic框架的AGV激光雷达导航与SLAM系统.zip
- (源码)基于PythonDjango框架的资产管理系统.zip
- (源码)基于计算机系统原理与Arduino技术的学习平台.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功