1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
|
%global _empty_manifest_terminate_build 0
Name: python-zoomeye
Version: 2.2.0
Release: 1
Summary: Python library and command-line tool for ZoomEye (https://www.zoomeye.org/doc)
License: MIT License
URL: https://github.com/knownsec/zoomeye-python
Source0: https://mirrors.nju.edu.cn/pypi/web/packages/25/db/8f49cedeb9d04c741eb2a21b856e478508df8195faebff605ad9654434f4/zoomeye-2.2.0.tar.gz
BuildArch: noarch
Requires: python3-certifi
Requires: python3-charset-normalizer
Requires: python3-colorama
Requires: python3-graphviz
Requires: python3-idna
Requires: python3-requests
Requires: python3-urllib3
%description
English | `中文文档 <docs/README_CN.md>`_
``ZoomEye`` is a cyberspace search engine, users can search for
network devices using a browser https://www.zoomeye.org.
``ZoomEye-python`` is a Python library developed based on the
``ZoomEye API``. It provides the ``ZoomEye command line`` mode and can
also be integrated into other tools as an ``SDK``. The library allows
technicians to **search**, **filter**, and **export** ``ZoomEye`` data
more conveniently.
0x01 installation
~~~~~~~~~~~~~~~~~
It can be installed directly from ``pypi``:
pip3 install zoomeye
or installed from ``github``:
pip3 install git+https://github.com/knownsec/ZoomEye-python.git
0x02 how to use cli
~~~~~~~~~~~~~~~~~~~
After successfully installing ``ZoomEye-python``, you can use the
``zoomeye`` command directly, as follows:
$ zoomeye -h
usage: zoomeye [-h] [-v] {info,search,init,ip,history,clear} ...
positional arguments:
{info,search,init,ip,history,clear}
info Show ZoomEye account info
search Search the ZoomEye database
init Initialize the token for ZoomEye-python
ip Query IP information
history Query device history
clear Manually clear the cache and user information
optional arguments:
-h, --help show this help message and exit
-v, --version show program's version number and exit
1.initialize token
^^^^^^^^^^^^^^^^^^
Before using the ``ZoomEye-python cli``, the user ``token`` needs to be
initialized. The credential is used to verify the user’s identity to
query data from ``ZoomEye``; only support API-KEY authentication methods.
You can view the help through ``zoomeye init -h``, and use ``APIKEY`` to
demonstrate below:
$ zoomeye init -apikey "01234567-acbd-00000-1111-22222222222"
successfully initialized
Role: developer
Quota: 10000
Users can login to ``ZoomEye`` and obtain ``APIKEY`` in personal
information (https://www.zoomeye.org/profile); ``APIKEY`` will not
expire, users can reset in personal information according to their
needs.
2.query quota
^^^^^^^^^^^^^
Users can query personal information and data quota through the ``info``
command, as follows:
$ zoomeye info
user_info: {
"email": "",
"name": "",
"nick_name": "",
"api_key": "",
"role": "", # service level
"phone", "",
"expired_at": ""
}
quota: {
"remain_free_quota": "", # This month remaining free amount
"remain_pay_quota": "", # Amount of remaining payment this month
"remain_total_quota": "" # Total amount remaining by the service date
}
3.search
^^^^^^^^
Search is the core function of ``ZoomEye-python``, which is used through
the ``search`` command. the ``search`` command needs to specify the
search keyword (``dork``), let's perform a simple search below:
$ zoomeye search "telnet" -num 1
ip:port service country app banner
222.*.*.*:23 telnet Japan Pocket CMD telnetd \xff\xfb\x01\xff\xfb\x03\xff\x...
total: 1
Using the ``search`` command is as simple as using a browser to search
in ``ZoomEye``. by default, we display five more important fields. users
can use these data to understand the target information:
1.ip:port ip address and port
2.service the service that the port is open
3.country country of this ip address
4.app application type
5.banner characteristic response of the port
In the above example, the number to be displayed is specified using the
``-num`` parameter. in addition, ``search`` also supports the following
parameters (``zoomeye search -h``) so that users can handle the data. we
will explain and demonstrate below.
-num set the number of displays/searches, support 'all'
-count query the total amount of this dork in the ZoomEye database
-facet query the distribution of the full data of the dork
-stat the distribution of statistical data result sets
-filter query the list of a certain area in the data result set, or filter according to the content
-save the result set can be exported according to the filter conditions
-force ignore the local cache and force the data to be obtained from the API
-type select web or host search
4.number of data
^^^^^^^^^^^^^^^^
Through the ``-num`` parameter, we can specify the number of search and
display, and the specified number is the number of consumed quantities.
you can query the volume of the ``dork`` in the ZoomEye database through
the ``-count`` parameter, as follows:
$ zoomeye search "telnet" -count
56903258
One thing to note, the consumption of the ``-num`` parameter is an
integer multiple of 20, because the minimum number of a single query
of the ``ZoomEye API`` is 20.
5.statistics
^^^^^^^^^^^^
We can use ``-facet`` and ``-stat`` to perform data statistics, use
``-facet`` to query the statistics of the dork's full data (obtained
through ``API`` after statistics by ``ZoomEye``), and ``-stat`` You can
perform statistics on the query result set. The fields supported by the
two commands include:
# host searhc
app statistics by application type
device statistics by device type
service statistics by service type
os statistics by operating system type
port statistics by port
country statistics by country
city statistics by city
# web search
webapp statistics by Web application
component statistics by Web container
framework statistics by Web framework
server statistics by Web server
waf statistics by Web firewall(WAF)
os statistics by operating system
country statistics by country
use ``-facet`` to count the application types of all ``telnet`` devices:
$ zoomeye search "telnet" -facet app
app count
[unknown] 28317914
BusyBox telnetd 10176313
Linux telnetd 3054856
Cisco IOS telnetd 1505802
Huawei Home Gateway telnetd 1229112
MikroTik router config httpd 1066947
Huawei telnetd 965378
Busybox telnetd 962470
Netgear broadband router... 593346
NASLite-SMB/Sveasoft Alc... 491957
use ``-stat`` to count and query the application types of 20 ``telnet``
devices:
$ zoomeye search "telnet" -stat app
app count
Cisco IOS telnetd 7
[unknown] 5
BusyBox telnetd 4
Linux telnetd 3
Pocket CMD telnetd 1
6.data filter
^^^^^^^^^^^^^
Use the ``-filter`` parameter to query the list of partial segments in
the data result set, or filter based on content. The segments supported
by this command include:
# host/search
app show application type details
version show version information details
device show device type details
port show port information details
city show city details
country show country details
asn show as number details
banner show details of characteristic response
timestamp show record data time
* when this symbol is included, show all field details
# web/search
app show application type details
headers HTTP header
keywords meta keyword
title HTTP Title information
site site search
city show city details
country show country details
webapp Web application
component Web container
framework Web framework
server Web server
waf Web firewall(WAF)
os operating system
timestamp updated timestamp
* when this symbol is included, show all field details
Compared to the omitted display by default, the complete data can be
viewed through ``-filter``, as follows:
$ zoomeye search "telnet" -num 1 -filter banner
ip banner
222.*.*.* \xff\xfb\x01\xff\xfb\x03\xff\xfd\x03TELNET session now in ESTABLISHED state\r\n\r\n
total: 1
When using ``-filter`` to filter, the syntax is: ``key1,key2,key3=value``, where ``key3=value`` is the filter condition, and the displayed content is ``key1,key2`` Example:
$ zoomeye search telnet -num 1 -filter port,app,banner=Telnet
ip port app
240e:*:*:*::3 23 LANDesk remote management
In the above example: ``banner=Telnet`` is the filter condition, and ``port,app`` is the displayed content. If you need to display ``banner``, the filter statement is like this
$ zoomeye search telnet -num 1 -filter port,app,banner,banner=Telnet
7.data export
^^^^^^^^^^^^^
The ``-save`` parameter can export data. the syntax of this parameter is
the same as that of ``-filter``, and the result is saved to a file in
the format of line json, as follows:
$ zoomeye search "telnet" -save banner=telnet
save file to telnet_1_1610446755.json successful!
$ cat telnet_1_1610446755.json
{'ip': '218.223.21.91', 'banner': '\\xff\\xfb\\x01\\xff\\xfb\\x03\\xff\\xfd\\x03TELNET session now in ESTABLISHED state\\r\\n\\r\\n'}
if you use ``-save`` without any parameters, the query result will be
saved as a file according to the json format of ``ZoomEye API``. this
method is generally used to integrate data while retaining metadata;
the file can be as input, it is parsed and processed again through
``cli``, such as ``zoomeye search "xxxxx.json"``.
8.graphical data
^^^^^^^^^^^^^^^^
The ``-figure`` parameter is a data visualization parameter. This parameter provides two display methods: ``pie (pie chart)`` and ``hist (histogram)``. The data will still be displayed without specifying it. When ``-figure`` is specified , Only graphics will be displayed. The pie chart is as follows:
The histogram is as follows:
9. IP history
^^^^^^^^^^^^^
``ZoomEye-python`` provides the function of querying IP historical device data. Use the command ``history [ip]`` to query the historical data of IP devices. The usage is as follows:
$zoomeye history "207.xx.xx.13" -num 1
207.xx.xx.13
Hostnames: [unknown]
Country: United States
City: Lake Charles
Organization: fulair.com
Lastupdated: 2021-02-18T03:44:06
Number of open ports: 1
Number of historical probes: 1
timestamp port/service app raw_data
2021-02-18 03:44:06 80/http Apache httpd HTTP/1.0 301 Moved Permanently...
By default, five fields are shown to users:
1. time recorded time
2. service Open service
3. port port
4. app web application
5. raw fingerprint information
Use ``zoomeye history -h`` to view the parameters provided by ``history``.
$zoomeye history -h
usage: zoomeye history [-h] [-filter filed=regexp] [-force] ip
positional arguments:
ip search historical device IP
optional arguments:
-h, --help show this help message and exit
-filter filed=regexp filter data and print raw data detail. field:
[time,port,service,app,raw]
-force ignore the local cache and force the data to be
obtained from the API
The following is a demonstration of ``-filter``:
$zoomeye history "207.xx.xx.13" -filter "time=^2019-08,port,service"
207.xx.xx.13
Hostnames: [unknown]
Country: United States
City: Lake Charles
Organization: fulair.com
Lastupdated: 2019-08-16T10:53:46
Number of open ports: 3
Number of historical probes: 3
time port service
2019-08-16 10:53:46 389 ldap
2019-08-08 23:32:30 22 ssh
2019-08-03 01:55:59 80 http
The `-filter` parameter supports the filtering of the following five fields:
1.time scan time
2.port port information
3.service open service
4.app web application
5.banner original fingerprint information
* when this symbol is included, show all field details
A display of the ``id`` field is added during the display. ``id`` is the serial number. For the convenience of viewing, it cannot be used as a filtered field.
Note: At present, only the above five fields are allowed to filter.
The user quota will also be consumed when using the ``history`` command. The user quota will be deducted for the number of pieces of data returned in the ``history`` command. For example: IP "8.8.8.8" has a total of ``944`` historical records, and the user quota of ``944`` is deducted for one query.
10. search IP information
^^^^^^^^^^^^^^^^^^^^^^^^^
You can query the information of the specified IP through the ``zoomeye ip`` command, for example:
$ zoomeye ip 185.*.*.57
185.*.*.57
Hostnames: [unknown]
Isp: [unknown]
Country: Saudi Arabia
City: [unknown]
Organization: [unknown]
Lastupdated: 2021-03-02T11:14:33
Number of open ports: 4{2002, 9002, 123, 25}
port service app banner
9002 telnet \xff\xfb\x01\xff\xfb\x0...
123 ntp ntpd \x16\x82\x00\x01\x05\x0...
2002 telnet Pocket CMD telnetd \xff\xfb\x01\xff\xfb\x0...
25 smtp Cisco IOS NetWor... 220 10.1.10.2 Cisco Net...
The ``zoomeye ip`` command also supports the filter parameter ``-filter``, and the syntax is the same as that of ``zoomeye search``. E.g:
$ zoomeye ip "185.*.*.57" -filter "app,app=ntpd"
Hostnames: [unknown]
Isp: [unknown]
Country: Saudi Arabia
City: [unknown]
Organization: [unknown]
Lastupdated: 2021-02-17T02:15:06
Number of open ports: 0
Number of historical probes: 1
app
ntpd
The fields supported by the ``filter`` parameter are:
1.port port information
2.service open service
3.app web application
4.banner original fingerprint information
Note: This function limits the number of queries per user per day based on different user levels.
Registered users and developers can query 10 times a day
Advanced users can query 20 times a day
VIP users can query 30 times a day
After the number of times per day is used up, it will be refreshed after 24 hours, that is, counting from the time of the first IP check, and the number of refreshes after 24 hours.
11.cleanup function
^^^^^^^^^^^^^^^^^^^^
Users search for a large amount of data every day, which causes the storage space occupied by the cache folder to gradually increase; if users use ``ZoomEye-python`` on a public server, it may cause their own ``API KEY`` and ``ACCESS TOKEN`` to leak .
For this reason, ``ZoomEye-python`` provides the clear command ``zoomeye clear``, which can clear the cached data and user configuration. The usage is as follows:
$zoomeye clear -h
usage: zoomeye clear [-h] [-setting] [-cache]
optional arguments:
-h, --help show this help message and exit
-setting clear user api key and access token
-cache clear local cache file
11.data cache
^^^^^^^^^^^^^
``ZoomEye-python`` provides a caching in ``cli`` mode, which is located
under ``~/.config/zoomeye/cache`` to save user quota as much as
possible; the data set that the user has queried will be cached locally
for 5 days. when users query the same data set, quotas are not consumed.
13.domain name query
^^^^^^^^^^^^^^^^^^^^
``ZoomEye-python`` provides the domain name query function (including associated domain name query and subdomain name query). To query a domain name, run the domain [domain name] [query type] command as follows:
$ python cli.py domain baidu.com 0
name timestamp ip
zszelle.baidu30a72.bf.3dtops.com 2021-06-27 204.11.56.48
zpvpcxa.baidu.3dtops.com 2021-06-27 204.11.56.48
zsrob.baidu.3dtops.com 2021-06-27 204.11.56.48
zw8uch.7928.iwo7y0.baidu82.com 2021-06-27 59.188.232.88
zydsrdxd.baidu.3dtops.com 2021-06-27 204.11.56.48
zycoccz.baidu.3dtops.com 2021-06-27 204.11.56.48
total: 30/79882
By default, the user is presented with three more important fields:
1. name 域名全称
2. timestamp 建立时间戳
3. ip ip地址
Use ``zoomeye domain -h`` to view parameters provided by the ``domain``.
$ python cli.py domain -h
usage: zoomeye domain [-h] [-page PAGE] [-dot] q {0,1}
positional arguments:
q search key word(eg:baidu.com)
{0,1} 0: search associated domain;1: search sub domain
optional arguments:
-h, --help show this help message and exit
-page PAGE view the page of the query result
-dot generate a network map of the domain name
The following is a demonstration of ``-page`` :(default query for the first page when not specified)
$ python cli.py domain baidu.com 0 -page 3
name timestamp ip
zvptcfua.baidu6c7be.mm.3dtops.com 2021-06-27 204.11.56.48
zmukxtd.baidu65c78.iw.3dtops.com 2021-06-27 204.11.56.48
zhengwanghuangguanxianjinkaihu.baidu.fschangshi.com 2021-06-27 23.224.194.175
zibo-baidu.com 2021-06-27 194.56.78.148
zuwxb4.jingyan.baidu.66players.com 2021-06-27 208.91.197.46
zhannei.baidu.com.hypestat.com 2021-06-27 67.212.187.108
zrr.sjz-baidu.com 2021-06-27 204.11.56.48
zp5hd1.baidu.com.ojsdi.cn 2021-06-27 104.149.242.155
zhidao.baidu.com.39883.wxeve.cn 2021-06-27 39.98.202.39
zhizhao.baidu.com 2021-06-27 182.61.45.108
zfamnje.baidu.3dtops.com 2021-06-27 204.11.56.48
zjnfza.baidu.3dtops.com 2021-06-27 204.11.56.48
total: 90/79882
The ``-dot`` parameter can generate a network map of domain name and IP,Before using this function, you need to install ``grapvhiz``.
Please refer to `grapvhiz <https://graphviz.org/download/>`_ for the installation tutorial. It is supported on Windows/Linux/Mac.
The ``-dot`` parameter will generate a picture in ``png`` format and save the original dot language script at the same time.
0x03 video
~~~~~~~~~~
`ZoomEye-python is demonstrated under Windows, Mac, Linux, FreeBSD
<https://weibo.com/tv/show/1034:4597603044884556?from=old_pc_videoshow>`_
|asciicast|
0x04 use SDK
~~~~~~~~~~~~
1.initialize token
^^^^^^^^^^^^^^^^^^
Similarly, the SDK also supports API-KEY authentication methods,
``APIKEY``, as follows:
**APIKEY**
from zoomeye.sdk import ZoomEye
zm = ZoomEye(api_key="01234567-acbd-00000-1111-22222222222")
2.SDK API
^^^^^^^^^
The following are the interfaces and instructions provided by the SDK:
1.dork_search(dork, page=0, resource="host", facets=None)
search the data of the specified page according to dork
2.multi_page_search(dork, page=1, resource="host", facets=None)
search multiple pages of data according to dork
3.resources_info()
get current user information
4.show_count()
get the number of all matching results under the current dork
5.dork_filter(keys)
extract the data of the specified field from the search results
6.get_facet()
get statistical results of all data from search results
7.history_ip(ip)
query historical data information of an ip
8.show_site_ip(data)
traverse the web-search result set, and output the domain name and ip address
9.show_ip_port(data)
traverse the host-search result set and output the ip address and port
10.generate_dot(self, q, source=0, page=1)
Generate graphviz files and pictures written in the domain center
3.SDK example
^^^^^^^^^^^^^
$ python3
>>> import zoomeye.sdk as zoomeye
>>> dir(zoomeye)
['ZoomEye', 'ZoomEyeDict', '__builtins__', '__cached__', '__doc__',
'__file__', '__loader__', '__name__', '__package__', '__spec__',
'fields_tables_host', 'fields_tables_web', 'getpass', 'requests',
'show_ip_port', 'show_site_ip', 'zoomeye_api_test']
>>> # Use API-KEY search
>>> zm = zoomeye.ZoomEye(api_key="01234567-acbd-00000-1111-22222222222")
>>> data = zm.dork_search('apache country:cn')
>>> zoomeye.show_site_ip(data)
213.***.***.46.rev.vo***one.pt ['46.***.***.213']
me*****on.o****e.net.pg ['203.***.***.114']
soft********63221110.b***c.net ['126.***.***.110']
soft********26216022.b***c.net ['126.***.***.22']
soft********5084068.b***c.net ['126.***.***.68']
soft********11180040.b***c.net ['126.***.***.40']
4.search
^^^^^^^^
As in the above example, we use ``dork_search()`` to search, and we can
also set the ``facets`` parameter to obtain the aggregated statistical
results of the full data of the dork. for the fields supported by
``facets``, please refer to **2.use cli - 5.statistics**. as follows:
>>> data = zm.dork_search('telnet', facets='app')
>>> zm.get_facet()
{'product': [{'name': '', 'count': 28323128}, {'name': 'BusyBox telnetd', 'count': 10180912}, {'name': 'Linux telnetd', ......
``multi_page_search()`` can also search. use this function when you
need to obtain a large amount of data, where the ``page`` field
indicates how many pages of data are obtained; and ``dork_search()``
only obtains the data of a specified page.
5.data filter
^^^^^^^^^^^^^
the ``dork_filter()`` function is provided in the SDK, we can filter the
data more conveniently and extract the specified data fields as follows:
>>> data = zm.dork_search("telnet")
>>> zm.dork_filter("ip,port")
[['180.*.*.166', 5357], ['180.*.*.6', 5357], ......
since the fields returned by ``web-search`` and ``host-search``
interfaces are different, you need to fill in the correct fields when
filtering. the fields included in ``web-search``: app / headers /
keywords / title / ip / site / city / country the fields included in
``host-search``: app / version / device / ip / port / hostname / city
/ country / asn / banner
0x05 contributions
~~~~~~~~~~~~~~~~~~
| `r0oike@knownsec 404 <https://github.com/r0oike>`__
| `0x7F@knownsec 404 <https://github.com/0x7Fancy>`__
| `fenix@knownsec 404 <https://github.com/13ph03nix>`__
| `dawu@knownsec 404 <https://github.com/d4wu>`__
0x06 issue
~~~~~~~~~~
| **1.The minimum number of requests for SDK and command line tools is
20**
| Due to API limitations, the minimum unit of our query is 20 pieces of
data at a time. for a new dork, whether it is to view the total number
or specify to search for only 1 piece of data, there will be an
overhead of 20 pieces; of course, in the cli, we provide a cache, the
data that has been searched is cached locally
(``~/.config/zoomeye/cache``), and the validity period is 5 days,
which can greatly save quota.
| **2.How to enter dork with quotes?**
| When using cli to search, you will encounter dork with quotes, for example: ``"<body style=\"margin:0;padding:0\"> <p align=\"center\"> <iframe src=\ "index.xhtml\""``, when dork contains quotation marks or multiple quotation marks, the outermost layer of dork must be wrapped in quotation marks to indicate a parameter as a whole, otherwise command line parameter parsing will cause problems. Then the correct search method for the following dork should be: ``'"<body style=\"margin:0;padding:0\"> <p align=\"center\"> <iframe src=\"index.xhtml\" "'``.
| **3.Why is there inconsistent data in facet?**
| The following figure shows the full data statistics results of
``telnet``. the result of the first query is that 20 data query
requests (including the statistical results) were initiated by cli one
day ago by default, and cached in a local folder; the second time We
set the number of queries to 21, cli will read 20 cached data and
initiate a new query request (actually the smallest unit is 20, which
also contains statistical results), the first query and the second
query a certain period of time is in between. during this period of
time, ``ZoomEye`` periodically scans and updates the data, resulting
in the above data inconsistency, so cli will use the newer statistical
results.
| **4.Why may the total amount of data in ZoomEye-python and the browser
search the same dork be different?**
| ``ZoomEye`` provides two search interfaces: ``/host/search`` and ``/web/search``. In ``ZoomEye-python``, only ``/host/search`` is used by default, and ``/web/search`` is not used. Users can choose the search method according to their needs by specifying the ``type`` parameter.
| **5.The quota information obtained by the info command may be
inconsistent with the browser side?**
| The browser side displays the free quota and recharge quota
(https://www.zoomeye.org/profile/record), but only the free quota
information is displayed in ``ZoomEye-python``, we will fix it in the
subsequent version This question.
0x07 404StarLink Project
~~~~~~~~~~~~~~~~~~~~~~~~
``ZoomEye-python`` is a part of 404Team `Starlink
Project <https://github.com/knownsec/404StarLink-Project>`__. If you
have any questions about ``ZoomEye-python`` or want to talk to a small
partner, you can refer to The way to join the group of Starlink Project.
%package -n python3-zoomeye
Summary: Python library and command-line tool for ZoomEye (https://www.zoomeye.org/doc)
Provides: python-zoomeye
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%description -n python3-zoomeye
English | `中文文档 <docs/README_CN.md>`_
``ZoomEye`` is a cyberspace search engine, users can search for
network devices using a browser https://www.zoomeye.org.
``ZoomEye-python`` is a Python library developed based on the
``ZoomEye API``. It provides the ``ZoomEye command line`` mode and can
also be integrated into other tools as an ``SDK``. The library allows
technicians to **search**, **filter**, and **export** ``ZoomEye`` data
more conveniently.
0x01 installation
~~~~~~~~~~~~~~~~~
It can be installed directly from ``pypi``:
pip3 install zoomeye
or installed from ``github``:
pip3 install git+https://github.com/knownsec/ZoomEye-python.git
0x02 how to use cli
~~~~~~~~~~~~~~~~~~~
After successfully installing ``ZoomEye-python``, you can use the
``zoomeye`` command directly, as follows:
$ zoomeye -h
usage: zoomeye [-h] [-v] {info,search,init,ip,history,clear} ...
positional arguments:
{info,search,init,ip,history,clear}
info Show ZoomEye account info
search Search the ZoomEye database
init Initialize the token for ZoomEye-python
ip Query IP information
history Query device history
clear Manually clear the cache and user information
optional arguments:
-h, --help show this help message and exit
-v, --version show program's version number and exit
1.initialize token
^^^^^^^^^^^^^^^^^^
Before using the ``ZoomEye-python cli``, the user ``token`` needs to be
initialized. The credential is used to verify the user’s identity to
query data from ``ZoomEye``; only support API-KEY authentication methods.
You can view the help through ``zoomeye init -h``, and use ``APIKEY`` to
demonstrate below:
$ zoomeye init -apikey "01234567-acbd-00000-1111-22222222222"
successfully initialized
Role: developer
Quota: 10000
Users can login to ``ZoomEye`` and obtain ``APIKEY`` in personal
information (https://www.zoomeye.org/profile); ``APIKEY`` will not
expire, users can reset in personal information according to their
needs.
2.query quota
^^^^^^^^^^^^^
Users can query personal information and data quota through the ``info``
command, as follows:
$ zoomeye info
user_info: {
"email": "",
"name": "",
"nick_name": "",
"api_key": "",
"role": "", # service level
"phone", "",
"expired_at": ""
}
quota: {
"remain_free_quota": "", # This month remaining free amount
"remain_pay_quota": "", # Amount of remaining payment this month
"remain_total_quota": "" # Total amount remaining by the service date
}
3.search
^^^^^^^^
Search is the core function of ``ZoomEye-python``, which is used through
the ``search`` command. the ``search`` command needs to specify the
search keyword (``dork``), let's perform a simple search below:
$ zoomeye search "telnet" -num 1
ip:port service country app banner
222.*.*.*:23 telnet Japan Pocket CMD telnetd \xff\xfb\x01\xff\xfb\x03\xff\x...
total: 1
Using the ``search`` command is as simple as using a browser to search
in ``ZoomEye``. by default, we display five more important fields. users
can use these data to understand the target information:
1.ip:port ip address and port
2.service the service that the port is open
3.country country of this ip address
4.app application type
5.banner characteristic response of the port
In the above example, the number to be displayed is specified using the
``-num`` parameter. in addition, ``search`` also supports the following
parameters (``zoomeye search -h``) so that users can handle the data. we
will explain and demonstrate below.
-num set the number of displays/searches, support 'all'
-count query the total amount of this dork in the ZoomEye database
-facet query the distribution of the full data of the dork
-stat the distribution of statistical data result sets
-filter query the list of a certain area in the data result set, or filter according to the content
-save the result set can be exported according to the filter conditions
-force ignore the local cache and force the data to be obtained from the API
-type select web or host search
4.number of data
^^^^^^^^^^^^^^^^
Through the ``-num`` parameter, we can specify the number of search and
display, and the specified number is the number of consumed quantities.
you can query the volume of the ``dork`` in the ZoomEye database through
the ``-count`` parameter, as follows:
$ zoomeye search "telnet" -count
56903258
One thing to note, the consumption of the ``-num`` parameter is an
integer multiple of 20, because the minimum number of a single query
of the ``ZoomEye API`` is 20.
5.statistics
^^^^^^^^^^^^
We can use ``-facet`` and ``-stat`` to perform data statistics, use
``-facet`` to query the statistics of the dork's full data (obtained
through ``API`` after statistics by ``ZoomEye``), and ``-stat`` You can
perform statistics on the query result set. The fields supported by the
two commands include:
# host searhc
app statistics by application type
device statistics by device type
service statistics by service type
os statistics by operating system type
port statistics by port
country statistics by country
city statistics by city
# web search
webapp statistics by Web application
component statistics by Web container
framework statistics by Web framework
server statistics by Web server
waf statistics by Web firewall(WAF)
os statistics by operating system
country statistics by country
use ``-facet`` to count the application types of all ``telnet`` devices:
$ zoomeye search "telnet" -facet app
app count
[unknown] 28317914
BusyBox telnetd 10176313
Linux telnetd 3054856
Cisco IOS telnetd 1505802
Huawei Home Gateway telnetd 1229112
MikroTik router config httpd 1066947
Huawei telnetd 965378
Busybox telnetd 962470
Netgear broadband router... 593346
NASLite-SMB/Sveasoft Alc... 491957
use ``-stat`` to count and query the application types of 20 ``telnet``
devices:
$ zoomeye search "telnet" -stat app
app count
Cisco IOS telnetd 7
[unknown] 5
BusyBox telnetd 4
Linux telnetd 3
Pocket CMD telnetd 1
6.data filter
^^^^^^^^^^^^^
Use the ``-filter`` parameter to query the list of partial segments in
the data result set, or filter based on content. The segments supported
by this command include:
# host/search
app show application type details
version show version information details
device show device type details
port show port information details
city show city details
country show country details
asn show as number details
banner show details of characteristic response
timestamp show record data time
* when this symbol is included, show all field details
# web/search
app show application type details
headers HTTP header
keywords meta keyword
title HTTP Title information
site site search
city show city details
country show country details
webapp Web application
component Web container
framework Web framework
server Web server
waf Web firewall(WAF)
os operating system
timestamp updated timestamp
* when this symbol is included, show all field details
Compared to the omitted display by default, the complete data can be
viewed through ``-filter``, as follows:
$ zoomeye search "telnet" -num 1 -filter banner
ip banner
222.*.*.* \xff\xfb\x01\xff\xfb\x03\xff\xfd\x03TELNET session now in ESTABLISHED state\r\n\r\n
total: 1
When using ``-filter`` to filter, the syntax is: ``key1,key2,key3=value``, where ``key3=value`` is the filter condition, and the displayed content is ``key1,key2`` Example:
$ zoomeye search telnet -num 1 -filter port,app,banner=Telnet
ip port app
240e:*:*:*::3 23 LANDesk remote management
In the above example: ``banner=Telnet`` is the filter condition, and ``port,app`` is the displayed content. If you need to display ``banner``, the filter statement is like this
$ zoomeye search telnet -num 1 -filter port,app,banner,banner=Telnet
7.data export
^^^^^^^^^^^^^
The ``-save`` parameter can export data. the syntax of this parameter is
the same as that of ``-filter``, and the result is saved to a file in
the format of line json, as follows:
$ zoomeye search "telnet" -save banner=telnet
save file to telnet_1_1610446755.json successful!
$ cat telnet_1_1610446755.json
{'ip': '218.223.21.91', 'banner': '\\xff\\xfb\\x01\\xff\\xfb\\x03\\xff\\xfd\\x03TELNET session now in ESTABLISHED state\\r\\n\\r\\n'}
if you use ``-save`` without any parameters, the query result will be
saved as a file according to the json format of ``ZoomEye API``. this
method is generally used to integrate data while retaining metadata;
the file can be as input, it is parsed and processed again through
``cli``, such as ``zoomeye search "xxxxx.json"``.
8.graphical data
^^^^^^^^^^^^^^^^
The ``-figure`` parameter is a data visualization parameter. This parameter provides two display methods: ``pie (pie chart)`` and ``hist (histogram)``. The data will still be displayed without specifying it. When ``-figure`` is specified , Only graphics will be displayed. The pie chart is as follows:
The histogram is as follows:
9. IP history
^^^^^^^^^^^^^
``ZoomEye-python`` provides the function of querying IP historical device data. Use the command ``history [ip]`` to query the historical data of IP devices. The usage is as follows:
$zoomeye history "207.xx.xx.13" -num 1
207.xx.xx.13
Hostnames: [unknown]
Country: United States
City: Lake Charles
Organization: fulair.com
Lastupdated: 2021-02-18T03:44:06
Number of open ports: 1
Number of historical probes: 1
timestamp port/service app raw_data
2021-02-18 03:44:06 80/http Apache httpd HTTP/1.0 301 Moved Permanently...
By default, five fields are shown to users:
1. time recorded time
2. service Open service
3. port port
4. app web application
5. raw fingerprint information
Use ``zoomeye history -h`` to view the parameters provided by ``history``.
$zoomeye history -h
usage: zoomeye history [-h] [-filter filed=regexp] [-force] ip
positional arguments:
ip search historical device IP
optional arguments:
-h, --help show this help message and exit
-filter filed=regexp filter data and print raw data detail. field:
[time,port,service,app,raw]
-force ignore the local cache and force the data to be
obtained from the API
The following is a demonstration of ``-filter``:
$zoomeye history "207.xx.xx.13" -filter "time=^2019-08,port,service"
207.xx.xx.13
Hostnames: [unknown]
Country: United States
City: Lake Charles
Organization: fulair.com
Lastupdated: 2019-08-16T10:53:46
Number of open ports: 3
Number of historical probes: 3
time port service
2019-08-16 10:53:46 389 ldap
2019-08-08 23:32:30 22 ssh
2019-08-03 01:55:59 80 http
The `-filter` parameter supports the filtering of the following five fields:
1.time scan time
2.port port information
3.service open service
4.app web application
5.banner original fingerprint information
* when this symbol is included, show all field details
A display of the ``id`` field is added during the display. ``id`` is the serial number. For the convenience of viewing, it cannot be used as a filtered field.
Note: At present, only the above five fields are allowed to filter.
The user quota will also be consumed when using the ``history`` command. The user quota will be deducted for the number of pieces of data returned in the ``history`` command. For example: IP "8.8.8.8" has a total of ``944`` historical records, and the user quota of ``944`` is deducted for one query.
10. search IP information
^^^^^^^^^^^^^^^^^^^^^^^^^
You can query the information of the specified IP through the ``zoomeye ip`` command, for example:
$ zoomeye ip 185.*.*.57
185.*.*.57
Hostnames: [unknown]
Isp: [unknown]
Country: Saudi Arabia
City: [unknown]
Organization: [unknown]
Lastupdated: 2021-03-02T11:14:33
Number of open ports: 4{2002, 9002, 123, 25}
port service app banner
9002 telnet \xff\xfb\x01\xff\xfb\x0...
123 ntp ntpd \x16\x82\x00\x01\x05\x0...
2002 telnet Pocket CMD telnetd \xff\xfb\x01\xff\xfb\x0...
25 smtp Cisco IOS NetWor... 220 10.1.10.2 Cisco Net...
The ``zoomeye ip`` command also supports the filter parameter ``-filter``, and the syntax is the same as that of ``zoomeye search``. E.g:
$ zoomeye ip "185.*.*.57" -filter "app,app=ntpd"
Hostnames: [unknown]
Isp: [unknown]
Country: Saudi Arabia
City: [unknown]
Organization: [unknown]
Lastupdated: 2021-02-17T02:15:06
Number of open ports: 0
Number of historical probes: 1
app
ntpd
The fields supported by the ``filter`` parameter are:
1.port port information
2.service open service
3.app web application
4.banner original fingerprint information
Note: This function limits the number of queries per user per day based on different user levels.
Registered users and developers can query 10 times a day
Advanced users can query 20 times a day
VIP users can query 30 times a day
After the number of times per day is used up, it will be refreshed after 24 hours, that is, counting from the time of the first IP check, and the number of refreshes after 24 hours.
11.cleanup function
^^^^^^^^^^^^^^^^^^^^
Users search for a large amount of data every day, which causes the storage space occupied by the cache folder to gradually increase; if users use ``ZoomEye-python`` on a public server, it may cause their own ``API KEY`` and ``ACCESS TOKEN`` to leak .
For this reason, ``ZoomEye-python`` provides the clear command ``zoomeye clear``, which can clear the cached data and user configuration. The usage is as follows:
$zoomeye clear -h
usage: zoomeye clear [-h] [-setting] [-cache]
optional arguments:
-h, --help show this help message and exit
-setting clear user api key and access token
-cache clear local cache file
11.data cache
^^^^^^^^^^^^^
``ZoomEye-python`` provides a caching in ``cli`` mode, which is located
under ``~/.config/zoomeye/cache`` to save user quota as much as
possible; the data set that the user has queried will be cached locally
for 5 days. when users query the same data set, quotas are not consumed.
13.domain name query
^^^^^^^^^^^^^^^^^^^^
``ZoomEye-python`` provides the domain name query function (including associated domain name query and subdomain name query). To query a domain name, run the domain [domain name] [query type] command as follows:
$ python cli.py domain baidu.com 0
name timestamp ip
zszelle.baidu30a72.bf.3dtops.com 2021-06-27 204.11.56.48
zpvpcxa.baidu.3dtops.com 2021-06-27 204.11.56.48
zsrob.baidu.3dtops.com 2021-06-27 204.11.56.48
zw8uch.7928.iwo7y0.baidu82.com 2021-06-27 59.188.232.88
zydsrdxd.baidu.3dtops.com 2021-06-27 204.11.56.48
zycoccz.baidu.3dtops.com 2021-06-27 204.11.56.48
total: 30/79882
By default, the user is presented with three more important fields:
1. name 域名全称
2. timestamp 建立时间戳
3. ip ip地址
Use ``zoomeye domain -h`` to view parameters provided by the ``domain``.
$ python cli.py domain -h
usage: zoomeye domain [-h] [-page PAGE] [-dot] q {0,1}
positional arguments:
q search key word(eg:baidu.com)
{0,1} 0: search associated domain;1: search sub domain
optional arguments:
-h, --help show this help message and exit
-page PAGE view the page of the query result
-dot generate a network map of the domain name
The following is a demonstration of ``-page`` :(default query for the first page when not specified)
$ python cli.py domain baidu.com 0 -page 3
name timestamp ip
zvptcfua.baidu6c7be.mm.3dtops.com 2021-06-27 204.11.56.48
zmukxtd.baidu65c78.iw.3dtops.com 2021-06-27 204.11.56.48
zhengwanghuangguanxianjinkaihu.baidu.fschangshi.com 2021-06-27 23.224.194.175
zibo-baidu.com 2021-06-27 194.56.78.148
zuwxb4.jingyan.baidu.66players.com 2021-06-27 208.91.197.46
zhannei.baidu.com.hypestat.com 2021-06-27 67.212.187.108
zrr.sjz-baidu.com 2021-06-27 204.11.56.48
zp5hd1.baidu.com.ojsdi.cn 2021-06-27 104.149.242.155
zhidao.baidu.com.39883.wxeve.cn 2021-06-27 39.98.202.39
zhizhao.baidu.com 2021-06-27 182.61.45.108
zfamnje.baidu.3dtops.com 2021-06-27 204.11.56.48
zjnfza.baidu.3dtops.com 2021-06-27 204.11.56.48
total: 90/79882
The ``-dot`` parameter can generate a network map of domain name and IP,Before using this function, you need to install ``grapvhiz``.
Please refer to `grapvhiz <https://graphviz.org/download/>`_ for the installation tutorial. It is supported on Windows/Linux/Mac.
The ``-dot`` parameter will generate a picture in ``png`` format and save the original dot language script at the same time.
0x03 video
~~~~~~~~~~
`ZoomEye-python is demonstrated under Windows, Mac, Linux, FreeBSD
<https://weibo.com/tv/show/1034:4597603044884556?from=old_pc_videoshow>`_
|asciicast|
0x04 use SDK
~~~~~~~~~~~~
1.initialize token
^^^^^^^^^^^^^^^^^^
Similarly, the SDK also supports API-KEY authentication methods,
``APIKEY``, as follows:
**APIKEY**
from zoomeye.sdk import ZoomEye
zm = ZoomEye(api_key="01234567-acbd-00000-1111-22222222222")
2.SDK API
^^^^^^^^^
The following are the interfaces and instructions provided by the SDK:
1.dork_search(dork, page=0, resource="host", facets=None)
search the data of the specified page according to dork
2.multi_page_search(dork, page=1, resource="host", facets=None)
search multiple pages of data according to dork
3.resources_info()
get current user information
4.show_count()
get the number of all matching results under the current dork
5.dork_filter(keys)
extract the data of the specified field from the search results
6.get_facet()
get statistical results of all data from search results
7.history_ip(ip)
query historical data information of an ip
8.show_site_ip(data)
traverse the web-search result set, and output the domain name and ip address
9.show_ip_port(data)
traverse the host-search result set and output the ip address and port
10.generate_dot(self, q, source=0, page=1)
Generate graphviz files and pictures written in the domain center
3.SDK example
^^^^^^^^^^^^^
$ python3
>>> import zoomeye.sdk as zoomeye
>>> dir(zoomeye)
['ZoomEye', 'ZoomEyeDict', '__builtins__', '__cached__', '__doc__',
'__file__', '__loader__', '__name__', '__package__', '__spec__',
'fields_tables_host', 'fields_tables_web', 'getpass', 'requests',
'show_ip_port', 'show_site_ip', 'zoomeye_api_test']
>>> # Use API-KEY search
>>> zm = zoomeye.ZoomEye(api_key="01234567-acbd-00000-1111-22222222222")
>>> data = zm.dork_search('apache country:cn')
>>> zoomeye.show_site_ip(data)
213.***.***.46.rev.vo***one.pt ['46.***.***.213']
me*****on.o****e.net.pg ['203.***.***.114']
soft********63221110.b***c.net ['126.***.***.110']
soft********26216022.b***c.net ['126.***.***.22']
soft********5084068.b***c.net ['126.***.***.68']
soft********11180040.b***c.net ['126.***.***.40']
4.search
^^^^^^^^
As in the above example, we use ``dork_search()`` to search, and we can
also set the ``facets`` parameter to obtain the aggregated statistical
results of the full data of the dork. for the fields supported by
``facets``, please refer to **2.use cli - 5.statistics**. as follows:
>>> data = zm.dork_search('telnet', facets='app')
>>> zm.get_facet()
{'product': [{'name': '', 'count': 28323128}, {'name': 'BusyBox telnetd', 'count': 10180912}, {'name': 'Linux telnetd', ......
``multi_page_search()`` can also search. use this function when you
need to obtain a large amount of data, where the ``page`` field
indicates how many pages of data are obtained; and ``dork_search()``
only obtains the data of a specified page.
5.data filter
^^^^^^^^^^^^^
the ``dork_filter()`` function is provided in the SDK, we can filter the
data more conveniently and extract the specified data fields as follows:
>>> data = zm.dork_search("telnet")
>>> zm.dork_filter("ip,port")
[['180.*.*.166', 5357], ['180.*.*.6', 5357], ......
since the fields returned by ``web-search`` and ``host-search``
interfaces are different, you need to fill in the correct fields when
filtering. the fields included in ``web-search``: app / headers /
keywords / title / ip / site / city / country the fields included in
``host-search``: app / version / device / ip / port / hostname / city
/ country / asn / banner
0x05 contributions
~~~~~~~~~~~~~~~~~~
| `r0oike@knownsec 404 <https://github.com/r0oike>`__
| `0x7F@knownsec 404 <https://github.com/0x7Fancy>`__
| `fenix@knownsec 404 <https://github.com/13ph03nix>`__
| `dawu@knownsec 404 <https://github.com/d4wu>`__
0x06 issue
~~~~~~~~~~
| **1.The minimum number of requests for SDK and command line tools is
20**
| Due to API limitations, the minimum unit of our query is 20 pieces of
data at a time. for a new dork, whether it is to view the total number
or specify to search for only 1 piece of data, there will be an
overhead of 20 pieces; of course, in the cli, we provide a cache, the
data that has been searched is cached locally
(``~/.config/zoomeye/cache``), and the validity period is 5 days,
which can greatly save quota.
| **2.How to enter dork with quotes?**
| When using cli to search, you will encounter dork with quotes, for example: ``"<body style=\"margin:0;padding:0\"> <p align=\"center\"> <iframe src=\ "index.xhtml\""``, when dork contains quotation marks or multiple quotation marks, the outermost layer of dork must be wrapped in quotation marks to indicate a parameter as a whole, otherwise command line parameter parsing will cause problems. Then the correct search method for the following dork should be: ``'"<body style=\"margin:0;padding:0\"> <p align=\"center\"> <iframe src=\"index.xhtml\" "'``.
| **3.Why is there inconsistent data in facet?**
| The following figure shows the full data statistics results of
``telnet``. the result of the first query is that 20 data query
requests (including the statistical results) were initiated by cli one
day ago by default, and cached in a local folder; the second time We
set the number of queries to 21, cli will read 20 cached data and
initiate a new query request (actually the smallest unit is 20, which
also contains statistical results), the first query and the second
query a certain period of time is in between. during this period of
time, ``ZoomEye`` periodically scans and updates the data, resulting
in the above data inconsistency, so cli will use the newer statistical
results.
| **4.Why may the total amount of data in ZoomEye-python and the browser
search the same dork be different?**
| ``ZoomEye`` provides two search interfaces: ``/host/search`` and ``/web/search``. In ``ZoomEye-python``, only ``/host/search`` is used by default, and ``/web/search`` is not used. Users can choose the search method according to their needs by specifying the ``type`` parameter.
| **5.The quota information obtained by the info command may be
inconsistent with the browser side?**
| The browser side displays the free quota and recharge quota
(https://www.zoomeye.org/profile/record), but only the free quota
information is displayed in ``ZoomEye-python``, we will fix it in the
subsequent version This question.
0x07 404StarLink Project
~~~~~~~~~~~~~~~~~~~~~~~~
``ZoomEye-python`` is a part of 404Team `Starlink
Project <https://github.com/knownsec/404StarLink-Project>`__. If you
have any questions about ``ZoomEye-python`` or want to talk to a small
partner, you can refer to The way to join the group of Starlink Project.
%package help
Summary: Development documents and examples for zoomeye
Provides: python3-zoomeye-doc
%description help
English | `中文文档 <docs/README_CN.md>`_
``ZoomEye`` is a cyberspace search engine, users can search for
network devices using a browser https://www.zoomeye.org.
``ZoomEye-python`` is a Python library developed based on the
``ZoomEye API``. It provides the ``ZoomEye command line`` mode and can
also be integrated into other tools as an ``SDK``. The library allows
technicians to **search**, **filter**, and **export** ``ZoomEye`` data
more conveniently.
0x01 installation
~~~~~~~~~~~~~~~~~
It can be installed directly from ``pypi``:
pip3 install zoomeye
or installed from ``github``:
pip3 install git+https://github.com/knownsec/ZoomEye-python.git
0x02 how to use cli
~~~~~~~~~~~~~~~~~~~
After successfully installing ``ZoomEye-python``, you can use the
``zoomeye`` command directly, as follows:
$ zoomeye -h
usage: zoomeye [-h] [-v] {info,search,init,ip,history,clear} ...
positional arguments:
{info,search,init,ip,history,clear}
info Show ZoomEye account info
search Search the ZoomEye database
init Initialize the token for ZoomEye-python
ip Query IP information
history Query device history
clear Manually clear the cache and user information
optional arguments:
-h, --help show this help message and exit
-v, --version show program's version number and exit
1.initialize token
^^^^^^^^^^^^^^^^^^
Before using the ``ZoomEye-python cli``, the user ``token`` needs to be
initialized. The credential is used to verify the user’s identity to
query data from ``ZoomEye``; only support API-KEY authentication methods.
You can view the help through ``zoomeye init -h``, and use ``APIKEY`` to
demonstrate below:
$ zoomeye init -apikey "01234567-acbd-00000-1111-22222222222"
successfully initialized
Role: developer
Quota: 10000
Users can login to ``ZoomEye`` and obtain ``APIKEY`` in personal
information (https://www.zoomeye.org/profile); ``APIKEY`` will not
expire, users can reset in personal information according to their
needs.
2.query quota
^^^^^^^^^^^^^
Users can query personal information and data quota through the ``info``
command, as follows:
$ zoomeye info
user_info: {
"email": "",
"name": "",
"nick_name": "",
"api_key": "",
"role": "", # service level
"phone", "",
"expired_at": ""
}
quota: {
"remain_free_quota": "", # This month remaining free amount
"remain_pay_quota": "", # Amount of remaining payment this month
"remain_total_quota": "" # Total amount remaining by the service date
}
3.search
^^^^^^^^
Search is the core function of ``ZoomEye-python``, which is used through
the ``search`` command. the ``search`` command needs to specify the
search keyword (``dork``), let's perform a simple search below:
$ zoomeye search "telnet" -num 1
ip:port service country app banner
222.*.*.*:23 telnet Japan Pocket CMD telnetd \xff\xfb\x01\xff\xfb\x03\xff\x...
total: 1
Using the ``search`` command is as simple as using a browser to search
in ``ZoomEye``. by default, we display five more important fields. users
can use these data to understand the target information:
1.ip:port ip address and port
2.service the service that the port is open
3.country country of this ip address
4.app application type
5.banner characteristic response of the port
In the above example, the number to be displayed is specified using the
``-num`` parameter. in addition, ``search`` also supports the following
parameters (``zoomeye search -h``) so that users can handle the data. we
will explain and demonstrate below.
-num set the number of displays/searches, support 'all'
-count query the total amount of this dork in the ZoomEye database
-facet query the distribution of the full data of the dork
-stat the distribution of statistical data result sets
-filter query the list of a certain area in the data result set, or filter according to the content
-save the result set can be exported according to the filter conditions
-force ignore the local cache and force the data to be obtained from the API
-type select web or host search
4.number of data
^^^^^^^^^^^^^^^^
Through the ``-num`` parameter, we can specify the number of search and
display, and the specified number is the number of consumed quantities.
you can query the volume of the ``dork`` in the ZoomEye database through
the ``-count`` parameter, as follows:
$ zoomeye search "telnet" -count
56903258
One thing to note, the consumption of the ``-num`` parameter is an
integer multiple of 20, because the minimum number of a single query
of the ``ZoomEye API`` is 20.
5.statistics
^^^^^^^^^^^^
We can use ``-facet`` and ``-stat`` to perform data statistics, use
``-facet`` to query the statistics of the dork's full data (obtained
through ``API`` after statistics by ``ZoomEye``), and ``-stat`` You can
perform statistics on the query result set. The fields supported by the
two commands include:
# host searhc
app statistics by application type
device statistics by device type
service statistics by service type
os statistics by operating system type
port statistics by port
country statistics by country
city statistics by city
# web search
webapp statistics by Web application
component statistics by Web container
framework statistics by Web framework
server statistics by Web server
waf statistics by Web firewall(WAF)
os statistics by operating system
country statistics by country
use ``-facet`` to count the application types of all ``telnet`` devices:
$ zoomeye search "telnet" -facet app
app count
[unknown] 28317914
BusyBox telnetd 10176313
Linux telnetd 3054856
Cisco IOS telnetd 1505802
Huawei Home Gateway telnetd 1229112
MikroTik router config httpd 1066947
Huawei telnetd 965378
Busybox telnetd 962470
Netgear broadband router... 593346
NASLite-SMB/Sveasoft Alc... 491957
use ``-stat`` to count and query the application types of 20 ``telnet``
devices:
$ zoomeye search "telnet" -stat app
app count
Cisco IOS telnetd 7
[unknown] 5
BusyBox telnetd 4
Linux telnetd 3
Pocket CMD telnetd 1
6.data filter
^^^^^^^^^^^^^
Use the ``-filter`` parameter to query the list of partial segments in
the data result set, or filter based on content. The segments supported
by this command include:
# host/search
app show application type details
version show version information details
device show device type details
port show port information details
city show city details
country show country details
asn show as number details
banner show details of characteristic response
timestamp show record data time
* when this symbol is included, show all field details
# web/search
app show application type details
headers HTTP header
keywords meta keyword
title HTTP Title information
site site search
city show city details
country show country details
webapp Web application
component Web container
framework Web framework
server Web server
waf Web firewall(WAF)
os operating system
timestamp updated timestamp
* when this symbol is included, show all field details
Compared to the omitted display by default, the complete data can be
viewed through ``-filter``, as follows:
$ zoomeye search "telnet" -num 1 -filter banner
ip banner
222.*.*.* \xff\xfb\x01\xff\xfb\x03\xff\xfd\x03TELNET session now in ESTABLISHED state\r\n\r\n
total: 1
When using ``-filter`` to filter, the syntax is: ``key1,key2,key3=value``, where ``key3=value`` is the filter condition, and the displayed content is ``key1,key2`` Example:
$ zoomeye search telnet -num 1 -filter port,app,banner=Telnet
ip port app
240e:*:*:*::3 23 LANDesk remote management
In the above example: ``banner=Telnet`` is the filter condition, and ``port,app`` is the displayed content. If you need to display ``banner``, the filter statement is like this
$ zoomeye search telnet -num 1 -filter port,app,banner,banner=Telnet
7.data export
^^^^^^^^^^^^^
The ``-save`` parameter can export data. the syntax of this parameter is
the same as that of ``-filter``, and the result is saved to a file in
the format of line json, as follows:
$ zoomeye search "telnet" -save banner=telnet
save file to telnet_1_1610446755.json successful!
$ cat telnet_1_1610446755.json
{'ip': '218.223.21.91', 'banner': '\\xff\\xfb\\x01\\xff\\xfb\\x03\\xff\\xfd\\x03TELNET session now in ESTABLISHED state\\r\\n\\r\\n'}
if you use ``-save`` without any parameters, the query result will be
saved as a file according to the json format of ``ZoomEye API``. this
method is generally used to integrate data while retaining metadata;
the file can be as input, it is parsed and processed again through
``cli``, such as ``zoomeye search "xxxxx.json"``.
8.graphical data
^^^^^^^^^^^^^^^^
The ``-figure`` parameter is a data visualization parameter. This parameter provides two display methods: ``pie (pie chart)`` and ``hist (histogram)``. The data will still be displayed without specifying it. When ``-figure`` is specified , Only graphics will be displayed. The pie chart is as follows:
The histogram is as follows:
9. IP history
^^^^^^^^^^^^^
``ZoomEye-python`` provides the function of querying IP historical device data. Use the command ``history [ip]`` to query the historical data of IP devices. The usage is as follows:
$zoomeye history "207.xx.xx.13" -num 1
207.xx.xx.13
Hostnames: [unknown]
Country: United States
City: Lake Charles
Organization: fulair.com
Lastupdated: 2021-02-18T03:44:06
Number of open ports: 1
Number of historical probes: 1
timestamp port/service app raw_data
2021-02-18 03:44:06 80/http Apache httpd HTTP/1.0 301 Moved Permanently...
By default, five fields are shown to users:
1. time recorded time
2. service Open service
3. port port
4. app web application
5. raw fingerprint information
Use ``zoomeye history -h`` to view the parameters provided by ``history``.
$zoomeye history -h
usage: zoomeye history [-h] [-filter filed=regexp] [-force] ip
positional arguments:
ip search historical device IP
optional arguments:
-h, --help show this help message and exit
-filter filed=regexp filter data and print raw data detail. field:
[time,port,service,app,raw]
-force ignore the local cache and force the data to be
obtained from the API
The following is a demonstration of ``-filter``:
$zoomeye history "207.xx.xx.13" -filter "time=^2019-08,port,service"
207.xx.xx.13
Hostnames: [unknown]
Country: United States
City: Lake Charles
Organization: fulair.com
Lastupdated: 2019-08-16T10:53:46
Number of open ports: 3
Number of historical probes: 3
time port service
2019-08-16 10:53:46 389 ldap
2019-08-08 23:32:30 22 ssh
2019-08-03 01:55:59 80 http
The `-filter` parameter supports the filtering of the following five fields:
1.time scan time
2.port port information
3.service open service
4.app web application
5.banner original fingerprint information
* when this symbol is included, show all field details
A display of the ``id`` field is added during the display. ``id`` is the serial number. For the convenience of viewing, it cannot be used as a filtered field.
Note: At present, only the above five fields are allowed to filter.
The user quota will also be consumed when using the ``history`` command. The user quota will be deducted for the number of pieces of data returned in the ``history`` command. For example: IP "8.8.8.8" has a total of ``944`` historical records, and the user quota of ``944`` is deducted for one query.
10. search IP information
^^^^^^^^^^^^^^^^^^^^^^^^^
You can query the information of the specified IP through the ``zoomeye ip`` command, for example:
$ zoomeye ip 185.*.*.57
185.*.*.57
Hostnames: [unknown]
Isp: [unknown]
Country: Saudi Arabia
City: [unknown]
Organization: [unknown]
Lastupdated: 2021-03-02T11:14:33
Number of open ports: 4{2002, 9002, 123, 25}
port service app banner
9002 telnet \xff\xfb\x01\xff\xfb\x0...
123 ntp ntpd \x16\x82\x00\x01\x05\x0...
2002 telnet Pocket CMD telnetd \xff\xfb\x01\xff\xfb\x0...
25 smtp Cisco IOS NetWor... 220 10.1.10.2 Cisco Net...
The ``zoomeye ip`` command also supports the filter parameter ``-filter``, and the syntax is the same as that of ``zoomeye search``. E.g:
$ zoomeye ip "185.*.*.57" -filter "app,app=ntpd"
Hostnames: [unknown]
Isp: [unknown]
Country: Saudi Arabia
City: [unknown]
Organization: [unknown]
Lastupdated: 2021-02-17T02:15:06
Number of open ports: 0
Number of historical probes: 1
app
ntpd
The fields supported by the ``filter`` parameter are:
1.port port information
2.service open service
3.app web application
4.banner original fingerprint information
Note: This function limits the number of queries per user per day based on different user levels.
Registered users and developers can query 10 times a day
Advanced users can query 20 times a day
VIP users can query 30 times a day
After the number of times per day is used up, it will be refreshed after 24 hours, that is, counting from the time of the first IP check, and the number of refreshes after 24 hours.
11.cleanup function
^^^^^^^^^^^^^^^^^^^^
Users search for a large amount of data every day, which causes the storage space occupied by the cache folder to gradually increase; if users use ``ZoomEye-python`` on a public server, it may cause their own ``API KEY`` and ``ACCESS TOKEN`` to leak .
For this reason, ``ZoomEye-python`` provides the clear command ``zoomeye clear``, which can clear the cached data and user configuration. The usage is as follows:
$zoomeye clear -h
usage: zoomeye clear [-h] [-setting] [-cache]
optional arguments:
-h, --help show this help message and exit
-setting clear user api key and access token
-cache clear local cache file
11.data cache
^^^^^^^^^^^^^
``ZoomEye-python`` provides a caching in ``cli`` mode, which is located
under ``~/.config/zoomeye/cache`` to save user quota as much as
possible; the data set that the user has queried will be cached locally
for 5 days. when users query the same data set, quotas are not consumed.
13.domain name query
^^^^^^^^^^^^^^^^^^^^
``ZoomEye-python`` provides the domain name query function (including associated domain name query and subdomain name query). To query a domain name, run the domain [domain name] [query type] command as follows:
$ python cli.py domain baidu.com 0
name timestamp ip
zszelle.baidu30a72.bf.3dtops.com 2021-06-27 204.11.56.48
zpvpcxa.baidu.3dtops.com 2021-06-27 204.11.56.48
zsrob.baidu.3dtops.com 2021-06-27 204.11.56.48
zw8uch.7928.iwo7y0.baidu82.com 2021-06-27 59.188.232.88
zydsrdxd.baidu.3dtops.com 2021-06-27 204.11.56.48
zycoccz.baidu.3dtops.com 2021-06-27 204.11.56.48
total: 30/79882
By default, the user is presented with three more important fields:
1. name 域名全称
2. timestamp 建立时间戳
3. ip ip地址
Use ``zoomeye domain -h`` to view parameters provided by the ``domain``.
$ python cli.py domain -h
usage: zoomeye domain [-h] [-page PAGE] [-dot] q {0,1}
positional arguments:
q search key word(eg:baidu.com)
{0,1} 0: search associated domain;1: search sub domain
optional arguments:
-h, --help show this help message and exit
-page PAGE view the page of the query result
-dot generate a network map of the domain name
The following is a demonstration of ``-page`` :(default query for the first page when not specified)
$ python cli.py domain baidu.com 0 -page 3
name timestamp ip
zvptcfua.baidu6c7be.mm.3dtops.com 2021-06-27 204.11.56.48
zmukxtd.baidu65c78.iw.3dtops.com 2021-06-27 204.11.56.48
zhengwanghuangguanxianjinkaihu.baidu.fschangshi.com 2021-06-27 23.224.194.175
zibo-baidu.com 2021-06-27 194.56.78.148
zuwxb4.jingyan.baidu.66players.com 2021-06-27 208.91.197.46
zhannei.baidu.com.hypestat.com 2021-06-27 67.212.187.108
zrr.sjz-baidu.com 2021-06-27 204.11.56.48
zp5hd1.baidu.com.ojsdi.cn 2021-06-27 104.149.242.155
zhidao.baidu.com.39883.wxeve.cn 2021-06-27 39.98.202.39
zhizhao.baidu.com 2021-06-27 182.61.45.108
zfamnje.baidu.3dtops.com 2021-06-27 204.11.56.48
zjnfza.baidu.3dtops.com 2021-06-27 204.11.56.48
total: 90/79882
The ``-dot`` parameter can generate a network map of domain name and IP,Before using this function, you need to install ``grapvhiz``.
Please refer to `grapvhiz <https://graphviz.org/download/>`_ for the installation tutorial. It is supported on Windows/Linux/Mac.
The ``-dot`` parameter will generate a picture in ``png`` format and save the original dot language script at the same time.
0x03 video
~~~~~~~~~~
`ZoomEye-python is demonstrated under Windows, Mac, Linux, FreeBSD
<https://weibo.com/tv/show/1034:4597603044884556?from=old_pc_videoshow>`_
|asciicast|
0x04 use SDK
~~~~~~~~~~~~
1.initialize token
^^^^^^^^^^^^^^^^^^
Similarly, the SDK also supports API-KEY authentication methods,
``APIKEY``, as follows:
**APIKEY**
from zoomeye.sdk import ZoomEye
zm = ZoomEye(api_key="01234567-acbd-00000-1111-22222222222")
2.SDK API
^^^^^^^^^
The following are the interfaces and instructions provided by the SDK:
1.dork_search(dork, page=0, resource="host", facets=None)
search the data of the specified page according to dork
2.multi_page_search(dork, page=1, resource="host", facets=None)
search multiple pages of data according to dork
3.resources_info()
get current user information
4.show_count()
get the number of all matching results under the current dork
5.dork_filter(keys)
extract the data of the specified field from the search results
6.get_facet()
get statistical results of all data from search results
7.history_ip(ip)
query historical data information of an ip
8.show_site_ip(data)
traverse the web-search result set, and output the domain name and ip address
9.show_ip_port(data)
traverse the host-search result set and output the ip address and port
10.generate_dot(self, q, source=0, page=1)
Generate graphviz files and pictures written in the domain center
3.SDK example
^^^^^^^^^^^^^
$ python3
>>> import zoomeye.sdk as zoomeye
>>> dir(zoomeye)
['ZoomEye', 'ZoomEyeDict', '__builtins__', '__cached__', '__doc__',
'__file__', '__loader__', '__name__', '__package__', '__spec__',
'fields_tables_host', 'fields_tables_web', 'getpass', 'requests',
'show_ip_port', 'show_site_ip', 'zoomeye_api_test']
>>> # Use API-KEY search
>>> zm = zoomeye.ZoomEye(api_key="01234567-acbd-00000-1111-22222222222")
>>> data = zm.dork_search('apache country:cn')
>>> zoomeye.show_site_ip(data)
213.***.***.46.rev.vo***one.pt ['46.***.***.213']
me*****on.o****e.net.pg ['203.***.***.114']
soft********63221110.b***c.net ['126.***.***.110']
soft********26216022.b***c.net ['126.***.***.22']
soft********5084068.b***c.net ['126.***.***.68']
soft********11180040.b***c.net ['126.***.***.40']
4.search
^^^^^^^^
As in the above example, we use ``dork_search()`` to search, and we can
also set the ``facets`` parameter to obtain the aggregated statistical
results of the full data of the dork. for the fields supported by
``facets``, please refer to **2.use cli - 5.statistics**. as follows:
>>> data = zm.dork_search('telnet', facets='app')
>>> zm.get_facet()
{'product': [{'name': '', 'count': 28323128}, {'name': 'BusyBox telnetd', 'count': 10180912}, {'name': 'Linux telnetd', ......
``multi_page_search()`` can also search. use this function when you
need to obtain a large amount of data, where the ``page`` field
indicates how many pages of data are obtained; and ``dork_search()``
only obtains the data of a specified page.
5.data filter
^^^^^^^^^^^^^
the ``dork_filter()`` function is provided in the SDK, we can filter the
data more conveniently and extract the specified data fields as follows:
>>> data = zm.dork_search("telnet")
>>> zm.dork_filter("ip,port")
[['180.*.*.166', 5357], ['180.*.*.6', 5357], ......
since the fields returned by ``web-search`` and ``host-search``
interfaces are different, you need to fill in the correct fields when
filtering. the fields included in ``web-search``: app / headers /
keywords / title / ip / site / city / country the fields included in
``host-search``: app / version / device / ip / port / hostname / city
/ country / asn / banner
0x05 contributions
~~~~~~~~~~~~~~~~~~
| `r0oike@knownsec 404 <https://github.com/r0oike>`__
| `0x7F@knownsec 404 <https://github.com/0x7Fancy>`__
| `fenix@knownsec 404 <https://github.com/13ph03nix>`__
| `dawu@knownsec 404 <https://github.com/d4wu>`__
0x06 issue
~~~~~~~~~~
| **1.The minimum number of requests for SDK and command line tools is
20**
| Due to API limitations, the minimum unit of our query is 20 pieces of
data at a time. for a new dork, whether it is to view the total number
or specify to search for only 1 piece of data, there will be an
overhead of 20 pieces; of course, in the cli, we provide a cache, the
data that has been searched is cached locally
(``~/.config/zoomeye/cache``), and the validity period is 5 days,
which can greatly save quota.
| **2.How to enter dork with quotes?**
| When using cli to search, you will encounter dork with quotes, for example: ``"<body style=\"margin:0;padding:0\"> <p align=\"center\"> <iframe src=\ "index.xhtml\""``, when dork contains quotation marks or multiple quotation marks, the outermost layer of dork must be wrapped in quotation marks to indicate a parameter as a whole, otherwise command line parameter parsing will cause problems. Then the correct search method for the following dork should be: ``'"<body style=\"margin:0;padding:0\"> <p align=\"center\"> <iframe src=\"index.xhtml\" "'``.
| **3.Why is there inconsistent data in facet?**
| The following figure shows the full data statistics results of
``telnet``. the result of the first query is that 20 data query
requests (including the statistical results) were initiated by cli one
day ago by default, and cached in a local folder; the second time We
set the number of queries to 21, cli will read 20 cached data and
initiate a new query request (actually the smallest unit is 20, which
also contains statistical results), the first query and the second
query a certain period of time is in between. during this period of
time, ``ZoomEye`` periodically scans and updates the data, resulting
in the above data inconsistency, so cli will use the newer statistical
results.
| **4.Why may the total amount of data in ZoomEye-python and the browser
search the same dork be different?**
| ``ZoomEye`` provides two search interfaces: ``/host/search`` and ``/web/search``. In ``ZoomEye-python``, only ``/host/search`` is used by default, and ``/web/search`` is not used. Users can choose the search method according to their needs by specifying the ``type`` parameter.
| **5.The quota information obtained by the info command may be
inconsistent with the browser side?**
| The browser side displays the free quota and recharge quota
(https://www.zoomeye.org/profile/record), but only the free quota
information is displayed in ``ZoomEye-python``, we will fix it in the
subsequent version This question.
0x07 404StarLink Project
~~~~~~~~~~~~~~~~~~~~~~~~
``ZoomEye-python`` is a part of 404Team `Starlink
Project <https://github.com/knownsec/404StarLink-Project>`__. If you
have any questions about ``ZoomEye-python`` or want to talk to a small
partner, you can refer to The way to join the group of Starlink Project.
%prep
%autosetup -n zoomeye-2.2.0
%build
%py3_build
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%files -n python3-zoomeye -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Mon May 29 2023 Python_Bot <Python_Bot@openeuler.org> - 2.2.0-1
- Package Spec generated
|