Skip to content

Commit

Permalink
switch to ruby joomla updater
Browse files Browse the repository at this point in the history
  • Loading branch information
h00die committed Dec 30, 2024
1 parent 40c9a97 commit e4fed21
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 16 deletions.
16 changes: 0 additions & 16 deletions tools/dev/update_joomla_components.py

This file was deleted.

79 changes: 79 additions & 0 deletions tools/dev/update_joomla_components.rb
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

0 comments on commit e4fed21

Please sign in to comment.