Linux ip-148-66-134-25.ip.secureserver.net 3.10.0-1160.119.1.el7.tuxcare.els10.x86_64 #1 SMP Fri Oct 11 21:40:41 UTC 2024 x86_64
Apache
: 148.66.134.25 | : 18.226.93.22
66 Domain
8.0.30
amvm
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
BLACK DEFEND!
README
+ Create Folder
+ Create File
/
usr /
lib64 /
python2.7 /
site-packages /
dns /
[ HOME SHELL ]
Name
Size
Permission
Action
rdtypes
[ DIR ]
drwxr-xr-x
__init__.py
1.3
KB
-rw-r--r--
__init__.pyc
765
B
-rw-r--r--
__init__.pyo
765
B
-rw-r--r--
dnssec.py
14.37
KB
-rw-r--r--
dnssec.pyc
13.46
KB
-rw-r--r--
dnssec.pyo
13.38
KB
-rw-r--r--
e164.py
3.01
KB
-rw-r--r--
e164.pyc
2.76
KB
-rw-r--r--
e164.pyo
2.76
KB
-rw-r--r--
edns.py
4.21
KB
-rw-r--r--
edns.pyc
5.2
KB
-rw-r--r--
edns.pyo
5.2
KB
-rw-r--r--
entropy.py
3.79
KB
-rw-r--r--
entropy.pyc
3.7
KB
-rw-r--r--
entropy.pyo
3.7
KB
-rw-r--r--
exception.py
1.29
KB
-rw-r--r--
exception.pyc
1.56
KB
-rw-r--r--
exception.pyo
1.56
KB
-rw-r--r--
flags.py
2.62
KB
-rw-r--r--
flags.pyc
2.58
KB
-rw-r--r--
flags.pyo
2.58
KB
-rw-r--r--
grange.py
1.83
KB
-rw-r--r--
grange.pyc
1.15
KB
-rw-r--r--
grange.pyo
1.08
KB
-rw-r--r--
hash.py
2.34
KB
-rw-r--r--
hash.pyc
2.11
KB
-rw-r--r--
hash.pyo
2.11
KB
-rw-r--r--
inet.py
3.16
KB
-rw-r--r--
inet.pyc
2.61
KB
-rw-r--r--
inet.pyo
2.61
KB
-rw-r--r--
ipv4.py
1.81
KB
-rw-r--r--
ipv4.pyc
1.37
KB
-rw-r--r--
ipv4.pyo
1.37
KB
-rw-r--r--
ipv6.py
4.97
KB
-rw-r--r--
ipv6.pyc
3.44
KB
-rw-r--r--
ipv6.pyo
3.44
KB
-rw-r--r--
message.py
41.63
KB
-rw-r--r--
message.pyc
36.39
KB
-rw-r--r--
message.pyo
36.39
KB
-rw-r--r--
name.py
21.82
KB
-rw-r--r--
name.pyc
23
KB
-rw-r--r--
name.pyo
23
KB
-rw-r--r--
namedict.py
2.06
KB
-rw-r--r--
namedict.pyc
1.92
KB
-rw-r--r--
namedict.pyo
1.92
KB
-rw-r--r--
node.py
5.89
KB
-rw-r--r--
node.pyc
6.15
KB
-rw-r--r--
node.pyo
6.15
KB
-rw-r--r--
opcode.py
2.55
KB
-rw-r--r--
opcode.pyc
2.49
KB
-rw-r--r--
opcode.pyo
2.49
KB
-rw-r--r--
query.py
17.89
KB
-rw-r--r--
query.pyc
15.31
KB
-rw-r--r--
query.pyo
15.31
KB
-rw-r--r--
rcode.py
3.03
KB
-rw-r--r--
rcode.pyc
2.92
KB
-rw-r--r--
rcode.pyo
2.92
KB
-rw-r--r--
rdata.py
15.34
KB
-rw-r--r--
rdata.pyc
16.59
KB
-rw-r--r--
rdata.pyo
16.59
KB
-rw-r--r--
rdataclass.py
3.22
KB
-rw-r--r--
rdataclass.pyc
2.96
KB
-rw-r--r--
rdataclass.pyo
2.96
KB
-rw-r--r--
rdataset.py
11.28
KB
-rw-r--r--
rdataset.pyc
11.08
KB
-rw-r--r--
rdataset.pyo
11.03
KB
-rw-r--r--
rdatatype.py
5.07
KB
-rw-r--r--
rdatatype.pyc
5.29
KB
-rw-r--r--
rdatatype.pyo
5.29
KB
-rw-r--r--
renderer.py
11.63
KB
-rw-r--r--
renderer.pyc
10.85
KB
-rw-r--r--
renderer.pyo
10.75
KB
-rw-r--r--
resolver.py
45.35
KB
-rw-r--r--
resolver.pyc
37.16
KB
-rw-r--r--
resolver.pyo
37.16
KB
-rw-r--r--
reversename.py
3.03
KB
-rw-r--r--
reversename.pyc
2.4
KB
-rw-r--r--
reversename.pyo
2.4
KB
-rw-r--r--
rrset.py
5.76
KB
-rw-r--r--
rrset.pyc
6.17
KB
-rw-r--r--
rrset.pyo
6.17
KB
-rw-r--r--
set.py
7.66
KB
-rw-r--r--
set.pyc
9.81
KB
-rw-r--r--
set.pyo
9.81
KB
-rw-r--r--
tokenizer.py
17.54
KB
-rw-r--r--
tokenizer.pyc
16.92
KB
-rw-r--r--
tokenizer.pyo
16.92
KB
-rw-r--r--
tsig.py
8.1
KB
-rw-r--r--
tsig.pyc
8.08
KB
-rw-r--r--
tsig.pyo
8.08
KB
-rw-r--r--
tsigkeyring.py
1.61
KB
-rw-r--r--
tsigkeyring.pyc
1.16
KB
-rw-r--r--
tsigkeyring.pyo
1.16
KB
-rw-r--r--
ttl.py
2.13
KB
-rw-r--r--
ttl.pyc
1.48
KB
-rw-r--r--
ttl.pyo
1.48
KB
-rw-r--r--
update.py
9.92
KB
-rw-r--r--
update.pyc
8.27
KB
-rw-r--r--
update.pyo
8.27
KB
-rw-r--r--
version.py
1.24
KB
-rw-r--r--
version.pyc
560
B
-rw-r--r--
version.pyo
560
B
-rw-r--r--
wiredata.py
2.53
KB
-rw-r--r--
wiredata.pyc
2.19
KB
-rw-r--r--
wiredata.pyo
2.19
KB
-rw-r--r--
zone.py
37.94
KB
-rw-r--r--
zone.pyc
33.52
KB
-rw-r--r--
zone.pyo
33.52
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : rdata.py
# Copyright (C) 2001-2007, 2009-2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND NOMINUM DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NOMINUM BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT # OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. """DNS rdata. @var _rdata_modules: A dictionary mapping a (rdclass, rdtype) tuple to the module which implements that type. @type _rdata_modules: dict @var _module_prefix: The prefix to use when forming modules names. The default is 'dns.rdtypes'. Changing this value will break the library. @type _module_prefix: string @var _hex_chunk: At most this many octets that will be represented in each chunk of hexstring that _hexify() produces before whitespace occurs. @type _hex_chunk: int""" import cStringIO import dns.exception import dns.name import dns.rdataclass import dns.rdatatype import dns.tokenizer import dns.wiredata _hex_chunksize = 32 def _hexify(data, chunksize=None): """Convert a binary string into its hex encoding, broken up into chunks of I{chunksize} characters separated by a space. @param data: the binary string @type data: string @param chunksize: the chunk size. Default is L{dns.rdata._hex_chunksize} @rtype: string """ if chunksize is None: chunksize = _hex_chunksize hex = data.encode('hex_codec') l = len(hex) if l > chunksize: chunks = [] i = 0 while i < l: chunks.append(hex[i : i + chunksize]) i += chunksize hex = ' '.join(chunks) return hex _base64_chunksize = 32 def _base64ify(data, chunksize=None): """Convert a binary string into its base64 encoding, broken up into chunks of I{chunksize} characters separated by a space. @param data: the binary string @type data: string @param chunksize: the chunk size. Default is L{dns.rdata._base64_chunksize} @rtype: string """ if chunksize is None: chunksize = _base64_chunksize b64 = data.encode('base64_codec') b64 = b64.replace('\n', '') l = len(b64) if l > chunksize: chunks = [] i = 0 while i < l: chunks.append(b64[i : i + chunksize]) i += chunksize b64 = ' '.join(chunks) return b64 __escaped = { '"' : True, '\\' : True, } def _escapify(qstring): """Escape the characters in a quoted string which need it. @param qstring: the string @type qstring: string @returns: the escaped string @rtype: string """ text = '' for c in qstring: if c in __escaped: text += '\\' + c elif ord(c) >= 0x20 and ord(c) < 0x7F: text += c else: text += '\\%03d' % ord(c) return text def _truncate_bitmap(what): """Determine the index of greatest byte that isn't all zeros, and return the bitmap that contains all the bytes less than that index. @param what: a string of octets representing a bitmap. @type what: string @rtype: string """ for i in xrange(len(what) - 1, -1, -1): if what[i] != '\x00': break return ''.join(what[0 : i + 1]) class Rdata(object): """Base class for all DNS rdata types. """ __slots__ = ['rdclass', 'rdtype'] def __init__(self, rdclass, rdtype): """Initialize an rdata. @param rdclass: The rdata class @type rdclass: int @param rdtype: The rdata type @type rdtype: int """ self.rdclass = rdclass self.rdtype = rdtype def covers(self): """DNS SIG/RRSIG rdatas apply to a specific type; this type is returned by the covers() function. If the rdata type is not SIG or RRSIG, dns.rdatatype.NONE is returned. This is useful when creating rdatasets, allowing the rdataset to contain only RRSIGs of a particular type, e.g. RRSIG(NS). @rtype: int """ return dns.rdatatype.NONE def extended_rdatatype(self): """Return a 32-bit type value, the least significant 16 bits of which are the ordinary DNS type, and the upper 16 bits of which are the "covered" type, if any. @rtype: int """ return self.covers() << 16 | self.rdtype def to_text(self, origin=None, relativize=True, **kw): """Convert an rdata to text format. @rtype: string """ raise NotImplementedError def to_wire(self, file, compress = None, origin = None): """Convert an rdata to wire format. @rtype: string """ raise NotImplementedError def to_digestable(self, origin = None): """Convert rdata to a format suitable for digesting in hashes. This is also the DNSSEC canonical form.""" f = cStringIO.StringIO() self.to_wire(f, None, origin) return f.getvalue() def validate(self): """Check that the current contents of the rdata's fields are valid. If you change an rdata by assigning to its fields, it is a good idea to call validate() when you are done making changes. """ dns.rdata.from_text(self.rdclass, self.rdtype, self.to_text()) def __repr__(self): covers = self.covers() if covers == dns.rdatatype.NONE: ctext = '' else: ctext = '(' + dns.rdatatype.to_text(covers) + ')' return '<DNS ' + dns.rdataclass.to_text(self.rdclass) + ' ' + \ dns.rdatatype.to_text(self.rdtype) + ctext + ' rdata: ' + \ str(self) + '>' def __str__(self): return self.to_text() def _cmp(self, other): """Compare an rdata with another rdata of the same rdtype and rdclass. Return < 0 if self < other in the DNSSEC ordering, 0 if self == other, and > 0 if self > other. """ raise NotImplementedError def __eq__(self, other): if not isinstance(other, Rdata): return False if self.rdclass != other.rdclass or \ self.rdtype != other.rdtype: return False return self._cmp(other) == 0 def __ne__(self, other): if not isinstance(other, Rdata): return True if self.rdclass != other.rdclass or \ self.rdtype != other.rdtype: return True return self._cmp(other) != 0 def __lt__(self, other): if not isinstance(other, Rdata) or \ self.rdclass != other.rdclass or \ self.rdtype != other.rdtype: return NotImplemented return self._cmp(other) < 0 def __le__(self, other): if not isinstance(other, Rdata) or \ self.rdclass != other.rdclass or \ self.rdtype != other.rdtype: return NotImplemented return self._cmp(other) <= 0 def __ge__(self, other): if not isinstance(other, Rdata) or \ self.rdclass != other.rdclass or \ self.rdtype != other.rdtype: return NotImplemented return self._cmp(other) >= 0 def __gt__(self, other): if not isinstance(other, Rdata) or \ self.rdclass != other.rdclass or \ self.rdtype != other.rdtype: return NotImplemented return self._cmp(other) > 0 def __hash__(self): return hash(self.to_digestable(dns.name.root)) def _wire_cmp(self, other): # A number of types compare rdata in wire form, so we provide # the method here instead of duplicating it. # # We specifiy an arbitrary origin of '.' when doing the # comparison, since the rdata may have relative names and we # can't convert a relative name to wire without an origin. b1 = cStringIO.StringIO() self.to_wire(b1, None, dns.name.root) b2 = cStringIO.StringIO() other.to_wire(b2, None, dns.name.root) return cmp(b1.getvalue(), b2.getvalue()) def from_text(cls, rdclass, rdtype, tok, origin = None, relativize = True): """Build an rdata object from text format. @param rdclass: The rdata class @type rdclass: int @param rdtype: The rdata type @type rdtype: int @param tok: The tokenizer @type tok: dns.tokenizer.Tokenizer @param origin: The origin to use for relative names @type origin: dns.name.Name @param relativize: should names be relativized? @type relativize: bool @rtype: dns.rdata.Rdata instance """ raise NotImplementedError from_text = classmethod(from_text) def from_wire(cls, rdclass, rdtype, wire, current, rdlen, origin = None): """Build an rdata object from wire format @param rdclass: The rdata class @type rdclass: int @param rdtype: The rdata type @type rdtype: int @param wire: The wire-format message @type wire: string @param current: The offet in wire of the beginning of the rdata. @type current: int @param rdlen: The length of the wire-format rdata @type rdlen: int @param origin: The origin to use for relative names @type origin: dns.name.Name @rtype: dns.rdata.Rdata instance """ raise NotImplementedError from_wire = classmethod(from_wire) def choose_relativity(self, origin = None, relativize = True): """Convert any domain names in the rdata to the specified relativization. """ pass class GenericRdata(Rdata): """Generate Rdata Class This class is used for rdata types for which we have no better implementation. It implements the DNS "unknown RRs" scheme. """ __slots__ = ['data'] def __init__(self, rdclass, rdtype, data): super(GenericRdata, self).__init__(rdclass, rdtype) self.data = data def to_text(self, origin=None, relativize=True, **kw): return r'\# %d ' % len(self.data) + _hexify(self.data) def from_text(cls, rdclass, rdtype, tok, origin = None, relativize = True): token = tok.get() if not token.is_identifier() or token.value != '\#': raise dns.exception.SyntaxError(r'generic rdata does not start with \#') length = tok.get_int() chunks = [] while 1: token = tok.get() if token.is_eol_or_eof(): break chunks.append(token.value) hex = ''.join(chunks) data = hex.decode('hex_codec') if len(data) != length: raise dns.exception.SyntaxError('generic rdata hex data has wrong length') return cls(rdclass, rdtype, data) from_text = classmethod(from_text) def to_wire(self, file, compress = None, origin = None): file.write(self.data) def from_wire(cls, rdclass, rdtype, wire, current, rdlen, origin = None): return cls(rdclass, rdtype, wire[current : current + rdlen]) from_wire = classmethod(from_wire) def _cmp(self, other): return cmp(self.data, other.data) _rdata_modules = {} _module_prefix = 'dns.rdtypes' def get_rdata_class(rdclass, rdtype): def import_module(name): mod = __import__(name) components = name.split('.') for comp in components[1:]: mod = getattr(mod, comp) return mod mod = _rdata_modules.get((rdclass, rdtype)) rdclass_text = dns.rdataclass.to_text(rdclass) rdtype_text = dns.rdatatype.to_text(rdtype) rdtype_text = rdtype_text.replace('-', '_') if not mod: mod = _rdata_modules.get((dns.rdatatype.ANY, rdtype)) if not mod: try: mod = import_module('.'.join([_module_prefix, rdclass_text, rdtype_text])) _rdata_modules[(rdclass, rdtype)] = mod except ImportError: try: mod = import_module('.'.join([_module_prefix, 'ANY', rdtype_text])) _rdata_modules[(dns.rdataclass.ANY, rdtype)] = mod except ImportError: mod = None if mod: cls = getattr(mod, rdtype_text) else: cls = GenericRdata return cls def from_text(rdclass, rdtype, tok, origin = None, relativize = True): """Build an rdata object from text format. This function attempts to dynamically load a class which implements the specified rdata class and type. If there is no class-and-type-specific implementation, the GenericRdata class is used. Once a class is chosen, its from_text() class method is called with the parameters to this function. If I{tok} is a string, then a tokenizer is created and the string is used as its input. @param rdclass: The rdata class @type rdclass: int @param rdtype: The rdata type @type rdtype: int @param tok: The tokenizer or input text @type tok: dns.tokenizer.Tokenizer or string @param origin: The origin to use for relative names @type origin: dns.name.Name @param relativize: Should names be relativized? @type relativize: bool @rtype: dns.rdata.Rdata instance""" if isinstance(tok, str): tok = dns.tokenizer.Tokenizer(tok) cls = get_rdata_class(rdclass, rdtype) if cls != GenericRdata: # peek at first token token = tok.get() tok.unget(token) if token.is_identifier() and \ token.value == r'\#': # # Known type using the generic syntax. Extract the # wire form from the generic syntax, and then run # from_wire on it. # rdata = GenericRdata.from_text(rdclass, rdtype, tok, origin, relativize) return from_wire(rdclass, rdtype, rdata.data, 0, len(rdata.data), origin) return cls.from_text(rdclass, rdtype, tok, origin, relativize) def from_wire(rdclass, rdtype, wire, current, rdlen, origin = None): """Build an rdata object from wire format This function attempts to dynamically load a class which implements the specified rdata class and type. If there is no class-and-type-specific implementation, the GenericRdata class is used. Once a class is chosen, its from_wire() class method is called with the parameters to this function. @param rdclass: The rdata class @type rdclass: int @param rdtype: The rdata type @type rdtype: int @param wire: The wire-format message @type wire: string @param current: The offet in wire of the beginning of the rdata. @type current: int @param rdlen: The length of the wire-format rdata @type rdlen: int @param origin: The origin to use for relative names @type origin: dns.name.Name @rtype: dns.rdata.Rdata instance""" wire = dns.wiredata.maybe_wrap(wire) cls = get_rdata_class(rdclass, rdtype) return cls.from_wire(rdclass, rdtype, wire, current, rdlen, origin)
Close