Land #9726, add simple Rex::Tar wrapper for consistency with other archive types
parent
c2bf848ba9
commit
9d5ab1dedf
|
@ -48,8 +48,10 @@ require 'rex/text'
|
||||||
require 'rex/random_identifier'
|
require 'rex/random_identifier'
|
||||||
# library for creating Powershell scripts for exploitation purposes
|
# library for creating Powershell scripts for exploitation purposes
|
||||||
require 'rex/powershell'
|
require 'rex/powershell'
|
||||||
# Library for processing and creating Zip compatbile archives
|
# Library for processing and creating Zip compatible archives
|
||||||
require 'rex/zip'
|
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
|
# Library for parsing offline Windows Registry files
|
||||||
require 'rex/registry'
|
require 'rex/registry'
|
||||||
# Library for parsing Java serialized streams
|
# Library for parsing Java serialized streams
|
||||||
|
|
|
@ -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
|
|
@ -3,8 +3,6 @@
|
||||||
# Current source: https://github.com/rapid7/metasploit-framework
|
# Current source: https://github.com/rapid7/metasploit-framework
|
||||||
##
|
##
|
||||||
|
|
||||||
require 'rubygems/package'
|
|
||||||
|
|
||||||
class MetasploitModule < Msf::Auxiliary
|
class MetasploitModule < Msf::Auxiliary
|
||||||
include Msf::Auxiliary::Report
|
include Msf::Auxiliary::Report
|
||||||
include Msf::Exploit::Remote::HttpClient
|
include Msf::Exploit::Remote::HttpClient
|
||||||
|
@ -41,7 +39,7 @@ class MetasploitModule < Msf::Auxiliary
|
||||||
destination = tarfile.split('.tar').first
|
destination = tarfile.split('.tar').first
|
||||||
FileUtils.mkdir_p(destination)
|
FileUtils.mkdir_p(destination)
|
||||||
File.open(tarfile, 'rb') do |file|
|
File.open(tarfile, 'rb') do |file|
|
||||||
Gem::Package::TarReader.new(file) do |tar|
|
Rex::Tar::Reader.new(file) do |tar|
|
||||||
tar.each do |entry|
|
tar.each do |entry|
|
||||||
dest = File.join destination, entry.full_name
|
dest = File.join destination, entry.full_name
|
||||||
if entry.file?
|
if entry.file?
|
||||||
|
|
Loading…
Reference in New Issue