@@ -467,6 +467,9 @@ def __init__(self, base_domain = None, task_id = None, options = None):
467
467
#用来区分是正常任务还是监控任务
468
468
self .task_tag = "task"
469
469
470
+ #用来存放泛解析域名映射的IP
471
+ self ._not_found_domain_ips = None
472
+
470
473
self .npoc_service_target_set = set ()
471
474
472
475
scan_port_map = {
@@ -483,6 +486,17 @@ def __init__(self, base_domain = None, task_id = None, options = None):
483
486
}
484
487
self .scan_port_option = scan_port_option
485
488
489
+ @property
490
+ def not_found_domain_ips (self ):
491
+ if self ._not_found_domain_ips is None :
492
+ fake_domain = "at" + utils .random_choices (4 ) + "." + self .base_domain
493
+ self ._not_found_domain_ips = utils .get_ip (fake_domain )
494
+
495
+ if self ._not_found_domain_ips :
496
+ logger .info ("not_found_domain_ips {} {}" .format (fake_domain , self ._not_found_domain_ips ))
497
+
498
+ return self ._not_found_domain_ips
499
+
486
500
def save_domain_info_list (self , domain_info_list , source = CollectSource .DOMAIN_BRUTE ):
487
501
for domain_info_obj in domain_info_list :
488
502
domain_info = domain_info_obj .dump_json (flag = False )
@@ -515,6 +529,13 @@ def clear_domain_info_by_record(self, domain_info_list):
515
529
continue
516
530
517
531
record = info .record_list [0 ]
532
+
533
+ ip = info .ip_list [0 ]
534
+
535
+ # 解决泛解析域名问题,果断剔除
536
+ if ip in self .not_found_domain_ips :
537
+ continue
538
+
518
539
cnt = self .record_map .get (record , 0 )
519
540
cnt += 1
520
541
self .record_map [record ] = cnt
@@ -554,6 +575,20 @@ def arl_search(self):
554
575
logger .info ("end arl fetch {} {} elapse {}" .format (
555
576
self .base_domain , len (domain_info_list ), elapse ))
556
577
578
+ def crtsh_search (self ):
579
+ t1 = time .time ()
580
+ logger .info ("start crtsh search {}" .format (self .base_domain ))
581
+ crtsh_domains = services .crtsh_search (self .base_domain )
582
+ domain_info_list = self .build_domain_info (crtsh_domains )
583
+ if self .task_tag == "task" :
584
+ domain_info_list = self .clear_domain_info_by_record (domain_info_list )
585
+ self .save_domain_info_list (domain_info_list , source = CollectSource .CRTSH )
586
+
587
+ self .domain_info_list .extend (domain_info_list )
588
+ elapse = time .time () - t1
589
+ logger .info ("end crtsh search {} {} elapse {}" .format (
590
+ self .base_domain , len (domain_info_list ), elapse ))
591
+
557
592
def build_domain_info (self , domains ):
558
593
"""
559
594
构建domain_info_list 带去重功能
@@ -900,14 +935,22 @@ def domain_fetch(self):
900
935
self .domain_info_list .append (domain_info )
901
936
self .save_domain_info_list ([domain_info ])
902
937
903
- ''' ***RiskIQ查询****'''
938
+ # ***RiskIQ查询****
904
939
if self .options .get ("riskiq_search" ) and services .riskiq_quota () > 0 :
905
940
self .update_task_field ("status" , "riskiq_search" )
906
941
t1 = time .time ()
907
942
self .riskiq_search ()
908
943
elapse = time .time () - t1
909
944
self .update_services ("riskiq_search" , elapse )
910
945
946
+ # crt.sh 网站查询
947
+ if self .options .get ("crtsh_search" ):
948
+ self .update_task_field ("status" , "crtsh_search" )
949
+ t1 = time .time ()
950
+ self .crtsh_search ()
951
+ elapse = time .time () - t1
952
+ self .update_services ("crtsh_search" , elapse )
953
+
911
954
if self .options .get ("arl_search" ):
912
955
self .update_task_field ("status" , "arl_search" )
913
956
t1 = time .time ()
@@ -1084,6 +1127,7 @@ def brute_config(self):
1084
1127
item ["save_date" ] = utils .curr_date ()
1085
1128
utils .conn_db ('vuln' ).insert_one (item )
1086
1129
1130
+
1087
1131
def run (self ):
1088
1132
1089
1133
self .update_task_field ("start_time" , utils .curr_date ())
@@ -1133,7 +1177,8 @@ def add_domain_to_scope(domain, scope_id):
1133
1177
'site_spider' : False ,
1134
1178
'search_engines' : False ,
1135
1179
'ssl_cert' : False ,
1136
- 'fofa_search' : False
1180
+ 'fofa_search' : False ,
1181
+ 'crtsh_search' : True
1137
1182
}
1138
1183
}
1139
1184
0 commit comments