
    |*&ie                     F    S SK r S SKrS SKrS SKrS SKJrJr  S SKJr  S r	g)    N)ensure_cache_directoryis_cache_valid)print_greyed_outc                   ^ U R                  S5      n[        R                  R                  US5      mSnSnU4S jn[	        X5        [        U TU5      (       a8   [        TSSS9 n[        R                  " U5      nS S S 5        [        S	5        W$ U" 5       $ ! , (       d  f       N"= f! [         a"  n[        S
T SU 35        U" 5       s S nA$ S nAff = f)N	cache_dirzcisa_kev_cache.jsoniX  CISA_KEV_DATA_LOADERc                    >  [        S5        [        R                  " SSS9n U R                  S:X  aG  U R	                  5       n[        TSSS9 n[        R                  " XS	S
S9  S S S 5        [        S5        U$ [        SU R                   35         0 $ ! , (       d  f       N6= f! [         a  n[        SU 35         S nA0 $ S nAff = f)Nz9[*] CISA_KEV_DATA_LOADER: Downloading CISA KEV catalog...zShttps://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json   )timeout   wutf-8encodingF   )ensure_asciiindentzA[+] CISA_KEV_DATA_LOADER: CISA KEV catalog downloaded and cached.zI[!] CISA_KEV_DATA_LOADER: Failed to fetch CISA KEV catalog. Status code: z8[!] CISA_KEV_DATA_LOADER: Error fetching CISA KEV data: )r   httpxgetstatus_codejsonopendump	Exception)responsedatafe
cache_files       C/home/kali/cveseeker/services/cache/loaders/cisa_kev_data_loader.pydownload_and_cache.load_cisa_kev_data.<locals>.download_and_cache   s    	]XYyyeH ##s*}}*cG<IIdE!D = !de #lmu  nB  nB  mC  "D  E 	 =<  	]WXYWZ[\\		]s6   AB& B%B& :B& 
B#B& &
C	0CC	rr   r   z:[+] CISA_KEV_DATA_LOADER: Loaded CISA KEV data from cache.z4[!] CISA_KEV_DATA_LOADER: Error reading cache file 'z': )r   ospathjoinr   r   r   r   loadr   r   )	configr   cache_durationnamer!   r   r   r   r   s	           @r    load_cisa_kev_datar+   	   s    

;'Ii)>?JN!D& 9+fj.99	(j#8Ayy| 9YZK
 "## 98  	(ST^S__bcdbefg%''	(s6   B* &B=B* 
B'#B* *
C4CCC)
r$   timer   r   services.cache.loaders.loaderr   r   terminal.clir   r+        r    <module>r1      s    	    P )&$r0   