Linux biogene 3.16.0-11-amd64 #1 SMP Debian 3.16.84-1 (2020-06-09) x86_64
Apache
: 46.101.124.208 | : 18.119.119.187
Cant Read [ /etc/named.conf ]
5.6.40-0+deb8u12
www-data
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
CREATE WP USER
README
+ Create Folder
+ Create File
/
usr /
lib /
python2.7 /
dist-packages /
[ HOME SHELL ]
Name
Size
Permission
Action
Cheetah
[ DIR ]
drwxr-xr-x
Cheetah-2.4.4.egg-info
[ DIR ]
drwxr-xr-x
Crypto
[ DIR ]
drwxr-xr-x
Jinja2-2.7.3.egg-info
[ DIR ]
drwxr-xr-x
MarkupSafe-0.23.egg-info
[ DIR ]
drwxr-xr-x
MySQL_python-1.2.3.egg-info
[ DIR ]
drwxr-xr-x
MySQLdb
[ DIR ]
drwxr-xr-x
OpenSSL
[ DIR ]
drwxr-xr-x
PIL
[ DIR ]
drwxr-xr-x
Pillow-2.6.1.egg-info
[ DIR ]
drwxr-xr-x
Pygments-2.0.1.egg-info
[ DIR ]
drwxr-xr-x
SOAPpy
[ DIR ]
drwxr-xr-x
SOAPpy-0.12.22.egg-info
[ DIR ]
drwxr-xr-x
SQLAlchemy-0.9.8.egg-info
[ DIR ]
drwxr-xr-x
_markerlib
[ DIR ]
drwxr-xr-x
apt
[ DIR ]
drwxr-xr-x
aptsources
[ DIR ]
drwxr-xr-x
bcrypt
[ DIR ]
drwxr-xr-x
boto
[ DIR ]
drwxr-xr-x
boto-2.34.0.egg-info
[ DIR ]
drwxr-xr-x
cffi
[ DIR ]
drwxr-xr-x
cffi-0.8.6.egg-info
[ DIR ]
drwxr-xr-x
chardet
[ DIR ]
drwxr-xr-x
chardet-2.3.0.egg-info
[ DIR ]
drwxr-xr-x
cloud_init-0.7.6.egg-info
[ DIR ]
drwxr-xr-x
cloudinit
[ DIR ]
drwxr-xr-x
colorama
[ DIR ]
drwxr-xr-x
colorama-0.3.2.egg-info
[ DIR ]
drwxr-xr-x
configobj-5.0.6.egg-info
[ DIR ]
drwxr-xr-x
cryptography
[ DIR ]
drwxr-xr-x
cryptography-0.6.1.egg-info
[ DIR ]
drwxr-xr-x
cryptography.egg-info
[ DIR ]
drwxr-xr-x
debian
[ DIR ]
drwxr-xr-x
debian_bundle
[ DIR ]
drwxr-xr-x
defusedxml
[ DIR ]
drwxr-xr-x
distlib
[ DIR ]
drwxr-xr-x
distro_info-0.14.egg-info
[ DIR ]
drwxr-xr-x
distro_info_test
[ DIR ]
drwxr-xr-x
docutils
[ DIR ]
drwxr-xr-x
ecdsa
[ DIR ]
drwxr-xr-x
euca2ools
[ DIR ]
drwxr-xr-x
euca2ools-3.1.0.egg-info
[ DIR ]
drwxr-xr-x
flup
[ DIR ]
drwxr-xr-x
flup-1.0.2.egg-info
[ DIR ]
drwxr-xr-x
html5lib
[ DIR ]
drwxr-xr-x
html5lib-0.999.egg-info
[ DIR ]
drwxr-xr-x
jinja2
[ DIR ]
drwxr-xr-x
jsonpatch-1.3.egg-info
[ DIR ]
drwxr-xr-x
ldap
[ DIR ]
drwxr-xr-x
lxml
[ DIR ]
drwxr-xr-x
lxml-3.4.0.egg-info
[ DIR ]
drwxr-xr-x
markupsafe
[ DIR ]
drwxr-xr-x
netifaces-0.10.4.egg-info
[ DIR ]
drwxr-xr-x
oauth
[ DIR ]
drwxr-xr-x
oauth-1.0.1.egg-info
[ DIR ]
drwxr-xr-x
paramiko
[ DIR ]
drwxr-xr-x
paramiko-1.15.1.egg-info
[ DIR ]
drwxr-xr-x
pip
[ DIR ]
drwxr-xr-x
pip-1.5.6.egg-info
[ DIR ]
drwxr-xr-x
ply
[ DIR ]
drwxr-xr-x
ply-3.4.egg-info
[ DIR ]
drwxr-xr-x
prettytable-0.7.2.egg-info
[ DIR ]
drwxr-xr-x
pyOpenSSL-0.14.egg-info
[ DIR ]
drwxr-xr-x
py_bcrypt-0.4.egg-info
[ DIR ]
drwxr-xr-x
pyasn1
[ DIR ]
drwxr-xr-x
pyasn1-0.1.7.egg-info
[ DIR ]
drwxr-xr-x
pycparser
[ DIR ]
drwxr-xr-x
pygments
[ DIR ]
drwxr-xr-x
python_debian-0.1.27.egg-info
[ DIR ]
drwxr-xr-x
reportbug
[ DIR ]
drwxr-xr-x
reportbug-6.6.3.egg-info
[ DIR ]
drwxr-xr-x
requestbuilder
[ DIR ]
drwxr-xr-x
requestbuilder-0.2.3.egg-info
[ DIR ]
drwxr-xr-x
requests
[ DIR ]
drwxr-xr-x
requests-2.4.3.egg-info
[ DIR ]
drwxr-xr-x
serial
[ DIR ]
drwxr-xr-x
setuptools
[ DIR ]
drwxr-xr-x
setuptools-5.5.1.egg-info
[ DIR ]
drwxr-xr-x
six-1.8.0.egg-info
[ DIR ]
drwxr-xr-x
softwareproperties
[ DIR ]
drwxr-xr-x
sqlalchemy
[ DIR ]
drwxr-xr-x
urllib3
[ DIR ]
drwxr-xr-x
urllib3-1.9.1.egg-info
[ DIR ]
drwxr-xr-x
virtualenv-1.11.6.egg-info
[ DIR ]
drwxr-xr-x
web
[ DIR ]
drwxr-xr-x
wheel
[ DIR ]
drwxr-xr-x
wheel-0.24.0.egg-info
[ DIR ]
drwxr-xr-x
wstools
[ DIR ]
drwxr-xr-x
wstools-0.4.3.egg-info
[ DIR ]
drwxr-xr-x
yaml
[ DIR ]
drwxr-xr-x
BeautifulSoup-3.2.1.egg-info
970
B
-rw-r--r--
BeautifulSoup.py
77.7
KB
-rw-r--r--
BeautifulSoup.pyc
67.55
KB
-rw-r--r--
BeautifulSoupTests.py
36.71
KB
-rw-r--r--
BeautifulSoupTests.pyc
40.56
KB
-rw-r--r--
PyYAML-3.11.egg-info
1.63
KB
-rw-r--r--
README
119
B
-rw-r--r--
_cffi_backend.x86_64-linux-gnu...
81.05
KB
-rw-r--r--
_ldap.so
68.38
KB
-rw-r--r--
_mysql.so
58.54
KB
-rw-r--r--
_mysql_exceptions.py
2.25
KB
-rw-r--r--
_mysql_exceptions.pyc
4.09
KB
-rw-r--r--
_version.py
21
B
-rw-r--r--
_version.pyc
163
B
-rw-r--r--
_yaml.so
198.47
KB
-rw-r--r--
apt_inst.so
50.82
KB
-rw-r--r--
apt_pkg.so
339.07
KB
-rw-r--r--
configobj.py
87.51
KB
-rw-r--r--
configobj.pyc
65.45
KB
-rw-r--r--
deb822.py
146
B
-rw-r--r--
deb822.pyc
317
B
-rw-r--r--
debconf.py
5.83
KB
-rw-r--r--
debconf.pyc
5.87
KB
-rw-r--r--
defusedxml-0.4.1.egg-info
35.09
KB
-rw-r--r--
distro_info.py
9.26
KB
-rw-r--r--
distro_info.pyc
10.18
KB
-rw-r--r--
docutils-0.12.egg-info
2.31
KB
-rw-r--r--
dsml.py
8.06
KB
-rw-r--r--
dsml.pyc
9.27
KB
-rw-r--r--
easy_install.py
126
B
-rw-r--r--
easy_install.pyc
315
B
-rw-r--r--
ecdsa-0.11.egg-info
610
B
-rw-r--r--
jsonpatch.py
15.57
KB
-rw-r--r--
jsonpatch.pyc
16.98
KB
-rw-r--r--
jsonpointer-1.0.egg-info
302
B
-rw-r--r--
jsonpointer.py
6.46
KB
-rw-r--r--
jsonpointer.pyc
6.15
KB
-rw-r--r--
ldapurl.py
11.48
KB
-rw-r--r--
ldapurl.pyc
13.15
KB
-rw-r--r--
ldif.py
13.41
KB
-rw-r--r--
ldif.pyc
13.73
KB
-rw-r--r--
lsb_release.py
13.41
KB
-rw-r--r--
lsb_release.pyc
10.11
KB
-rw-r--r--
netifaces.so
18.47
KB
-rw-r--r--
pkg_resources.py
98.96
KB
-rw-r--r--
pkg_resources.pyc
105.69
KB
-rw-r--r--
prettytable.py
52.93
KB
-rw-r--r--
prettytable.pyc
50.38
KB
-rw-r--r--
pycparser-2.10.egg-info
602
B
-rw-r--r--
pycrypto-2.6.1.egg-info
666
B
-rw-r--r--
pyinotify-0.9.4.egg-info
1.15
KB
-rw-r--r--
pyinotify.py
85.61
KB
-rw-r--r--
pyinotify.pyc
83.4
KB
-rw-r--r--
pyserial-2.6.egg-info
1.37
KB
-rw-r--r--
python-support.pth
29
B
-rw-r--r--
python_apt-0.9.3.13.egg-info
229
B
-rw-r--r--
python_ldap-2.4.10.egg-info
1.41
KB
-rw-r--r--
roman-2.0.0.egg-info
1.28
KB
-rw-r--r--
roman.py
2.63
KB
-rw-r--r--
roman.pyc
3.45
KB
-rw-r--r--
setuptools.pth
26
B
-rw-r--r--
six.py
26.7
KB
-rw-r--r--
six.pyc
26.69
KB
-rw-r--r--
validate.py
46.13
KB
-rw-r--r--
validate.pyc
46.44
KB
-rw-r--r--
virtualenv.py
97.99
KB
-rw-r--r--
virtualenv.pyc
81.43
KB
-rw-r--r--
web.py-0.37.egg-info
301
B
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : ldif.py
""" ldif - generate and parse LDIF data (see RFC 2849) See http://www.python-ldap.org/ for details. $Id: ldif.py,v 1.67 2012/06/07 18:40:59 stroeder Exp $ Python compability note: Tested with Python 2.0+, but should work with Python 1.5.2+. """ __version__ = '2.4.10' __all__ = [ # constants 'ldif_pattern', # functions 'AttrTypeandValueLDIF','CreateLDIF','ParseLDIF', # classes 'LDIFWriter', 'LDIFParser', 'LDIFRecordList', 'LDIFCopy', ] import urlparse,urllib,base64,re,types try: from cStringIO import StringIO except ImportError: from StringIO import StringIO attrtype_pattern = r'[\w;.-]+(;[\w_-]+)*' attrvalue_pattern = r'(([^,]|\\,)+|".*?")' attrtypeandvalue_pattern = attrtype_pattern + r'[ ]*=[ ]*' + attrvalue_pattern rdn_pattern = attrtypeandvalue_pattern + r'([ ]*\+[ ]*' + attrtypeandvalue_pattern + r')*[ ]*' dn_pattern = rdn_pattern + r'([ ]*,[ ]*' + rdn_pattern + r')*[ ]*' dn_regex = re.compile('^%s$' % dn_pattern) ldif_pattern = '^((dn(:|::) %(dn_pattern)s)|(%(attrtype_pattern)s(:|::) .*)$)+' % vars() MOD_OP_INTEGER = { 'add':0,'delete':1,'replace':2 } MOD_OP_STR = { 0:'add',1:'delete',2:'replace' } CHANGE_TYPES = ['add','delete','modify','modrdn'] valid_changetype_dict = {} for c in CHANGE_TYPES: valid_changetype_dict[c]=None def is_dn(s): """ returns 1 if s is a LDAP DN """ if s=='': return 1 rm = dn_regex.match(s) return rm!=None and rm.group(0)==s SAFE_STRING_PATTERN = '(^(\000|\n|\r| |:|<)|[\000\n\r\200-\377]+|[ ]+$)' safe_string_re = re.compile(SAFE_STRING_PATTERN) def list_dict(l): """ return a dictionary with all items of l being the keys of the dictionary """ return dict([(i,None) for i in l]) class LDIFWriter: """ Write LDIF entry or change records to file object Copy LDIF input to a file output object containing all data retrieved via URLs """ def __init__(self,output_file,base64_attrs=None,cols=76,line_sep='\n'): """ output_file file object for output base64_attrs list of attribute types to be base64-encoded in any case cols Specifies how many columns a line may have before it's folded into many lines. line_sep String used as line separator """ self._output_file = output_file self._base64_attrs = list_dict([a.lower() for a in (base64_attrs or [])]) self._cols = cols self._line_sep = line_sep self.records_written = 0 def _unfoldLDIFLine(self,line): """ Write string line as one or more folded lines """ # Check maximum line length line_len = len(line) if line_len<=self._cols: self._output_file.write(line) self._output_file.write(self._line_sep) else: # Fold line pos = self._cols self._output_file.write(line[0:min(line_len,self._cols)]) self._output_file.write(self._line_sep) while pos<line_len: self._output_file.write(' ') self._output_file.write(line[pos:min(line_len,pos+self._cols-1)]) self._output_file.write(self._line_sep) pos = pos+self._cols-1 return # _unfoldLDIFLine() def _needs_base64_encoding(self,attr_type,attr_value): """ returns 1 if attr_value has to be base-64 encoded because of special chars or because attr_type is in self._base64_attrs """ return self._base64_attrs.has_key(attr_type.lower()) or \ not safe_string_re.search(attr_value) is None def _unparseAttrTypeandValue(self,attr_type,attr_value): """ Write a single attribute type/value pair attr_type attribute type attr_value attribute value """ if self._needs_base64_encoding(attr_type,attr_value): # Encode with base64 self._unfoldLDIFLine(':: '.join([attr_type,base64.encodestring(attr_value).replace('\n','')])) else: self._unfoldLDIFLine(': '.join([attr_type,attr_value])) return # _unparseAttrTypeandValue() def _unparseEntryRecord(self,entry): """ entry dictionary holding an entry """ attr_types = entry.keys()[:] attr_types.sort() for attr_type in attr_types: for attr_value in entry[attr_type]: self._unparseAttrTypeandValue(attr_type,attr_value) def _unparseChangeRecord(self,modlist): """ modlist list of additions (2-tuple) or modifications (3-tuple) """ mod_len = len(modlist[0]) if mod_len==2: changetype = 'add' elif mod_len==3: changetype = 'modify' else: raise ValueError,"modlist item of wrong length" self._unparseAttrTypeandValue('changetype',changetype) for mod in modlist: if mod_len==2: mod_type,mod_vals = mod elif mod_len==3: mod_op,mod_type,mod_vals = mod self._unparseAttrTypeandValue(MOD_OP_STR[mod_op],mod_type) else: raise ValueError,"Subsequent modlist item of wrong length" if mod_vals: for mod_val in mod_vals: self._unparseAttrTypeandValue(mod_type,mod_val) if mod_len==3: self._output_file.write('-'+self._line_sep) def unparse(self,dn,record): """ dn string-representation of distinguished name record Either a dictionary holding the LDAP entry {attrtype:record} or a list with a modify list like for LDAPObject.modify(). """ if not record: # Simply ignore empty records return # Start with line containing the distinguished name self._unparseAttrTypeandValue('dn',dn) # Dispatch to record type specific writers if isinstance(record,types.DictType): self._unparseEntryRecord(record) elif isinstance(record,types.ListType): self._unparseChangeRecord(record) else: raise ValueError, "Argument record must be dictionary or list" # Write empty line separating the records self._output_file.write(self._line_sep) # Count records written self.records_written = self.records_written+1 return # unparse() def CreateLDIF(dn,record,base64_attrs=None,cols=76): """ Create LDIF single formatted record including trailing empty line. This is a compability function. Use is deprecated! dn string-representation of distinguished name record Either a dictionary holding the LDAP entry {attrtype:record} or a list with a modify list like for LDAPObject.modify(). base64_attrs list of attribute types to be base64-encoded in any case cols Specifies how many columns a line may have before it's folded into many lines. """ f = StringIO() ldif_writer = LDIFWriter(f,base64_attrs,cols,'\n') ldif_writer.unparse(dn,record) s = f.getvalue() f.close() return s class LDIFParser: """ Base class for a LDIF parser. Applications should sub-class this class and override method handle() to implement something meaningful. Public class attributes: records_read Counter for records processed so far """ def _stripLineSep(self,s): """ Strip trailing line separators from s, but no other whitespaces """ if s[-2:]=='\r\n': return s[:-2] elif s[-1:]=='\n': return s[:-1] else: return s def __init__( self, input_file, ignored_attr_types=None, max_entries=0, process_url_schemes=None, line_sep='\n' ): """ Parameters: input_file File-object to read the LDIF input from ignored_attr_types Attributes with these attribute type names will be ignored. max_entries If non-zero specifies the maximum number of entries to be read from f. process_url_schemes List containing strings with URLs schemes to process with urllib. An empty list turns off all URL processing and the attribute is ignored completely. line_sep String used as line separator """ self._input_file = input_file self._max_entries = max_entries self._process_url_schemes = list_dict([s.lower() for s in (process_url_schemes or [])]) self._ignored_attr_types = list_dict([a.lower() for a in (ignored_attr_types or [])]) self._line_sep = line_sep self.records_read = 0 def handle(self,dn,entry): """ Process a single content LDIF record. This method should be implemented by applications using LDIFParser. """ def _unfoldLDIFLine(self): """ Unfold several folded lines with trailing space into one line """ unfolded_lines = [ self._stripLineSep(self._line) ] self._line = self._input_file.readline() while self._line and self._line[0]==' ': unfolded_lines.append(self._stripLineSep(self._line[1:])) self._line = self._input_file.readline() return ''.join(unfolded_lines) def _parseAttrTypeandValue(self): """ Parse a single attribute type and value pair from one or more lines of LDIF data """ # Reading new attribute line unfolded_line = self._unfoldLDIFLine() # Ignore comments which can also be folded while unfolded_line and unfolded_line[0]=='#': unfolded_line = self._unfoldLDIFLine() if not unfolded_line or unfolded_line=='\n' or unfolded_line=='\r\n': return None,None try: colon_pos = unfolded_line.index(':') except ValueError: # Treat malformed lines without colon as non-existent return None,None attr_type = unfolded_line[0:colon_pos] # if needed attribute value is BASE64 decoded value_spec = unfolded_line[colon_pos:colon_pos+2] if value_spec=='::': # attribute value needs base64-decoding attr_value = base64.decodestring(unfolded_line[colon_pos+2:]) elif value_spec==':<': # fetch attribute value from URL url = unfolded_line[colon_pos+2:].strip() attr_value = None if self._process_url_schemes: u = urlparse.urlparse(url) if self._process_url_schemes.has_key(u[0]): attr_value = urllib.urlopen(url).read() elif value_spec==':\r\n' or value_spec=='\n': attr_value = '' else: attr_value = unfolded_line[colon_pos+2:].lstrip() return attr_type,attr_value def parse(self): """ Continously read and parse LDIF records """ self._line = self._input_file.readline() while self._line and \ (not self._max_entries or self.records_read<self._max_entries): # Reset record version = None; dn = None; changetype = None; modop = None; entry = {} attr_type,attr_value = self._parseAttrTypeandValue() while attr_type!=None and attr_value!=None: if attr_type=='dn': # attr type and value pair was DN of LDIF record if dn!=None: raise ValueError, 'Two lines starting with dn: in one record.' if not is_dn(attr_value): raise ValueError, 'No valid string-representation of distinguished name %s.' % (repr(attr_value)) dn = attr_value elif attr_type=='version' and dn is None: version = 1 elif attr_type=='changetype': # attr type and value pair was DN of LDIF record if dn is None: raise ValueError, 'Read changetype: before getting valid dn: line.' if changetype!=None: raise ValueError, 'Two lines starting with changetype: in one record.' if not valid_changetype_dict.has_key(attr_value): raise ValueError, 'changetype value %s is invalid.' % (repr(attr_value)) changetype = attr_value elif attr_value!=None and \ not self._ignored_attr_types.has_key(attr_type.lower()): # Add the attribute to the entry if not ignored attribute if entry.has_key(attr_type): entry[attr_type].append(attr_value) else: entry[attr_type]=[attr_value] # Read the next line within an entry attr_type,attr_value = self._parseAttrTypeandValue() if entry: # append entry to result list self.handle(dn,entry) self.records_read = self.records_read+1 return # parse() class LDIFRecordList(LDIFParser): """ Collect all records of LDIF input into a single list. of 2-tuples (dn,entry). It can be a memory hog! """ def __init__( self, input_file, ignored_attr_types=None,max_entries=0,process_url_schemes=None ): """ See LDIFParser.__init__() Additional Parameters: all_records List instance for storing parsed records """ LDIFParser.__init__(self,input_file,ignored_attr_types,max_entries,process_url_schemes) self.all_records = [] def handle(self,dn,entry): """ Append single record to dictionary of all records. """ self.all_records.append((dn,entry)) class LDIFCopy(LDIFParser): """ Copy LDIF input to LDIF output containing all data retrieved via URLs """ def __init__( self, input_file,output_file, ignored_attr_types=None,max_entries=0,process_url_schemes=None, base64_attrs=None,cols=76,line_sep='\n' ): """ See LDIFParser.__init__() and LDIFWriter.__init__() """ LDIFParser.__init__(self,input_file,ignored_attr_types,max_entries,process_url_schemes) self._output_ldif = LDIFWriter(output_file,base64_attrs,cols,line_sep) def handle(self,dn,entry): """ Write single LDIF record to output file. """ self._output_ldif.unparse(dn,entry) def ParseLDIF(f,ignore_attrs=None,maxentries=0): """ Parse LDIF records read from file. This is a compability function. Use is deprecated! """ ldif_parser = LDIFRecordList( f,ignored_attr_types=ignore_attrs,max_entries=maxentries,process_url_schemes=0 ) ldif_parser.parse() return ldif_parser.all_records
Close