/opt/dedrads/python/__pycache__
NameSizeModeActions
audit_dns.cpython-313.pyc65010644editdlrm
header.cpython-313.pyc8800644editdlrm
humanize.cpython-313.pyc37860644editdlrm
__init__.cpython-313.pyc1280644editdlrm
Edit: /opt/dedrads/python/__pycache__/audit_dns.cpython-313.pyc (6501B)
}jSrSSKJr SSKrSSKrSSKrSSKJr S\\ \ \ 44Sjr S\ S-4Sjr S \ 4S jr S \ S\ 4S jrS \ \ \ 44SjrSrSrSrSrg)zThis 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)whmapi1returnc[SSS9SSnU$![a#n[U[RS9 SnAW$SnAff=f)zDUses cPanel API to grab all zones. Used with server() but not user() listzonesT)checkdatazonefileN)r Exceptionprintsysstderr)zonesexcs /opt/dedrads/python/audit_dns.py get_zonesr sI$ 408@ L $ c # L$s A<AsoacUS: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 columnNr )splitr rrr)rrs r formatted_soarsL "999;q> !   c # s A AA A  dig_resultscLUR5S:XagUR5$)z'strips leading and end spacing from digrN)strip)rs r clean_digr!s%b     argscTS/nURU5 [R"USS9$)Nz /usr/bin/digT)text)extend subprocess check_output)r cmds rdigr'(s)  CJJt  " "3T 22rdom_dictcUSR5nSUSUUS[[USUS55[[USUSS55[[[USUSS555[[USUSS55S.US [[US US55[[US USS55[[[US USS555[[US USS55S.S [[S US55[[S USS55[[[S USS555[[S USS55S.0/nU$) zYMakes a dictionary of dig @ns1, @ns2, and @8.8.8.8 results for txt, A record, soa, and MXdomainlocalnsrz+shorttxtrmx)Ar,rr-googz8.8.8.8)rrr'r)r+r( check_domaindnsinfos r dig_domainr3.sH%++-L l w AJs71:|XFG  L%B%c'!*lE8LM GAJ dH MN  AJs71:|XFG  L%B%c'!*lE8LM GAJ dH MN  s9lHEF Y eX!NO$c)\5(KL I|T8 LM / !GD NrcS[5;aSS/nOSS/n[5n/nUHnUR[X55 M U$)zCall 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)rrappendr3)r+r zonesinfodoms rserverr=WsS$& +-EF,.HI KEIG12 rcS[5;aSS/nOSS/n[U5n/nUHnUR[X55 M U$)zCall 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 ruserrAfsV$& +-EF,.HI x EIG12 rcSUS3n[USS9n[R"U[RS9nSSS5 /nWb_USnURXUS 3S .5 US HnURXfS 3S .5 M US HnURXwS 3S .5 M U$!,(df  Nt=f![[ 4a [ R"S5 Nf=f) zUsed 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*zonefileparked_domains addon_domains) openyamlload SafeLoaderOSError ValueErrorrexitr:)r@pathfdata_maprrEparkedaddons rr?r?vs#8*E 2D4 $ )Qyy4??;H* E}-  =9LMN/0F LLF(#G H1o.E LLE}E F/ L* ) Z 4 234s- B5$B$B5$ B2.B52B55&CCcZS[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$& +-EF,.HI c/B CCG)*I r)__doc__platformrr$rrKcpapisrlistdictstrrrrr'r3r=rAr?r*rrr`s= 4S#X' sTz 33s3s3 &$sCx.&R   , r