Enhacements to sql export code. Thanks to javiercasares for list.
This commit is contained in:
@@ -6,21 +6,24 @@ class WebSite
|
|||||||
# Checks if a .sql file exists
|
# Checks if a .sql file exists
|
||||||
# @return [ Array ]
|
# @return [ Array ]
|
||||||
def sql_file_export
|
def sql_file_export
|
||||||
backup_files = []
|
export_files = []
|
||||||
|
|
||||||
self.sql_file_export_urls.each do |url|
|
self.sql_file_export_urls.each do |url|
|
||||||
response = Browser.get(url)
|
response = Browser.get(url)
|
||||||
backup_files << url if response.code == 200 && response.body =~ /INSERT INTO/
|
export_files << url if response.code == 200 && response.body =~ /INSERT INTO/
|
||||||
end
|
end
|
||||||
|
|
||||||
backup_files
|
export_files
|
||||||
end
|
end
|
||||||
|
|
||||||
# Gets a .sql export file URL
|
# Gets a .sql export file URL
|
||||||
# @return [ Array ]
|
# @return [ Array ]
|
||||||
def sql_file_export_urls
|
def sql_file_export_urls
|
||||||
urls = []
|
urls = []
|
||||||
files = ["#{@uri.host[/(^[\w|-]+)/,1]}.sql", 'backup.sql', 'database.sql', 'dump.sql']
|
host = @uri.host[/(^[\w|-]+)/,1]
|
||||||
|
|
||||||
|
files = ["#{host}.sql", "#{host}.sql.gz", "#{host}.zip", 'db.sql', 'site.sql', 'database.sql',
|
||||||
|
'data.sql', 'backup.sql','dump.sql', 'db_backup.sql', 'dbdump.sql', 'wordpress.sql', 'mysql.sql']
|
||||||
|
|
||||||
files.each do |file|
|
files.each do |file|
|
||||||
urls << @uri.clone.merge(file).to_s
|
urls << @uri.clone.merge(file).to_s
|
||||||
|
|||||||
12
wpscan.rb
12
wpscan.rb
@@ -255,12 +255,6 @@ def main
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
unless wp_target.sql_file_export.empty?
|
|
||||||
wp_target.sql_file_export.each do |file|
|
|
||||||
puts critical("SQL export file found: #{file}")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
code = get_http_status(wp_target.humans_url)
|
code = get_http_status(wp_target.humans_url)
|
||||||
if code == 200
|
if code == 200
|
||||||
puts info("humans.txt available under: #{wp_target.humans_url} [HTTP #{code}]")
|
puts info("humans.txt available under: #{wp_target.humans_url} [HTTP #{code}]")
|
||||||
@@ -279,6 +273,12 @@ def main
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
unless wp_target.sql_file_export.empty?
|
||||||
|
wp_target.sql_file_export.each do |file|
|
||||||
|
puts critical("SQL export file found: #{file}")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if wp_target.has_debug_log?
|
if wp_target.has_debug_log?
|
||||||
puts critical("Debug log file found: #{wp_target.debug_log_url}")
|
puts critical("Debug log file found: #{wp_target.debug_log_url}")
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user