From 9d5ab1dedf0c2e1a0b2d7f30e0ad01183b3210bd Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Mon, 2 Apr 2018 23:35:22 -0500 Subject: [PATCH] Land #9726, add simple Rex::Tar wrapper for consistency with other archive types --- lib/rex.rb | 4 +++- lib/rex/tar.rb | 8 ++++++++ modules/auxiliary/admin/http/telpho10_credential_dump.rb | 4 +--- 3 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 lib/rex/tar.rb diff --git a/lib/rex.rb b/lib/rex.rb index 1fdc65adc7..a59bd4bd4d 100644 --- a/lib/rex.rb +++ b/lib/rex.rb @@ -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 diff --git a/lib/rex/tar.rb b/lib/rex/tar.rb new file mode 100644 index 0000000000..42d3f326b6 --- /dev/null +++ b/lib/rex/tar.rb @@ -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 diff --git a/modules/auxiliary/admin/http/telpho10_credential_dump.rb b/modules/auxiliary/admin/http/telpho10_credential_dump.rb index 0ca01b062f..28d706bb88 100644 --- a/modules/auxiliary/admin/http/telpho10_credential_dump.rb +++ b/modules/auxiliary/admin/http/telpho10_credential_dump.rb @@ -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?