Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

关于fofax在Windows系统上的使用问题 #18

Open
0xf4n9x opened this issue Mar 6, 2022 · 2 comments
Open

关于fofax在Windows系统上的使用问题 #18

0xf4n9x opened this issue Mar 6, 2022 · 2 comments

Comments

@0xf4n9x
Copy link

0xf4n9x commented Mar 6, 2022

通过管道查询

Windows上通过管道进行查询,这种方式是优先推荐使用的,因为无需任何转义。

CMD

echo app="APACHE-Solr" | fofax.exe -fs 3

PowerShell

echo 'app="APACHE-Solr"' | fofax.exe -fs 5

通过参数指定查询

在 Windows 下使用一定要注意转义,Windows 终端中输入 " 不加转义会消失,所以这种查询方式稍显麻烦

fofax.exe -q 'app="APACHE-Solr"' 		# 输入的内容
FoFa input Query of: app=Grafana 		# 程序实际接收的内容

解决这个问题需要转义,可以添加 -debug 开启详细调试模式。并且在 Windows 系统上,使用不同的终端软件,命令也是有所不同。

在CMD终端上,-q 后面不可以添加单引号 '

fofax.exe -q app=\"APACHE-Solr\" -fs 5

而在 PowerShell 上,-q 后面不仅需要添加单引号,而且对于双引号也要进行转义。

fofax.exe -q 'app=\"APACHE-Solr\"' -fs 5

复杂的查询

当查询语句中存在一些特殊符号(例如 & 或者 |),此时在原生 CMD 终端中无法完成正常的查询,但在 PowerShell 中可以通过管道正常查询。

echo 'app="APACHE-Solr" && country="CN"' | .\fofax.exe -fs 5
echo 'app="APACHE-Solr" && (country="FR" || country="CN")' | .\fofax.exe -fs 5

除此之外,如果有更复杂的查询语句,可以考虑使用文本查询的方式。

.\fofax.exe -qf .\query.txt -fs 5
@nabs-XM
Copy link

nabs-XM commented May 20, 2023

在powershell中复杂查询无法查询中文:
echo '(title="中文") && domain="xx.com" && status_code="200"' | .\fofax.exe -fs 100 -ffi -fto -debug
Fofa Api Query: (title="??") && domain="xx.com" && status_code="200"

@Becivells
Copy link
Member

Becivells commented May 20, 2023

改。windows下的命令问题太多。暂时可以把语句放到文件中比如1.txt 使用fofax.exe -qf 1.txt选项
https://www.zhihu.com/question/54724102 这里也有一些其他选项

@0xf4n9x 0xf4n9x mentioned this issue Jun 5, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants