ShellBanner
System:Linux MiraNet 3.0.0-14-generic-pae #23-Ubuntu SMP Mon Nov 21 22:07:10 UTC 2011 i686
Software:Apache. PHP/5.3.6-13ubuntu3.10
ID:uid=65534(nobody) gid=65534(nogroup) groups=65534(nogroup)
Safe Mode:OFF
Open_Basedir:OFF
Freespace:20.72 GB of 70.42 GB (29.42%)
MySQL: ON MSSQL: OFF Oracle: OFF PostgreSQL: OFF Curl: OFF Sockets: ON Fetch: OFF Wget: ON Perl: ON
Disabled Functions: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,

/ usr/ lib/ python2.7/ dist-packages/ smart/ util/ - drwxr-xr-x

Directory:
Viewing file:     metalink.py (5.83 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#
# Copyright (c) 2009 Smart Package Manager Team.
#
# Written by Anders F Bjorklund <afb@users.sourceforge.net>
#
# This file is part of Smart Package Manager.
#
# Smart Package Manager is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published
# by the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# Smart Package Manager is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Smart Package Manager; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
import os
import urllib

try:
    from xml.etree import ElementTree
except ImportError:
    try:
        from elementtree import ElementTree
    except ImportError:
        from smart.util.elementtree import ElementTree

NS_METALINKER = "http://www.metalinker.org/"

def nstag(ns, tag):
    return "{%s}%s" % (ns, tag)

class Metafile:
    def __init__(self, name=None, version=None, summary=None):
        self._file = ElementTree.Element("file")
        if name:
            identityelem = ElementTree.SubElement(self._file, "identity")
            identityelem.text = name
        if version:
            versionelem = ElementTree.SubElement(self._file, "version")
            versionelem.text = version
        if summary:
            descelem = ElementTree.SubElement(self._file, "description")
            descelem.text = summary.encode('utf-8')
        self._resources = ElementTree.SubElement(self._file, "resources")
        self._info = {}
        self._urls = []

    def append(self, urls, **info):
        self._info = info
        if "size" in info and info["size"]:
            sizeelem = ElementTree.SubElement(self._file, "size")
            sizeelem.text = str(info["size"])
        verification = ElementTree.SubElement(self._file, "verification")
        if "md5" in info and info["md5"]:
            hashelem = ElementTree.Element("hash")
            hashelem.attrib["type"] = "md5"
            hashelem.text = info["md5"]
            verification.append(hashelem)
        if "sha" in info and info["sha"]:
            hashelem = ElementTree.Element("hash")
            hashelem.attrib["type"] = "sha1"
            hashelem.text = info["sha"]
            verification.append(hashelem)
        if "sha256" in info and info["sha256"]:
            hashelem = ElementTree.Element("hash")
            hashelem.attrib["type"] = "sha256"
            hashelem.text = info["sha256"]
            verification.append(hashelem)

        self._urls = urls
        for url in urls:
            if url.startswith("/"):
                scheme = "file"
            else:
                scheme = urllib.splittype(url)[0]
            country = None # country code ("US")
            priority = None # priority (100-1)
            filename = os.path.basename(url)

            urlelem = ElementTree.Element("url")
            urlelem.attrib["type"] = scheme
            if country:
                urlelem.attrib["location"] = country
            if priority:
                urlelem.attrib["preference"] = str(priority)
            urlelem.text = url
            self._resources.append(urlelem)
            self._file.attrib["name"] = filename
      
    def element(self):
        return self._file

    def info(self):
        return self._info

    def urls(self):
        return self._urls

class Metalink:
    def __init__(self, generator="smart"):
        self._metalink = ElementTree.Element("metalink")
        self._metalink.attrib["version"] = "3.0"
        self._metalink.attrib["xmlns"] = NS_METALINKER
        self._metalink.attrib["generator"] = generator
        self._files = ElementTree.SubElement(self._metalink, "files")
        self._metafiles = []
    
    def parse(self, input):
        metalink = Metalink()
        for event, elem in ElementTree.iterparse(input, ("start", "end")):
            tag = elem.tag
            if event == "start":
               if tag == nstag(NS_METALINKER, "file"):
                  name = None
                  version = None
                  summary = None
                  info = {}
                  urls = []
            elif event == "end":
               if tag == nstag(NS_METALINKER, "file"):
                  metafile = Metafile(name, version, summary)
                  metafile.append(urls, **info)
                  metalink.append(metafile)
               elif tag == nstag(NS_METALINKER, "identity"):
                  name = elem.text
               elif tag == nstag(NS_METALINKER, "version"):
                  version = elem.text
               elif tag == nstag(NS_METALINKER, "description"):
                  summary = unicode(elem.text)
               elif tag == nstag(NS_METALINKER, "url"):
                  urls.append(elem.text)
               elif tag == nstag(NS_METALINKER, "size"):
                  info["size"] = long(elem.text)
               elif tag == nstag(NS_METALINKER, "hash"):
                  type = elem.get("type")
                  if type == "sha1":
                      type = "sha"
                  info[type] = elem.text
                  
        return metalink
    parse = classmethod(parse)

    def append(self, file):
        self._files.append(file.element())
        self._metafiles.append(file)
    
    def files(self):
        return self._metafiles
    
    def write(self, output):
        if not output.isatty():
           output.write('<?xml version="1.0" encoding="UTF-8"?>\n')
        ElementTree.ElementTree(self._metalink).write(output)

if __name__ == "__main__":
    import sys
    Metalink.parse(open(sys.argv[1])).write(sys.stdout)

Command:
Quick Commands:
Upload:
[Read-Only] Max size: 100MB
PHP Filesystem: <@ Ú
Search File:
regexp
Create File:
Overwrite [Read-Only]
View File:
Mass Defacement:
[+] Main Directory: [+] Defacement Url:
LmfaoX Shell - Private Build [BETA] - v0.1 -; Generated: 0.4343 seconds