Server IP : 104.244.120.118  /  Your IP : 216.73.216.198
Web Server : Apache
System : Linux ded5817.inmotionhosting.com 5.14.0-741.22.1.el9_9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Nov 12 14:34:46 UTC 2026 x86_64
User : persoanlinjuryla ( 1006)
PHP Version : 8.5.13
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF
Directory (0755) :  /../../opt/dedrads/python/../python/../python/../python/__pycache__/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //../../opt/dedrads/python/../python/../python/../python/__pycache__/audit_dns.cpython-313.pyc
�

�i�j����SrSSKJr SSKrSSKrSSKrSSKJr S\\	\
\
44SjrS\
S-4SjrS	\
4S
jr
S\
S\
4SjrS
\	\
\
44SjrSrSrSrSrg)z�This will grab zone files and then check @ns1, @ns2, and @8.8.8.8 for
conflicting records. There are two main items that should be called from other
scripts: check_dns.server() and check_dns.user('userna5')�)�nodeN)�whmapi1�returnc��[SSS9SSnU$![a#n[U[RS9 SnAW$SnAff=f)zDUses cPanel API to grab all zones. Used with server() but not user()�	listzonesT)�check�data�zone��fileN)r�	Exception�print�sys�stderr)�zones�excs  � /opt/dedrads/python/audit_dns.py�	get_zonesrsI��$���4�0��8��@���L���$�
�c��
�
�#��L��$�s��
A�<�A�soac��US:waUbUR5S$g![a$n[U[RS9 UsSnA$SnAff=f)zYGrabs Just the SOA part of what is returned when you dig SOA which is
always in $3 column�N�r)�splitr
rrr)rrs  r�
formatted_soarsL����"�9����9�9�;�q�>�!�����
�c��
�
�#��
���s��
A
�A�A
�A
�dig_resultsc�L�UR5S:XagUR5$)z'strips leading and end spacing from digrN)�strip)rs r�	clean_digr!s%������b� ��������argsc�T�S/nURU5 [R"USS9$)Nz/usr/bin/digT)�text)�extend�
subprocess�check_output)r �cmds  r�digr'(s)���
�C��J�J�t���"�"�3�T�2�2r�dom_dictc���USR5nSUSUUS[[USUS55[[USUSS55[[[USUSS555[[USUSS55S.US	[[US	US55[[US	USS55[[[US	USS555[[US	USS55S.S
[[SUS55[[SUSS55[[[SUSS555[[SUSS55S.0/nU$)zYMakes a dictionary of dig @ns1, @ns2, and @8.8.8.8 results for txt, A
record, soa, and MX�domain�localnsrz+short�txtr�mx)�Ar,rr-��googz8.8.8.8)rrr'r)r+r(�check_domain�dnsinfos    r�
dig_domainr3.s����H�%�+�+�-�L�
�l��w��A�J��s�7�1�:�|�X�F�G� ����
�L�%��B��%��c�'�!�*�l�E�8�L�M�� ��G�A�J��d�H� M�N�	�
�A�J��s�7�1�:�|�X�F�G� ����
�L�%��B��%��c�'�!�*�l�E�8�L�M�� ��G�A�J��d�H� M�N�	�
��s�9�l�H�E�F� ��Y��e�X�!N�O�$��c�)�\�5�(�K�L�� ��I�|�T�8� L�M�
�/	
�!�G�D�Nrc��S[5;aSS/nOSS/n[5n/nUHnUR[X55 M U$)z�Call from the outside. Will give results for all domains on the server
checks for mismatching in @ns and @ns2, missing at @ns and mismatching with
public record.�
webhostinghub�@ns1.webhostinghub.com�@ns2.webhostinghub.com�@ns.inmotionhosting.com�@ns2.inmotionhosting.com)rr�appendr3)r+r�	zonesinfo�doms    r�serverr=WsS���$�&� �+�-E�F��,�.H�I���K�E��I�������G�1�2���rc��S[5;aSS/nOSS/n[U5n/nUHnUR[X55 M U$)z�Call from the outside. Will give results for all addon, parked, and main
domain for one user Grab addons, main_domain, and parked domain from
userdata files. Lots of this part stolen from account_reviewr5r6r7r8r9)r�
user_zonesr:r3)�usernamer+rr;r<s     r�userrAfsV���$�&� �+�-E�F��,�.H�I���x� �E��I�������G�1�2���rc���SUS3n[USS9n[R"U[RS9nSSS5 /nWb_USnURXUS	3S
.5 USHnURXfS	3S
.5 M USHnURXwS	3S
.5 M U$!,(df   Nt=f![[
4a [R"S5 N�f=f)
z�Used by user() instead of cPanel API to pull zones quickly from userdata
files Doing this via API would require list_accounts, listaddon, and
listparked. 3 slow callsz/var/cpanel/userdata/z/mainzutf-8)�encoding)�LoaderNzuserdata not found or corrupted�main_domain�.db)r*�zonefile�parked_domains�
addon_domains)	�open�yaml�load�
SafeLoader�OSError�
ValueErrorr�exitr:)r@�path�f�data_maprrE�parked�addons        rr?r?vs���#�8�*�E�2�D�4�
�$��
)�Q��y�y��4�?�?�;�H�*�

�E����}�-��
����=��9L�M�N��/�0�F��L�L�F�(�#��G�H�1��o�.�E��L�L�E���}�E�F�/��L�*�
)���Z� �4����2�3�4�s-�
B5�$B$�B5�$
B2�.B5�2B5�5&C�Cc�Z�S[5;aSS/nOSS/nXS3S.n[X5/nU$)z0Call from the outside. Used for a single domain.r5r6r7r8r9rF)r*�	zone_file)rr3)�domain_namer+r<r;s    rr*r*�sD���$�&� �+�-E�F��,�.H�I�� ��c�/B�
C�C��G�)�*�I��r)�__doc__�platformrr$rrK�cpapisr�list�dict�strrrrr'r3r=rAr?r*�rr�<module>r`s���=���
����4��S�#�X��'��	�s�T�z�	��3��3�s�3�s�3�&�$�s�C�x�.�&�R�
� �,	r