Skip to content
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

Fastjson POC添加后{dnslogserver}变量不生效 #90

Closed
ThestaRY7 opened this issue Jul 31, 2024 · 2 comments
Closed

Fastjson POC添加后{dnslogserver}变量不生效 #90

ThestaRY7 opened this issue Jul 31, 2024 · 2 comments

Comments

@ThestaRY7
Copy link

场景

我设置了

  • Key项为DNSlogServer,Value项为我的dnslog地址
  • Key项为fastjson-test,Value项为{"@type":"java.net.Inet4Address","val":"{dnslogserver}"}

此时,我在Repeater重放模块,调用fastjson-test时,理想情况应该是输出:
{"@type":"java.net.Inet4Address","val":"xxxxxx.dnslog.cn"}
但是出现了异常情况,仍然显示:
{"@type":"java.net.Inet4Address","val":"{dnslogserver}"}

问题

经过测试,原因是Value项出现了两个中括号{},因此导致{dnslogserver}变量没有被替换成该项的值。

我的解决方法

目前我的解决方法:

  • Key项为fastjson-test,Value项为"@type":"java.net.Inet4Address","val":"{dnslogserver}"

自己手动补充{},达到能用的效果(又不是不能用.jpg),但希望作者能修复一下这个问题,作者辛苦了。

@coutcin-xw
Copy link
Contributor

我这边修复了这个问题,是正则匹配语句的问题,相关代码已经给作者Pull,如果紧急也可以查看我这边fork的仓库
https://github.com/coutcin-xw/knife

bit4woo added a commit that referenced this issue Aug 1, 2024
@bit4woo
Copy link
Owner

bit4woo commented Aug 1, 2024

我将正则匹配改成了字符串匹配,避免在复杂的数据格式中再次出现问题。

@bit4woo bit4woo closed this as completed in 7cca1df Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants