����JFIF��������� Mr.X
  
  __  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

deexcl@216.73.217.71: ~ $
# -*- coding: utf-8 -*-

# (c) 2015, Matt Martz <matt@sivel.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

from __future__ import absolute_import, division, print_function
__metaclass__ = type


DOCUMENTATION = r'''
---
module: expect
version_added: '2.0'
short_description: Executes a command and responds to prompts
description:
     - The C(expect) module executes a command and responds to prompts.
     - The given command will be executed on all selected nodes. It will not be
       processed through the shell, so variables like C($HOME) and operations
       like C("<"), C(">"), C("|"), and C("&") will not work.
options:
  command:
    description:
      - The command module takes command to run.
    required: true
    type: str
  creates:
    type: path
    description:
      - A filename, when it already exists, this step will B(not) be run.
  removes:
    type: path
    description:
      - A filename, when it does not exist, this step will B(not) be run.
  chdir:
    type: path
    description:
      - Change into this directory before running the command.
  responses:
    type: dict
    description:
      - Mapping of expected string/regex and string to respond with. If the
        response is a list, successive matches return successive
        responses. List functionality is new in 2.1.
    required: true
  timeout:
    type: int
    description:
      - Amount of time in seconds to wait for the expected strings. Use
        C(null) to disable timeout.
    default: 30
  echo:
    description:
      - Whether or not to echo out your response strings.
    default: false
    type: bool
requirements:
  - python >= 2.6
  - pexpect >= 3.3
extends_documentation_fragment: action_common_attributes
attributes:
    check_mode:
        support: none
    diff_mode:
        support: none
    platform:
        support: full
        platforms: posix
notes:
  - If you want to run a command through the shell (say you are using C(<),
    C(>), C(|), and so on), you must specify a shell in the command such as
    C(/bin/bash -c "/path/to/something | grep else").
  - The question, or key, under I(responses) is a python regex match. Case
    insensitive searches are indicated with a prefix of C(?i).
  - The C(pexpect) library used by this module operates with a search window
    of 2000 bytes, and does not use a multiline regex match. To perform a
    start of line bound match, use a pattern like ``(?m)^pattern``
  - By default, if a question is encountered multiple times, its string
    response will be repeated. If you need different responses for successive
    question matches, instead of a string response, use a list of strings as
    the response. The list functionality is new in 2.1.
  - The M(ansible.builtin.expect) module is designed for simple scenarios.
    For more complex needs, consider the use of expect code with the M(ansible.builtin.shell)
    or M(ansible.builtin.script) modules. (An example is part of the M(ansible.builtin.shell) module documentation).
seealso:
- module: ansible.builtin.script
- module: ansible.builtin.shell
author: "Matt Martz (@sivel)"
'''

EXAMPLES = r'''
- name: Case insensitive password string match
  ansible.builtin.expect:
    command: passwd username
    responses:
      (?i)password: "MySekretPa$$word"
  # you don't want to show passwords in your logs
  no_log: true

- name: Generic question with multiple different responses
  ansible.builtin.expect:
    command: /path/to/custom/command
    responses:
      Question:
        - response1
        - response2
        - response3
'''

import datetime
import os
import traceback

PEXPECT_IMP_ERR = None
try:
    import pexpect
    HAS_PEXPECT = True
except ImportError:
    PEXPECT_IMP_ERR = traceback.format_exc()
    HAS_PEXPECT = False

from ansible.module_utils.basic import AnsibleModule, missing_required_lib
from ansible.module_utils._text import to_bytes, to_native, to_text


def response_closure(module, question, responses):
    resp_gen = (b'%s\n' % to_bytes(r).rstrip(b'\n') for r in responses)

    def wrapped(info):
        try:
            return next(resp_gen)
        except StopIteration:
            module.fail_json(msg="No remaining responses for '%s', "
                                 "output was '%s'" %
                                 (question,
                                  info['child_result_list'][-1]))

    return wrapped


def main():
    module = AnsibleModule(
        argument_spec=dict(
            command=dict(required=True),
            chdir=dict(type='path'),
            creates=dict(type='path'),
            removes=dict(type='path'),
            responses=dict(type='dict', required=True),
            timeout=dict(type='int', default=30),
            echo=dict(type='bool', default=False),
        )
    )

    if not HAS_PEXPECT:
        module.fail_json(msg=missing_required_lib("pexpect"),
                         exception=PEXPECT_IMP_ERR)

    chdir = module.params['chdir']
    args = module.params['command']
    creates = module.params['creates']
    removes = module.params['removes']
    responses = module.params['responses']
    timeout = module.params['timeout']
    echo = module.params['echo']

    events = dict()
    for key, value in responses.items():
        if isinstance(value, list):
            response = response_closure(module, key, value)
        else:
            response = b'%s\n' % to_bytes(value).rstrip(b'\n')

        events[to_bytes(key)] = response

    if args.strip() == '':
        module.fail_json(rc=256, msg="no command given")

    if chdir:
        chdir = os.path.abspath(chdir)
        os.chdir(chdir)

    if creates:
        # do not run the command if the line contains creates=filename
        # and the filename already exists.  This allows idempotence
        # of command executions.
        if os.path.exists(creates):
            module.exit_json(
                cmd=args,
                stdout="skipped, since %s exists" % creates,
                changed=False,
                rc=0
            )

    if removes:
        # do not run the command if the line contains removes=filename
        # and the filename does not exist.  This allows idempotence
        # of command executions.
        if not os.path.exists(removes):
            module.exit_json(
                cmd=args,
                stdout="skipped, since %s does not exist" % removes,
                changed=False,
                rc=0
            )

    startd = datetime.datetime.now()

    try:
        try:
            # Prefer pexpect.run from pexpect>=4
            b_out, rc = pexpect.run(args, timeout=timeout, withexitstatus=True,
                                    events=events, cwd=chdir, echo=echo,
                                    encoding=None)
        except TypeError:
            # Use pexpect._run in pexpect>=3.3,<4
            # pexpect.run doesn't support `echo`
            # pexpect.runu doesn't support encoding=None
            b_out, rc = pexpect._run(args, timeout=timeout, withexitstatus=True,
                                     events=events, extra_args=None, logfile=None,
                                     cwd=chdir, env=None, _spawn=pexpect.spawn,
                                     echo=echo)

    except (TypeError, AttributeError) as e:
        # This should catch all insufficient versions of pexpect
        # We deem them insufficient for their lack of ability to specify
        # to not echo responses via the run/runu functions, which would
        # potentially leak sensitive information
        module.fail_json(msg='Insufficient version of pexpect installed '
                             '(%s), this module requires pexpect>=3.3. '
                             'Error was %s' % (pexpect.__version__, to_native(e)))
    except pexpect.ExceptionPexpect as e:
        module.fail_json(msg='%s' % to_native(e), exception=traceback.format_exc())

    endd = datetime.datetime.now()
    delta = endd - startd

    if b_out is None:
        b_out = b''

    result = dict(
        cmd=args,
        stdout=to_native(b_out).rstrip('\r\n'),
        rc=rc,
        start=str(startd),
        end=str(endd),
        delta=str(delta),
        changed=True,
    )

    if rc is None:
        module.fail_json(msg='command exceeded timeout', **result)
    elif rc != 0:
        module.fail_json(msg='non-zero return code', **result)

    module.exit_json(**result)


if __name__ == '__main__':
    main()

Filemanager

Name Type Size Permission Actions
__pycache__ Folder 0755
__init__.py File 0 B 0644
_include.py File 3.06 KB 0644
add_host.py File 3.82 KB 0644
apt.py File 57.4 KB 0644
apt_key.py File 17.45 KB 0644
apt_repository.py File 28.39 KB 0644
assemble.py File 8.76 KB 0644
assert.py File 2.75 KB 0644
async_status.py File 4.29 KB 0644
async_wrapper.py File 11.43 KB 0644
blockinfile.py File 13.29 KB 0644
command.py File 12.64 KB 0644
copy.py File 34.75 KB 0644
cron.py File 25.57 KB 0644
debconf.py File 7.55 KB 0644
debug.py File 2.89 KB 0644
dnf.py File 58.16 KB 0644
dpkg_selections.py File 2.35 KB 0644
expect.py File 8.33 KB 0644
fail.py File 1.67 KB 0644
fetch.py File 4.17 KB 0644
file.py File 39.93 KB 0644
find.py File 18.73 KB 0644
gather_facts.py File 2.5 KB 0644
get_url.py File 26.22 KB 0644
getent.py File 5.56 KB 0644
git.py File 55.22 KB 0644
group.py File 19.57 KB 0644
group_by.py File 2.41 KB 0644
hostname.py File 28.12 KB 0644
import_playbook.py File 2.06 KB 0644
import_role.py File 3.27 KB 0644
import_tasks.py File 2.14 KB 0644
include_role.py File 4.15 KB 0644
include_tasks.py File 2.64 KB 0644
include_vars.py File 6.45 KB 0644
iptables.py File 32.27 KB 0644
known_hosts.py File 13.5 KB 0644
lineinfile.py File 23.39 KB 0644
meta.py File 5.84 KB 0644
package.py File 3.33 KB 0644
package_facts.py File 17.71 KB 0644
pause.py File 3.44 KB 0644
ping.py File 2.32 KB 0644
pip.py File 30 KB 0644
raw.py File 3.57 KB 0644
reboot.py File 4.64 KB 0644
replace.py File 11.19 KB 0644
rpm_key.py File 8.48 KB 0644
script.py File 4.03 KB 0644
service.py File 63.85 KB 0644
service_facts.py File 16.73 KB 0644
set_fact.py File 5.62 KB 0644
set_stats.py File 2.6 KB 0644
setup.py File 10.79 KB 0644
shell.py File 6.57 KB 0644
slurp.py File 3.19 KB 0644
stat.py File 19.62 KB 0644
subversion.py File 13.22 KB 0644
systemd.py File 22.82 KB 0644
systemd_service.py File 22.82 KB 0644
sysvinit.py File 13.47 KB 0644
tempfile.py File 3.42 KB 0644
template.py File 3.1 KB 0644
unarchive.py File 42.79 KB 0644
uri.py File 27.78 KB 0644
user.py File 114.18 KB 0644
validate_argument_spec.py File 2.99 KB 0644
wait_for.py File 25.91 KB 0644
wait_for_connection.py File 3.38 KB 0644
yum.py File 72.05 KB 0644
yum_repository.py File 24.82 KB 0644