Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/tools/dev/update_joomla_components.rb
Views: 15959
#!/usr/bin/env ruby1# -*- coding: binary -*-23#4# by h00die5#67require 'optparse'8require 'net/http'9require 'uri'10optparse = OptionParser.new do |opts|11opts.banner = 'Usage: ruby tools/dev/update_joomla_components.rb [options]'12opts.separator "This program updates data/wordlists/joomla.txt which is used by modules/auxiliary/scanner/http/joomla_scanner.rb to have the most up-to-date list of vuln components"13opts.separator ""14opts.on('-h', '--help', 'Display this screen.') do15puts opts16exit17end18end19optparse.parse!2021# colors and puts templates from msftidy.rb2223class String24def red25"\e[1;31;40m#{self}\e[0m"26end2728def yellow29"\e[1;33;40m#{self}\e[0m"30end3132def green33"\e[1;32;40m#{self}\e[0m"34end3536def cyan37"\e[1;36;40m#{self}\e[0m"38end39end4041#42# Display an error message, given some text43#44def error(txt)45puts "[#{'ERROR'.red}] #{cleanup_text(txt)}"46end4748#49# Display a warning message, given some text50#51def warning(txt)52puts "[#{'WARNING'.yellow}] #{cleanup_text(txt)}"53end5455#56# Display a info message, given some text57#58def info(txt)59puts "[#{'INFO'.cyan}] #{cleanup_text(txt)}"60end6162uri = URI.parse('https://raw.githubusercontent.com/rezasp/joomscan/master/exploit/db/componentslist.txt')63new_com = Net::HTTP.get(uri)6465old = File.read('data/wordlists/joomla.txt').split("\n")6667new_com.each_line do |com|68unless old.include?("components/#{com.strip}/")69old << "components/#{com.strip}/"70info "Adding: components/#{com.strip}/"71end72end7374old.sort!75File.open('data/wordlists/joomla.txt', 'w') do |file|76file.puts old77end7879