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

【bug】使用python api #78

Closed
jiemo9527 opened this issue Apr 20, 2024 · 13 comments
Closed

【bug】使用python api #78

jiemo9527 opened this issue Apr 20, 2024 · 13 comments
Labels
bug Something isn't working

Comments

@jiemo9527
Copy link

当查询语句中有&& after="2024-04-01"时,则报错
File "C:\Python311\Lib\site-packages\fofa_hack-0.0.1-py3.11.egg\fofa_hack\fofa.py", line 95, in api
File "C:\Python311\Lib\site-packages\fofa_hack-0.0.1-py3.11.egg\fofa_hack\fofa.py", line 22, in get_timestamp_list
TypeError: string indices must be integers, not 'str'

确认之前是没有这种情况的

@purepoorx
Copy link

purepoorx commented Apr 20, 2024

官方限制了,昨天还没问题。原来每页100,前段时间又被限制到20Screenshot_2024-04-20-22-11-27-880_com.microsoft.emmx.jpg

@Cl0udG0d
Copy link
Owner

啊哈 才看到这个issue

刚才测试了一下 看来fofa官方注意到了这一点并且开始禁止大家使用fofa-hack了

等下个版本更新吧~ (最近比较忙可能会等比较久

@Cl0udG0d Cl0udG0d added the bug Something isn't working label Apr 21, 2024
@jiemo9527
Copy link
Author

准备转批量下号的野路子了

@Cl0udG0d
Copy link
Owner

本来今天晚上准备研究一下新版本的fofa,发现好像又可以了

api调用

from fofa_hack.fofa import api

result_generator = api("thinkphp", endcount=100)
for data in result_generator:
    print(data)

image

网页直接访问
https://fofa.info/result?qbase64=ImluZGV4IiAmJiBiZWZvcmU9IjIwMjQtMDQtMjUi

image

确实搞不懂为什么又改回去了.....

@jiemo9527
Copy link
Author

不行,用after就报错,而web现在是免登录可用的

from fofa_hack.fofa import api

result_generator = api('"thinkphp" && after="2024-04-01"', endcount=100)
for data in result_generator:
    print(data)

@purepoorx
Copy link

是after和before不能同时用

@jiemo9527
Copy link
Author

你指的是fofa.py内使用了before的逻辑吗;之前是不冲突的
那就需要配置登录了,python api需要登录!

@Cl0udG0d
Copy link
Owner

fofa-hack内置了before的逻辑,之前没有冲突是因为fofa没有after和before不能同时用的限制,等我出新版本吧 把这个地方完善一下

@Cl0udG0d
Copy link
Owner

本来刚想修一下这个问题 发现现在访问的状态又变成了

https://api.fofa.info/v1/search?qbase64=ImluZGV4Ig%3D%3D&full=false&page=1&size=20&ts=1714392126757&sign=H7Y3DQCFc9PosoLMDuRaZP%2B2935OX5W8gzon%2BpGF/id
2xbaTaz0i7znBiAtSSFeBnFIc274Xh%2BoAf7KDarVP7chr37/lN6AhGn2uOTKqHLg6js2dGQKoU1q05Zxc86r4mMojoOgrssJ1S5nw%2BH7CpiJrzG21KKApAnZi9sIBlo2CpjMT7pPqm/BFwT9y6Al
mOtWb46GGGO5CdHxfR9nhndzQ1B3fTtDgdp78eM/j09/vYTH6rmT/Sfmd7z81PmTaS8dhTnyQ6CdCceFiyxfoq7JHDWGW/WkT1s2LpZNMCQ8kN6XgGAg9NeD8QOZWtcOWiaLEvPAvkZ5inJoavexApA%3D%3D&app_id=9e9fb94330d97833acfbc041ee1a76793f1bc691

image

太有实力了

@Cl0udG0d
Copy link
Owner

不行,用after就报错,而web现在是免登录可用的

from fofa_hack.fofa import api

result_generator = api('"thinkphp" && after="2024-04-01"', endcount=100)
for data in result_generator:
    print(data)

总结一下这个issue ~

这个问题目前来看是修复不了的,因为fofahack内置了before逻辑,但是不能内置after逻辑,同时现在fofa的限制让after和before不能同时用,如图

image

但是before和after单独都是可用的,如图
image

为什么fofahack内置了before逻辑

因为这就是每次爬取的关键,从当前日期不断向前回滚,如图
image

为什么不内置after逻辑

因为after是在xx之后的数据,但是fofa的逻辑会让最新的数据靠前,所以如图所示

"thinkphp" && after="2024-04-01"

image

"thinkphp" && after="2024-04-02"

image

可以看到这两个关键字 虽然时间在移动 ,但是数据还是当前日期,这就是为啥不用after来做回滚的原因

关于这个游客状态访问限制的问题

image

猜测是游客的每日访问量也设置了上限,具体的上限值还没有找到

游客每日访问量上限这个可以解决吗

可以解决,等fofa不再那么频繁更新的时候解决吧

anyway,目前来看还是可以使用的,只要不用after参数~

@Cl0udG0d
Copy link
Owner

最新版本2.4.16已经新增了多个authorization的选项,可以把自己注册用户的authorization放置到txt中,示例使用

fofa-hack_win_amd64.exe -k index --authorization-file au.txt

image

@jiemo9527
Copy link
Author

已经用seleium自动化步骤操作解决了,不过还是感谢

@Cl0udG0d
Copy link
Owner

好哦

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants