K2LL33D SHELL

 Apache/2.4.7 (Ubuntu)
 Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64
 uid=33(www-data) gid=33(www-data) groups=33(www-data)
 safemode : OFF
 MySQL: ON | Perl: ON | cURL: OFF | WGet: ON
  >  / usr / lib / python2.7 / dist-packages / twisted / tap /
server ip : 172.67.156.115

your ip : 172.69.130.146

H O M E


Filename/usr/lib/python2.7/dist-packages/twisted/tap/manhole.py
Size1.71 kb
Permissionrw-r--r--
Ownerroot : root
Create time27-Apr-2025 09:56
Last modified18-Oct-2011 18:31
Last accessed07-Jul-2025 00:26
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image

# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.


"""
I am the support module for making a manhole server with twistd.
"""

from twisted.manhole import service
from twisted.spread import pb
from twisted.python import usage, util
from twisted.cred import portal, checkers
from twisted.application import strports
import os, sys

class Options(usage.Options):
synopsis = "[options]"
optParameters = [
["user", "u", "admin", "Name of user to allow to log in"],
["port", "p", str(pb.portno), "Port to listen on"],
]

optFlags = [
["tracebacks", "T", "Allow tracebacks to be sent over the network"],
]

compData = usage.Completions(
optActions={"user": usage.CompleteUsernames()}
)

def opt_password(self, password):
"""Required. '-' will prompt or read a password from stdin.
"""
# If standard input is a terminal, I prompt for a password and
# confirm it. Otherwise, I use the first line from standard
# input, stripping off a trailing newline if there is one.
if password in ('', '-'):
self['password'] = util.getPassword(confirm=1)
else:
self['password'] = password
opt_w = opt_password

def postOptions(self):
if not self.has_key('password'):
self.opt_password('-')

def makeService(config):
port, user, password = config['port'], config['user'], config['password']
p = portal.Portal(
service.Realm(service.Service(config["tracebacks"], config.get('namespace'))),
[checkers.InMemoryUsernamePasswordDatabaseDontUse(**{user: password})]
)
return strports.service(port, pb.PBServerFactory(p, config["tracebacks"]))