Land #9726, add simple Rex::Tar wrapper for consistency with other archive types

GSoC/Meterpreter_Web_Console
Brent Cook 2018-04-02 23:35:22 -05:00
commit bd3c00dfd0
No known key found for this signature in database
GPG Key ID: 1FFAA0B24B708F96
3 changed files with 12 additions and 4 deletions

View File

@ -48,8 +48,10 @@ require 'rex/text'
require 'rex/random_identifier'
# library for creating Powershell scripts for exploitation purposes
require 'rex/powershell'
# Library for processing and creating Zip compatbile archives
# Library for processing and creating Zip compatible archives
require 'rex/zip'
# Library for processing and creating tar compatible archives (not really a gem)
require 'rex/tar'
# Library for parsing offline Windows Registry files
require 'rex/registry'
# Library for parsing Java serialized streams

8
lib/rex/tar.rb Normal file
View File

@ -0,0 +1,8 @@
# -*- coding: binary -*-
require 'rubygems/package'
module Rex::Tar
class Reader < Gem::Package::TarReader; end
class Writer < Gem::Package::TarWriter; end
end

View File

@ -3,8 +3,6 @@
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'rubygems/package'
class MetasploitModule < Msf::Auxiliary
include Msf::Auxiliary::Report
include Msf::Exploit::Remote::HttpClient
@ -41,7 +39,7 @@ class MetasploitModule < Msf::Auxiliary
destination = tarfile.split('.tar').first
FileUtils.mkdir_p(destination)
File.open(tarfile, 'rb') do |file|
Gem::Package::TarReader.new(file) do |tar|
Rex::Tar::Reader.new(file) do |tar|
tar.each do |entry|
dest = File.join destination, entry.full_name
if entry.file?