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

Software: Apache. PHP/7.3.33 

uname -a: Linux acloudg.aryanict.com 4.18.0-513.9.1.lve.el8.x86_64 #1 SMP Mon Dec 4 15:01:22 UTC
2023 x86_64
 

uid=1095(katebhospital) gid=1098(katebhospital) groups=1098(katebhospital) 

Safe-mode: OFF (not secure)

/usr/lib/dracut/modules.d/91crypt-gpg/   drwxr-xr-x
Free 293.25 GB of 429.69 GB (68.25%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     crypt-gpg-lib.sh (2.56 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/bin/sh

command -v ask_for_password >/dev/null || . /lib/dracut-crypt-lib.sh

# gpg_decrypt mnt_point keypath keydev device
#
# Decrypts symmetrically encrypted (password or OpenPGP smartcard) key to standard output.
#
# mnt_point - mount point where <keydev> is already mounted
# keypath - GPG encrypted key path relative to <mnt_point>
# keydev - device on which key resides; only to display in prompt
# device - device to be opened by cryptsetup; only to display in prompt
gpg_decrypt() {
    local mntp="$1"
    local keypath="$2"
    local keydev="$3"
    local device="$4"

    local gpghome=/tmp/gnupg
    local opts="--homedir $gpghome --no-mdc-warning --skip-verify --quiet"
    opts="$opts --logger-file /dev/null --batch --no-tty --passphrase-fd 0"

    mkdir -m 0700 -p "$gpghome"

    # Setup GnuPG home and gpg-agent for usage of OpenPGP smartcard.
    # This requires GnuPG >= 2.1, as it uses the new ,,pinentry-mode´´
    # feature, which - when set to ,,loopback´´ - allows us to pipe
    # the smartcard's pin to GnuPG (instead of using a normal pinentry
    # program needed with GnuPG < 2.1), making for uncomplicated
    # integration with the existing codebase.
    local useSmartcard="0"
    local gpgMajorVersion="$(gpg --version | sed -n 1p | sed -n -r -e 's|.* ([0-9]*).*|\1|p')"
    local gpgMinorVersion="$(gpg --version | sed -n 1p | sed -n -r -e 's|.* [0-9]*\.([0-9]*).*|\1|p')"

    if [ "${gpgMajorVersion}" -ge 2 ] && [ "${gpgMinorVersion}" -ge 1 ] \
            && [ -f /root/crypt-public-key.gpg ] && getargbool 1 rd.luks.smartcard ; then
        useSmartcard="1"
        echo "allow-loopback-pinentry" >> "$gpghome/gpg-agent.conf"
        GNUPGHOME="$gpghome" gpg-agent --quiet --daemon
        GNUPGHOME="$gpghome" gpg --quiet --no-tty --import < /root/crypt-public-key.gpg
        local smartcardSerialNumber="$(GNUPGHOME=$gpghome gpg --no-tty --card-status \
            | sed -n -r -e 's|Serial number.*: ([0-9]*)|\1|p' | tr -d '\n')"
        if [ -n "${smartcardSerialNumber}" ]; then
            inputPrompt="PIN (OpenPGP card ${smartcardSerialNumber})"
        fi
        GNUPGHOME="$gpghome" gpg-connect-agent 1>/dev/null learn /bye
        opts="$opts --pinentry-mode=loopback"
    fi

    ask_for_password \
        --cmd "gpg $opts --decrypt $mntp/$keypath" \
        --prompt "${inputPrompt:-Password ($keypath on $keydev for $device)}" \
        --tries 3 --tty-echo-off

    # Clean up the smartcard gpg-agent
    if [ "${useSmartcard}" == "1" ]; then
        GNUPGHOME="$gpghome" gpg-connect-agent 1>/dev/null killagent /bye
    fi

    rm -rf -- "$gpghome"
}

:: 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 KaizenLouie | C99Shell Github | Generation time: 0.0037 ]--