-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: nikto-2.5.0 start failed #793
Comments
I can't replicate this:
Could you post the output of |
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
<#793 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALICRENOQFVNT6VS5CALMTXGQWZTANCNFSM6AAAAAAYDINHDQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
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
<#793 (comment)>, 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. |
Hi, I am trying to install in ventura and without success.
|
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.
|
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. |
I just built a new amazon-linux and...
Can you provide any more info? |
I hope this helps: uname -r
|
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 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. |
same issue [root@localhost program]# perl --version work again after patched, thanks.
|
I believe the error is on the following line:
For Catalina OS, the correct syntax should be:
Reason:
NoteWhy the Original Code Worked with Perl 5.38.2In 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. Why It Failed on macOS Catalina (Perl 5.18.4)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。
The text was updated successfully, but these errors were encountered: