forked from rapid7/metasploit-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
79 additions
and
16 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
#!/usr/bin/env ruby | ||
# -*- coding: binary -*- | ||
|
||
# | ||
# Update modules/auxiliary/scanner/http/wordpress_scanner.rb to have the most | ||
# up to date list of vuln components based on exploits/scanners in the framework | ||
# | ||
# by h00die | ||
# | ||
|
||
require 'optparse' | ||
require 'net/http' | ||
require 'uri' | ||
optparse = OptionParser.new do |opts| | ||
opts.banner = 'Usage: update_joomla_components.rb [options]' | ||
opts.on('-h', '--help', 'Display this screen.') do | ||
puts opts | ||
exit | ||
end | ||
end | ||
optparse.parse! | ||
|
||
# colors and puts templates from msftidy.rb | ||
|
||
class String | ||
def red | ||
"\e[1;31;40m#{self}\e[0m" | ||
end | ||
|
||
def yellow | ||
"\e[1;33;40m#{self}\e[0m" | ||
end | ||
|
||
def green | ||
"\e[1;32;40m#{self}\e[0m" | ||
end | ||
|
||
def cyan | ||
"\e[1;36;40m#{self}\e[0m" | ||
end | ||
end | ||
|
||
# | ||
# Display an error message, given some text | ||
# | ||
def error(txt) | ||
puts "[#{'ERROR'.red}] #{cleanup_text(txt)}" | ||
end | ||
|
||
# | ||
# Display a warning message, given some text | ||
# | ||
def warning(txt) | ||
puts "[#{'WARNING'.yellow}] #{cleanup_text(txt)}" | ||
end | ||
|
||
# | ||
# Display a info message, given some text | ||
# | ||
def info(txt) | ||
puts "[#{'INFO'.cyan}] #{cleanup_text(txt)}" | ||
end | ||
|
||
uri = URI.parse('https://raw.githubusercontent.com/rezasp/joomscan/master/exploit/db/componentslist.txt') | ||
new_com = Net::HTTP.get(uri) | ||
|
||
old = File.read('data/wordlists/joomla.txt').split("\n") | ||
|
||
new_com.each_line do |com| | ||
unless old.include?("components/#{com.strip}/") | ||
old << "components/#{com.strip}/" | ||
info "Adding: components/#{com.strip}/" | ||
end | ||
end | ||
|
||
old.sort! | ||
File.open('data/wordlists/joomla.txt', 'w') do |file| | ||
file.puts old | ||
end |