
    5i                     N    d dl Z d Zedk    r e            Z ee           dS dS )    Nc                  0   ddg} d }i }t          j        dt           j                  }d}t          j        ||          }t	          d          D ]}	 t          j        ||          }t          j        ||          }| D ]}	 |||	          D ]}
d||
<   G# t          $ r3}|j        d         dk    rY d}~ n@|j        d         d	k    rY d}~~ d}~wt          $ r}t          |           Y d}~d}~ww xY wt          |                                          S )
z
	Returns a list of IP addresses which potentially an active DNS server used by the current machine.
	Please be aware that it's not at all precise!
	
NameServerDhcpNameServerc                    	 i }t          j        | |          \  }}t          |          dk    r<|                    d          dk    r|                    d          D ]}d||<   nd||<   n# t
          $ r
}Y d }~nd }~ww xY wt          |                                          S # t          |                                          c cY S xY w)Nr   ,)winregQueryValueExlenfindsplit	Exceptionlistkeys)ifacekeynameresultres_xes          R/home/kali/Ninja/venv/lib/python3.11/site-packages/winacl/functions/winregistry.pyget_ipsz*get_nameserver_candidates.<locals>.get_ips
   s    6g..63	#hhll
xx}}iinn  fQii VC[	   4444 v{{}}

$v{{}}

s*   A)A, +B$ ,
B 6B$ ;B  B$ $$C
Nz=System\CurrentControlSet\Services\Tcpip\Parameters\Interfacesi   r      i  )r	   ConnectRegistryHKEY_LOCAL_MACHINEOpenKeyrangeEnumKeyOSErrorargsr   printr   r   )keynamesr   ipshklmkeyaKeyiasubkey_namer   r   r   r   s               r   get_nameserver_candidatesr*      sj   
 +,   
tV%>??FtS!!
++  QtA&&<>$--5  wwug&&  SXX 
 
 
 
fQi2oo	EEEEE	q	SHHHH		   88888888 	SXXZZs1   AB
C4 C7CCC4C//C4__main__)r	   r*   __name__r   r"        r   <module>r/      sR    + + +Z z  q r.   