a4881da980
Closes #15345. Signed-off-by: ilovezfs <ilovezfs@icloud.com>
57 lines
1.8 KiB
Ruby
57 lines
1.8 KiB
Ruby
class Wpscan < Formula
|
|
desc "Black box WordPress vulnerability scanner"
|
|
homepage "https://wpscan.org"
|
|
head "https://github.com/wpscanteam/wpscan.git"
|
|
|
|
stable do
|
|
url "https://github.com/wpscanteam/wpscan/archive/2.9.2.tar.gz"
|
|
sha256 "01c888bf2310354823a9522cd929e0caad5570c14eef6f47754c90e268fccad8"
|
|
|
|
patch do
|
|
# - Remove xmlrpc/client requirement, already fixed in wpscanteam/wpscan@ec831f7.
|
|
# - Add Gemfile.lock from wpscanteam/wpscan@21f4de2 for reproducibility.
|
|
url "https://gist.githubusercontent.com/anonymous/aa09eed140172009f1eda6268023342c/raw/f69a26776f7768858da08c902ae3d5f75b3e7c36/wpscan-2.9.2-brew.patch"
|
|
sha256 "f8329ba709a0078651532816a8023b285d24652bab299ed7dde8b3e846ca810e"
|
|
end
|
|
end
|
|
|
|
depends_on :ruby => "2.1.9"
|
|
|
|
def install
|
|
inreplace "lib/common/common_helper.rb" do |s|
|
|
s.gsub! "ROOT_DIR, 'cache'", "'#{var}/cache/wpscan'"
|
|
s.gsub! "ROOT_DIR, 'log.txt'", "'#{var}/log/wpscan/log.txt'"
|
|
end
|
|
|
|
system "unzip", "-o", "data.zip"
|
|
libexec.install "data", "lib", "spec", "Gemfile", "Gemfile.lock", "wpscan.rb"
|
|
|
|
ENV["GEM_HOME"] = libexec
|
|
ENV["BUNDLE_PATH"] = libexec
|
|
ENV["BUNDLE_GEMFILE"] = libexec/"Gemfile"
|
|
system "gem", "install", "bundler"
|
|
system libexec/"bin/bundle", "install", "--without", "test"
|
|
|
|
(bin/"wpscan").write <<-EOS.undent
|
|
#!/bin/bash
|
|
GEM_HOME=#{libexec} BUNDLE_GEMFILE=#{libexec}/Gemfile \
|
|
exec #{libexec}/bin/bundle exec ruby #{libexec}/wpscan.rb "$@"
|
|
EOS
|
|
end
|
|
|
|
def post_install
|
|
(var/"log/wpscan").mkpath
|
|
# Update database
|
|
system bin/"wpscan", "--update"
|
|
end
|
|
|
|
def caveats; <<-EOS.undent
|
|
Logs are saved to #{var}/cache/wpscan/log.txt by default.
|
|
EOS
|
|
end
|
|
|
|
test do
|
|
assert_match "URL: https://wordpress.org/",
|
|
shell_output("#{bin}/wpscan --url https://wordpress.org/")
|
|
end
|
|
end
|