執行 WPScan 出現 Could not find ‘nokogiri’ 的錯誤

在Kali Linux上執行wpscan的時候,如果出現了以下的錯誤訊息(Error)。

root@HackerCat:~# wpscan -u http://hackercat.org/
Traceback (most recent call last):
	12: from /usr/bin/wpscan:23:in `<main>'
	11: from /usr/lib/ruby/2.5.0/rubygems.rb:304:in `activate_bin_path'
	10: from /usr/lib/ruby/2.5.0/rubygems.rb:304:in `synchronize'
	 9: from /usr/lib/ruby/2.5.0/rubygems.rb:305:in `block in activate_bin_path'
	 8: from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1440:in `activate'
	 7: from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1458:in `activate_dependencies'
	 6: from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1458:in `each'
	 5: from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1472:in `block in activate_dependencies'
	 4: from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1440:in `activate'
	 3: from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1458:in `activate_dependencies'
	 2: from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1458:in `each'
	 1: from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1469:in `block in activate_dependencies'
/usr/lib/ruby/2.5.0/rubygems/dependency.rb:312:in `to_specs': Could not find 'nokogiri' (~> 1.10.8) - did find: [nokogiri-1.10.3] (Gem::MissingSpecVersionError)
Checked in 'GEM_PATH=/root/.gem/ruby/2.5.0:/var/lib/gems/2.5.0:/usr/lib/x86_64-linux-gnu/rubygems-integration/2.5.0:/usr/share/rubygems-integration/2.5.0:/usr/share/rubygems-integration/all', execute `gem env` for more information

可以先嘗試利用apt或gem或其他方法安裝nokogiri,
或是利用apt安裝wpscan

或者是到 WPScan Github 將repo給git clone下來嘗試執行看看
https://github.com/wpscanteam/wpscan

如果說還是不行,出現跟最上面一樣的錯誤,
就執行以下兩個指令:

apt-get install ruby-dev libxml2 zlib1g-dev
gem install nokogiri

如果真的還是不行,就執行以下的指令:

apt remove wpscan -y
apt-get autoremove -y
apt-get autoclean
hash -r
apt install ruby-dev -y
apt-get install wpscan --reinstall

以上這樣應該就可以了,如果還是不行的話,
可能就要再自行多利用關鍵字找找看其他解決方法。

發佈留言