File tree Expand file tree Collapse file tree 3 files changed +18
-0
lines changed
ui/console/command_dispatcher Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -230,6 +230,16 @@ def use(mod, opts = { })
230
230
return true
231
231
end
232
232
233
+ def machine_id
234
+ request = Packet . create_request ( 'core_machine_id' )
235
+
236
+ response = client . send_request ( request )
237
+
238
+ id = response . get_tlv_value ( TLV_TYPE_MACHINE_ID )
239
+ # TODO: Determine if we're going to MD5/SHA1 this
240
+ return Rex ::Text . md5 ( id )
241
+ end
242
+
233
243
def change_transport ( opts = { } )
234
244
request = Packet . create_request ( 'core_change_transport' )
235
245
Original file line number Diff line number Diff line change @@ -91,6 +91,8 @@ module Meterpreter
91
91
TLV_TYPE_TRANSPORT_TYPE = TLV_META_TYPE_UINT | 430
92
92
TLV_TYPE_TRANSPORT_URL = TLV_META_TYPE_STRING | 431
93
93
94
+ TLV_TYPE_MACHINE_ID = TLV_META_TYPE_STRING | 460
95
+
94
96
TLV_TYPE_CIPHER_NAME = TLV_META_TYPE_STRING | 500
95
97
TLV_TYPE_CIPHER_PARAMETERS = TLV_META_TYPE_GROUP | 501
96
98
@@ -185,6 +187,7 @@ def inspect
185
187
when TLV_TYPE_MIGRATE_ARCH ; "MIGRATE-ARCH"
186
188
when TLV_TYPE_TRANSPORT_TYPE ; "TRANSPORT-TYPE"
187
189
when TLV_TYPE_TRANSPORT_URL ; "TRANSPORT-URL"
190
+ when TLV_TYPE_MACHINE_ID ; "MACHINE-ID"
188
191
189
192
#when Extensions::Stdapi::TLV_TYPE_NETWORK_INTERFACE; 'network-interface'
190
193
#when Extensions::Stdapi::TLV_TYPE_IP; 'ip-address'
Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ def commands
63
63
"use" => "Deprecated alias for 'load'" ,
64
64
"load" => "Load one or more meterpreter extensions" ,
65
65
"transport" => "Change the current transport mechanism" ,
66
+ "machine_id" => "Get the MSF ID of the machine attached to the session" ,
66
67
"quit" => "Terminate the meterpreter session" ,
67
68
"resource" => "Run the commands stored in a file" ,
68
69
"read" => "Reads data from a channel" ,
@@ -333,6 +334,10 @@ def cmd_irb(*args)
333
334
Rex ::Ui ::Text ::IrbShell . new ( binding ) . run
334
335
end
335
336
337
+ def cmd_machine_id ( *args )
338
+ print_good ( "Machine ID: #{ client . core . machine_id } " )
339
+ end
340
+
336
341
def cmd_transport ( *args )
337
342
if ( args . length == 0 or args . include? ( "-h" ) )
338
343
#cmd_transport_help
You can’t perform that action at this time.
0 commit comments