Open LiShuxue opened 1 year ago
I can't replicate this:
perl -v
This is perl 5, version 30, subversion 3 (v5.30.3) built for darwin-thread-multi-2level
(with 2 registered patches, see perl -V for more detail)
perl nikto.pl -h https://cirt.net/
- Nikto v2.5.0
---------------------------------------------------------------------------
+ Target IP: 159.65.167.152
+ Target Hostname: cirt.net
+ Target Port: 443
...
Could you post the output of perl nikto.pl -V
?
seems still have issue
What Mac OSX are you? I'm Ventura (13.3.1) with no issues, and I only just upgraded a few days ago and had no issues before either.
The only thing I can think right now is somehow LW.pm got changed or corrupted. You could try either downloading Nikto again or replacing the file: https://raw.githubusercontent.com/sullo/nikto/master/program/plugins/LW2.pm
If you are running directly via github please do git status
to see if
there are any code changes compared to the repository.
Thanks
On Tue, May 16, 2023 at 10:04 PM LiShuxue @.***> wrote:
seems still have issue [image: image] https://user-images.githubusercontent.com/20234214/238811536-53cb3bf4-1879-4ffc-8e5f-b0c8de1be6cd.png
— Reply to this email directly, view it on GitHub https://github.com/sullo/nikto/issues/793#issuecomment-1550581855, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALICRENOQFVNT6VS5CALMTXGQWZTANCNFSM6AAAAAAYDINHDQ . You are receiving this because you commented.Message ID: @.***>
--
My OSX is Catalina 10.15.7 . I‘m just following the github readme, checkout and excute the command, didn't change anything.
I am thinking is it possible because the perl version, maybe the version 5.18.4 not support the syntax like "$ref elseif...", so it caused syntax error ?
The "result.html" is generate by 2.1.6 version. it can success.
I never specifically upgrade perl on my Mac--I go with the OS version, so I'm fairly confident I was running 5.18.4 at some point. Also, LW.pm is largely the same between versions 2.1.5 and 2.5.0, with the exception of adding IPv6 support. These portions of code didn't change.
I'm stumped for the moment. I'll try to set up a virtualenv of some sort to run that version of perl and see what happens.
On Wed, May 17, 2023 at 10:39 PM LiShuxue @.***> wrote:
My OSX is Catalina 10.15.7 . I‘m just following the github readme, checkout and excute the command, didn't change anything.
I am thinking is it possible because the perl version, maybe the version 5.18.4 not support the syntax like "$ref elseif...", so it caused syntax error ? [image: image] https://user-images.githubusercontent.com/20234214/239120194-420a37ad-f400-4c6f-a181-8a288046c4ff.png
— Reply to this email directly, view it on GitHub https://github.com/sullo/nikto/issues/793#issuecomment-1552326553, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALICRFKX3I3WNYL5MYAWBDXGWDUVANCNFSM6AAAAAAYDINHDQ . You are receiving this because you commented.Message ID: @.***>
--
Thanks, please let me know the result after you try.
What Mac OSX are you? I'm Ventura (13.3.1) with no issues, and I only just upgraded a few days ago and had no issues before either. The only thing I can think right now is somehow LW.pm got changed or corrupted. You could try either downloading Nikto again or replacing the file: https://raw.githubusercontent.com/sullo/nikto/master/program/plugins/LW2.pm If you are running directly via github please do
git status
to see if there are any code changes compared to the repository. Thanks …
Hi, I am trying to install in ventura and without success.
==> Downloading https://ghcr.io/v2/homebrew/core/nikto/manifests/2.1.6 ######################################################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/nikto/blobs/sha256:a664c33768310d6673ef4a4adc9fa11522abd974f449 Error: nikto: Failed to download resource "nikto" Failure while executing;
/usr/bin/env /usr/local/Homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.0.19\ (Macintosh\;\ Intel\ Mac\ OS\ X\ 13.4)\ curl/7.88.1 --header Accept-Language:\ en --retry 3 --header Authorization:\ Bearer\ QQ== --fail --location --silent --head --request GET https://ghcr.io/v2/homebrew/core/nikto/blobs/sha256:a664c33768310d6673ef4a4adc9fa11522abd974f44928f7635b5663b11f948eexited with 22. Here's the output: curl: (22) The requested URL returned error: 499 HTTP/2 307 content-length: 0 content-type: application/vnd.oci.image.layer.v1.tar+gzip docker-distribution-api-version: registry/2.0 location: https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:a664c33768310d6673ef4a4adc9fa11522abd974f44928f7635b5663b11f948e?se=2023-05-28T20%3A25%3A00Z&sig=0FCf62dYx6LlScqKSMLbQA%2BZAiQUO7mcOsFtApn3mhg%3D&sp=r&spr=https&sr=b&sv=2019-12-12
I need help, how did you manage to install nikto on a mac ventura?
My OSX is Catalina 10.15.7 . I‘m just following the github readme, checkout and excute the command, didn't change anything.
git clone https://github.com/sullo/nikto
cd nikto/program
git checkout nikto-2.5.0
perl nikto.pl -h http://www.example.com
Thanks, I had already done it.
Just wanted to echo that I also had the same issue when running on amazon-linux machine. However, it worked fine on macOS.
Just wanted to echo that I also had the same issue when running on amazon-linux machine. However, it worked fine on macOS.
I just built a new amazon-linux and...
./nikto.pl -h http://cirt.net/
- Nikto v2.5.0
---------------------------------------------------------------------------
+ Target IP: 159.65.167.152
+ Target Hostname: cirt.net
+ Target Port: 80
+ Start Time: 2023-12-05 14:17:07 (GMT0)
...
Can you provide any more info?
I hope this helps:
perl -V Summary of my perl5 (revision 5 version 16 subversion 3) configuration:
did you install required modules, and if so did you use CPAN or yum packages...?
I did have a startup failure too (here on my rusty OS X 10.10.5 (Yosemite) with Perl v5.18.2:
$ /usr/local/silo/nikto/2.5.0/bin/nikto -H
syntax error at /usr/local/silo/nikto/2.5.0/share/nikto/plugins/LW2.pm line 1227, near "$ref{"
syntax error at /usr/local/silo/nikto/2.5.0/share/nikto/plugins/LW2.pm line 1238, near "elsif"
syntax error at /usr/local/silo/nikto/2.5.0/share/nikto/plugins/LW2.pm line 1252, near "}"
Can't use global $1 in "my" at /usr/local/silo/nikto/2.5.0/share/nikto/plugins/LW2.pm line 1276, near "\\$1"
syntax error at /usr/local/silo/nikto/2.5.0/share/nikto/plugins/LW2.pm line 1287, near "}"
syntax error at /usr/local/silo/nikto/2.5.0/share/nikto/plugins/LW2.pm line 1375, near "}"
Can't use global $1 in "my" at /usr/local/silo/nikto/2.5.0/share/nikto/plugins/LW2.pm line 1392, near "ord($1"
syntax error at /usr/local/silo/nikto/2.5.0/share/nikto/plugins/LW2.pm line 1394, near "}"
syntax error at /usr/local/silo/nikto/2.5.0/share/nikto/plugins/LW2.pm line 1421, near "}"
syntax error at /usr/local/silo/nikto/2.5.0/share/nikto/plugins/LW2.pm line 1445, near "}"
/usr/local/silo/nikto/2.5.0/share/nikto/plugins/LW2.pm has too many errors.
Compilation failed in require at /usr/local/silo/nikto/2.5.0/bin/nikto line 55.
It looks like it really doesn't like the my $v = %$ref{$k};
line (#1227 in sub _dump
) for some reason, but I'm not knowledgeable enough about Perl to know if that's purely a compatibility issue (I assume it is).
I patched up the code with some ideas from an older nikto 2.1.5 I still had on disk:
…
foreach my $k (sort keys %$ref) {
my $v = %$ref{$k};
$out .= "\t" x $t;
$out .= _dumpd($k) . ' => ';
…
into:
…
while ( ( $k, $v ) = each (sort keys %$ref) ) {
# next if ( $k eq '' );
$out .= "\t" x $t;
$out .= _dumpd($k) . ' => ';
…
And it seemingly seems to work again. I'm not sure I did it correctly.
$ /usr/local/silo/nikto/latest/bin/nikto -h https://cirt.net/
- Nikto v2.5.0
---------------------------------------------------------------------------
+ Target IP: 159.65.167.152
+ Target Hostname: cirt.net
+ Target Port: 443
---------------------------------------------------------------------------
+ SSL Info: Subject: /CN=cirt.net
Altnames: cirt.net, www.cirt.net
Ciphers: ECDHE-RSA-CHACHA20-POLY1305
Issuer: /C=US/O=Let's Encrypt/CN=R3
+ Start Time: 2024-05-08 12:28:16 (GMT2)
---------------------------------------------------------------------------
+ Server: Apache/2.4.29 (Ubuntu)
…
I assume this is the same issue @LiShuxue encountered. It's just super hard to extract the required information when people forget to post the actual error output they get. 😅 edit OK, my content blocker blocked the image in the first post (Oups!), so this is in fact the very same issue.
syntax error at /home/nikto/program/plugins/LW2.pm line 1227, near "$ref{" syntax error at /home/nikto/program/plugins/LW2.pm line 1238, near "elsif" syntax error at /home/nikto/program/plugins/LW2.pm line 1252, near "}" Can't use global $1 in "my" at /home/nikto/program/plugins/LW2.pm line 1276, near "\\$1" syntax error at /home/nikto/program/plugins/LW2.pm line 1287, near "}" "my" variable $MIME::Base64::VERSION can't be in a package at /home/nikto/program/plugins/LW2.pm line 1321, near "($MIME::Base64::VERSION" syntax error at /home/nikto/program/plugins/LW2.pm line 1375, near "}" Can't use global $1 in "my" at /home/nikto/program/plugins/LW2.pm line 1392, near "ord($1" syntax error at /home/nikto/program/plugins/LW2.pm line 1394, near "}" syntax error at /home/nikto/program/plugins/LW2.pm line 1421, near "}" /home/nikto/program/plugins/LW2.pm has too many errors. Compilation failed in require at /home/nikto/program/nikto.pl line 55.
same issue CentOS Linux release 7.9.2009 (Core) 3.10.0-1160.102.1.el7.x86_64 nikto-2.5.0
[root@localhost program]# perl --version This is perl 5, version 16, subversion 3 (v5.16.3) built for x86_64-linux-thread-multi (with 44 registered patches, see perl -V for more detail)
work again after patched, thanks.
I did have a startup failure too (here on my rusty OS X 10.10.5 (Yosemite) with Perl v5.18.2:
$ /usr/local/silo/nikto/2.5.0/bin/nikto -H syntax error at /usr/local/silo/nikto/2.5.0/share/nikto/plugins/LW2.pm line 1227, near "$ref{" syntax error at /usr/local/silo/nikto/2.5.0/share/nikto/plugins/LW2.pm line 1238, near "elsif" syntax error at /usr/local/silo/nikto/2.5.0/share/nikto/plugins/LW2.pm line 1252, near "}" Can't use global $1 in "my" at /usr/local/silo/nikto/2.5.0/share/nikto/plugins/LW2.pm line 1276, near "\\$1" syntax error at /usr/local/silo/nikto/2.5.0/share/nikto/plugins/LW2.pm line 1287, near "}" syntax error at /usr/local/silo/nikto/2.5.0/share/nikto/plugins/LW2.pm line 1375, near "}" Can't use global $1 in "my" at /usr/local/silo/nikto/2.5.0/share/nikto/plugins/LW2.pm line 1392, near "ord($1" syntax error at /usr/local/silo/nikto/2.5.0/share/nikto/plugins/LW2.pm line 1394, near "}" syntax error at /usr/local/silo/nikto/2.5.0/share/nikto/plugins/LW2.pm line 1421, near "}" syntax error at /usr/local/silo/nikto/2.5.0/share/nikto/plugins/LW2.pm line 1445, near "}" /usr/local/silo/nikto/2.5.0/share/nikto/plugins/LW2.pm has too many errors. Compilation failed in require at /usr/local/silo/nikto/2.5.0/bin/nikto line 55.
It looks like it really doesn't like the
my $v = %$ref{$k};
line (#1227 in sub_dump
) for some reason, but I'm not knowledgeable enough about Perl to know if that's purely a compatibility issue (I assume it is).I patched up the code with some ideas from an older nikto 2.1.5 I still had on disk:
… foreach my $k (sort keys %$ref) { my $v = %$ref{$k}; $out .= "\t" x $t; $out .= _dumpd($k) . ' => '; …
into:
… while ( ( $k, $v ) = each (sort keys %$ref) ) { # next if ( $k eq '' ); $out .= "\t" x $t; $out .= _dumpd($k) . ' => '; …
And it seemingly seems to work again. I'm not sure I did it correctly.
$ /usr/local/silo/nikto/latest/bin/nikto -h https://cirt.net/ - Nikto v2.5.0 --------------------------------------------------------------------------- + Target IP: 159.65.167.152 + Target Hostname: cirt.net + Target Port: 443 --------------------------------------------------------------------------- + SSL Info: Subject: /CN=cirt.net Altnames: cirt.net, www.cirt.net Ciphers: ECDHE-RSA-CHACHA20-POLY1305 Issuer: /C=US/O=Let's Encrypt/CN=R3 + Start Time: 2024-05-08 12:28:16 (GMT2) --------------------------------------------------------------------------- + Server: Apache/2.4.29 (Ubuntu) …
I assume this is the same issue @LiShuxue encountered. It's just super hard to extract the required information when people forget to post the actual error output they get. 😅 edit OK, my content blocker blocked the image in the first post (Oups!), so this is in fact the very same issue.
I believe the error is on the following line:
my $v = %$ref{$k};
For Catalina OS, the correct syntax should be:
my $v = $ref->{$k};
In newer versions of Perl (like 5.38), there are optimizations and relaxed parsing for certain constructs, possibly allowing unconventional syntax like %$ref{$k} to function without throwing errors.
Perl 5.18 enforces stricter interpretation of references and dereferencing. The %$ref{$k} syntax might have been deprecated or is just poorly supported, leading to the "syntax error near $ref{"" you encountered.
I am using v2.5.0 to scan my web site, it can't success. But if i switch to 2.1.6, it can success and generate result.html。