File tree Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -536,6 +536,15 @@ def arch
536
536
end
537
537
end
538
538
539
+ #
540
+ # Get a string representation of the architecture of the process in which the
541
+ # current session is running. This defaults to the same value of arch but can
542
+ # be overridden by specific meterpreter implementations to add support.
543
+ #
544
+ def native_arch
545
+ arch
546
+ end
547
+
539
548
#
540
549
# Generate a binary suffix based on arch
541
550
#
Original file line number Diff line number Diff line change @@ -108,6 +108,10 @@ def lookup_error(error_code)
108
108
unknown_error
109
109
end
110
110
111
+ def native_arch
112
+ @native_arch ||= self . core . native_arch
113
+ end
114
+
111
115
def supports_ssl?
112
116
false
113
117
end
Original file line number Diff line number Diff line change @@ -325,6 +325,18 @@ def machine_id(timeout=nil)
325
325
Rex ::Text . md5 ( mid . to_s . downcase . strip )
326
326
end
327
327
328
+ def native_arch ( timeout = nil )
329
+ # Not all meterpreter implementations support this
330
+ request = Packet . create_request ( 'core_native_arch' )
331
+
332
+ args = [ request ]
333
+ args << timeout if timeout
334
+
335
+ response = client . send_request ( *args )
336
+
337
+ response . get_tlv_value ( TLV_TYPE_STRING )
338
+ end
339
+
328
340
def transport_remove ( opts = { } )
329
341
request = transport_prepare_request ( 'core_transport_remove' , opts )
330
342
You can’t perform that action at this time.
0 commit comments