/opt/dedrads/python/__pycache__
Edit: /opt/dedrads/python/__pycache__/audit_dns.cpython-313.pyc (6501B)
}j S r SSKJr SSKrSSKrSSKrSSKJr S\\ \
\
4 4S jrS\
S- 4S jrS \
4S
jr
S\
S\
4S jrS
\ \
\
4 4S jrS rS rS rS rg)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 [ SSS9S S n U $ ! [ a# n[ U[ R S9 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<Asoac U S:w a U b U R 5 S $ g! [ a$ n[ U[ R S9 U s SnA$ SnAff = f)zYGrabs Just the SOA part of what is returned when you dig SOA which is
always in $3 column N r )splitr
r r r )r r s r
formatted_soar sL "999;q>!
c
#
s
A
AA
A
dig_resultsc L U R 5 S:X a gU R 5 $ )z'strips leading and end spacing from digr N)strip)r s r clean_digr ! s% b argsc T S/nUR U 5 [ R " USS9$ )Nz/usr/bin/digT)text)extend
subprocesscheck_output)r cmds r digr' ( s)
CJJt""3T22r dom_dictc US R 5 nSUSU U S [ [ U S US5 5 [ [ U S USS5 5 [ [ [ U S USS5 5 5 [ [ U S USS5 5 S.U S [ [ U S US5 5 [ [ U S USS5 5 [ [ [ U S USS5 5 5 [ [ U S USS5 5 S.S
[ [ SUS5 5 [ [ SUSS5 5 [ [ [ SUSS5 5 5 [ [ SUSS5 5 S.0/nU$ )zYMakes a dictionary of dig @ns1, @ns2, and @8.8.8.8 results for txt, A
record, soa, and MXdomainlocalnsr z+shorttxtr mx)Ar, r r- googz8.8.8.8)r r r' r )r+ r( check_domaindnsinfos r
dig_domainr3 . s H%++-L
lwAJs71:|XFG
L%B %c'!*lE8LM GAJdH MN
AJs71:|XFG
L%B %c'!*lE8LM GAJdH MN
s9lHEF YeX!NO$c)\5(KL I|T8 LM
/
!GD Nr c S[ 5 ; a SS/n OSS/n [ 5 n/ nU H nUR [ X5 5 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)r r appendr3 )r+ r zonesinfodoms r serverr= W sS $& +-EF,.HIKEIG12 r c S[ 5 ; a SS/nOSS/n[ U 5 n/ nU H nUR [ X5 5 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_reviewr5 r6 r7 r8 r9 )r
user_zonesr: r3 )usernamer+ r r; r<