ruby nikto 2.1.5 for Mac OS X via Homebrew

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ruby nikto 2.1.5 for Mac OS X via Homebrew相关的知识,希望对你有一定的参考价值。

require 'formula'

class Nikto < Formula
  homepage 'http://cirt.net/nikto2'
  url 'https://github.com/sullo/nikto.git', :revision => '8bb017d76e592793da3c06cdbb8d31bfdffdf2eb'
  version '2.1.5'
  # version 2.1.6 is still under developing

  def install
    # adjust default paths in perl script
    inreplace 'program/nikto.pl' do |s|
      s.gsub! '/etc/nikto.conf', "#{etc}/nikto.conf"
      s.gsub! "2.1.6", "2.1.5"
    end
    
    # adjust default paths in configuration file
    inreplace 'program/nikto.conf' do |s|
#      s.gsub! '# EXECDIR=/usr/local/nikto', "EXECDIR=#{prefix}"
      s.gsub! '# EXECDIR=/opt/nikto', "EXECDIR=#{prefix}"
      s.gsub! '# PLUGINDIR=/opt/nikto/plugins', "# PLUGINDIR=#{prefix}/plugins"
      s.gsub! '# TEMPLATEDIR=/opt/nikto/templates', "# TEMPLATEDIR=#{prefix}/templates"
      s.gsub! '# DOCDIR=/opt/nikto/docs', "# DOCDIR=#{prefix}/docs"
    end
    
    bin.install 'program/nikto.pl'                              # install main perl script
    bin.install_symlink bin + 'nikto.pl' => 'nikto'     # symlink w/o extension
    etc.install 'program/nikto.conf'                            # install conf file
    man1.install 'documentation/nikto.1'                         # install man page
    (prefix + 'docs').install Dir['documentation/*']             # miscellaneous
    prefix.install 'program/databases', 'program/plugins', 'program/templates'               # install databases, plugins, templates
    
    # update LibWhisker
    ohai 'Updating LibWhisker', `#{bin}/nikto -update`
  end
  
  def caveats;  <<-EOS.undent
    File locations:
    Perl script:    #{HOMEBREW_PREFIX}/bin/nikto
    Configuration:  #{etc}/nikto.conf
    Docs:           #{prefix}/docs
    Plugins:        #{prefix}/plugins
    Templates:      #{prefix}/templates
    
    Type `man nikto` or `nikto -H` for help and usage information.
    EOS
  end

  # run the test with `brew test nikto`
  def test
    system "test -h #{bin}/nikto"           # symlink?
    system "test -x #{bin}/nikto.pl"        # execute permission?
    system "test -f #{etc}/nikto.conf"      # file?
    system "test -f #{man1}/nikto.1"        # file?
    system "test -d #{prefix}/docs"         # directory?
    system "test -d #{prefix}/plugins"      # directory?
    system "test -d #{prefix}/templates"    # directory?
  end
end

以上是关于ruby nikto 2.1.5 for Mac OS X via Homebrew的主要内容,如果未能解决你的问题,请参考以下文章

强大的Rails/Ruby开发工具—RubyMine 2021 for Mac更新至v2021.3.3

MAC上尝试用RVM升级Ruby更新Ruby失败解决办法: No binary rubies available for: osx/11.1/x86_64/ruby-2.7.2.

mac下都有哪些web网站漏洞扫描的工具?

在 mac 上从 1.1 降级到 OPENSSL 版本 1.0

Nikto介绍及使用方法

Kali [Nikto]Web扫描器