CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/lib/rex/post/meterpreter/extensions/stdapi/tlv.rb
Views: 11791
1
# -*- coding: binary -*-
2
3
module Rex
4
module Post
5
module Meterpreter
6
module Extensions
7
module Stdapi
8
9
##
10
#
11
# General
12
#
13
##
14
15
TLV_TYPE_HANDLE = TLV_META_TYPE_QWORD | 600
16
TLV_TYPE_INHERIT = TLV_META_TYPE_BOOL | 601
17
TLV_TYPE_PROCESS_HANDLE = TLV_META_TYPE_QWORD | 630
18
TLV_TYPE_THREAD_HANDLE = TLV_META_TYPE_QWORD | 631
19
TLV_TYPE_PRIVILEGE = TLV_META_TYPE_STRING | 632
20
21
##
22
#
23
# Fs
24
#
25
##
26
27
TLV_TYPE_DIRECTORY_PATH = TLV_META_TYPE_STRING | 1200
28
TLV_TYPE_FILE_NAME = TLV_META_TYPE_STRING | 1201
29
TLV_TYPE_FILE_PATH = TLV_META_TYPE_STRING | 1202
30
TLV_TYPE_FILE_MODE = TLV_META_TYPE_STRING | 1203
31
TLV_TYPE_FILE_SIZE = TLV_META_TYPE_UINT | 1204
32
TLV_TYPE_FILE_SHORT_NAME = TLV_META_TYPE_STRING | 1205
33
TLV_TYPE_FILE_HASH = TLV_META_TYPE_RAW | 1206
34
35
TLV_TYPE_MOUNT = TLV_META_TYPE_GROUP | 1207
36
TLV_TYPE_MOUNT_NAME = TLV_META_TYPE_STRING | 1208
37
TLV_TYPE_MOUNT_TYPE = TLV_META_TYPE_UINT | 1209
38
TLV_TYPE_MOUNT_SPACE_USER = TLV_META_TYPE_QWORD | 1210
39
TLV_TYPE_MOUNT_SPACE_TOTAL = TLV_META_TYPE_QWORD | 1211
40
TLV_TYPE_MOUNT_SPACE_FREE = TLV_META_TYPE_QWORD | 1212
41
TLV_TYPE_MOUNT_UNCPATH = TLV_META_TYPE_STRING | 1213
42
43
TLV_TYPE_STAT_BUF32 = TLV_META_TYPE_COMPLEX | 1220
44
TLV_TYPE_STAT_BUF = TLV_META_TYPE_COMPLEX | 1221
45
46
TLV_TYPE_SEARCH_RECURSE = TLV_META_TYPE_BOOL | 1230
47
TLV_TYPE_SEARCH_GLOB = TLV_META_TYPE_STRING | 1231
48
TLV_TYPE_SEARCH_ROOT = TLV_META_TYPE_STRING | 1232
49
TLV_TYPE_SEARCH_RESULTS = TLV_META_TYPE_GROUP | 1233
50
TLV_TYPE_SEARCH_MTIME = TLV_META_TYPE_UINT | 1235
51
TLV_TYPE_SEARCH_M_START_DATE= TLV_META_TYPE_UINT | 1236
52
TLV_TYPE_SEARCH_M_END_DATE = TLV_META_TYPE_UINT | 1237
53
54
55
TLV_TYPE_FILE_MODE_T = TLV_META_TYPE_UINT | 1234
56
57
##
58
#
59
# Net
60
#
61
##
62
63
TLV_TYPE_HOST_NAME = TLV_META_TYPE_STRING | 1400
64
TLV_TYPE_PORT = TLV_META_TYPE_UINT | 1401
65
TLV_TYPE_INTERFACE_MTU = TLV_META_TYPE_UINT | 1402
66
TLV_TYPE_INTERFACE_FLAGS = TLV_META_TYPE_STRING | 1403
67
TLV_TYPE_INTERFACE_INDEX = TLV_META_TYPE_UINT | 1404
68
69
TLV_TYPE_SUBNET = TLV_META_TYPE_RAW | 1420
70
TLV_TYPE_NETMASK = TLV_META_TYPE_RAW | 1421
71
TLV_TYPE_GATEWAY = TLV_META_TYPE_RAW | 1422
72
TLV_TYPE_NETWORK_ROUTE = TLV_META_TYPE_GROUP | 1423
73
TLV_TYPE_IP_PREFIX = TLV_META_TYPE_UINT | 1424
74
TLV_TYPE_ARP_ENTRY = TLV_META_TYPE_GROUP | 1425
75
76
TLV_TYPE_IP = TLV_META_TYPE_RAW | 1430
77
TLV_TYPE_MAC_ADDRESS = TLV_META_TYPE_RAW | 1431
78
TLV_TYPE_MAC_NAME = TLV_META_TYPE_STRING | 1432
79
TLV_TYPE_NETWORK_INTERFACE = TLV_META_TYPE_GROUP | 1433
80
TLV_TYPE_IP6_SCOPE = TLV_META_TYPE_RAW | 1434
81
82
TLV_TYPE_SUBNET_STRING = TLV_META_TYPE_STRING | 1440
83
TLV_TYPE_NETMASK_STRING = TLV_META_TYPE_STRING | 1441
84
TLV_TYPE_GATEWAY_STRING = TLV_META_TYPE_STRING | 1442
85
TLV_TYPE_ROUTE_METRIC = TLV_META_TYPE_UINT | 1443
86
87
# Resolve
88
TLV_TYPE_ADDR_TYPE = TLV_META_TYPE_UINT | 1444
89
90
# Proxy configuration
91
TLV_TYPE_PROXY_CFG_AUTODETECT = TLV_META_TYPE_BOOL | 1445
92
TLV_TYPE_PROXY_CFG_AUTOCONFIGURL = TLV_META_TYPE_STRING | 1446
93
TLV_TYPE_PROXY_CFG_PROXY = TLV_META_TYPE_STRING | 1447
94
TLV_TYPE_PROXY_CFG_PROXYBYPASS = TLV_META_TYPE_STRING | 1448
95
96
# Socket
97
TLV_TYPE_PEER_HOST = TLV_META_TYPE_STRING | 1500
98
TLV_TYPE_PEER_PORT = TLV_META_TYPE_UINT | 1501
99
TLV_TYPE_LOCAL_HOST = TLV_META_TYPE_STRING | 1502
100
TLV_TYPE_LOCAL_PORT = TLV_META_TYPE_UINT | 1503
101
TLV_TYPE_CONNECT_RETRIES = TLV_META_TYPE_UINT | 1504
102
TLV_TYPE_NETSTAT_ENTRY = TLV_META_TYPE_GROUP | 1505
103
TLV_TYPE_PEER_HOST_RAW = TLV_META_TYPE_RAW | 1506
104
TLV_TYPE_LOCAL_HOST_RAW = TLV_META_TYPE_RAW | 1507
105
106
TLV_TYPE_SHUTDOWN_HOW = TLV_META_TYPE_UINT | 1530
107
108
##
109
#
110
# Sys
111
#
112
##
113
114
PROCESS_EXECUTE_FLAG_HIDDEN = (1 << 0)
115
PROCESS_EXECUTE_FLAG_CHANNELIZED = (1 << 1)
116
PROCESS_EXECUTE_FLAG_SUSPENDED = (1 << 2)
117
PROCESS_EXECUTE_FLAG_USE_THREAD_TOKEN = (1 << 3)
118
PROCESS_EXECUTE_FLAG_DESKTOP = (1 << 4)
119
PROCESS_EXECUTE_FLAG_SESSION = (1 << 5)
120
PROCESS_EXECUTE_FLAG_SUBSHELL = (1 << 6)
121
PROCESS_EXECUTE_FLAG_PTY = (1 << 7)
122
PROCESS_EXECUTE_FLAG_ARG_ARRAY = (1 << 8)
123
124
# Registry
125
TLV_TYPE_HKEY = TLV_META_TYPE_QWORD | 1000
126
TLV_TYPE_ROOT_KEY = TLV_TYPE_HKEY
127
TLV_TYPE_BASE_KEY = TLV_META_TYPE_STRING | 1001
128
TLV_TYPE_PERMISSION = TLV_META_TYPE_UINT | 1002
129
TLV_TYPE_KEY_NAME = TLV_META_TYPE_STRING | 1003
130
TLV_TYPE_VALUE_NAME = TLV_META_TYPE_STRING | 1010
131
TLV_TYPE_VALUE_TYPE = TLV_META_TYPE_UINT | 1011
132
TLV_TYPE_VALUE_DATA = TLV_META_TYPE_RAW | 1012
133
TLV_TYPE_TARGET_HOST = TLV_META_TYPE_STRING | 1013
134
135
# Config
136
TLV_TYPE_COMPUTER_NAME = TLV_META_TYPE_STRING | 1040
137
TLV_TYPE_OS_NAME = TLV_META_TYPE_STRING | 1041
138
TLV_TYPE_USER_NAME = TLV_META_TYPE_STRING | 1042
139
TLV_TYPE_ARCHITECTURE = TLV_META_TYPE_STRING | 1043
140
TLV_TYPE_LANG_SYSTEM = TLV_META_TYPE_STRING | 1044
141
TLV_TYPE_SID = TLV_META_TYPE_STRING | 1045
142
TLV_TYPE_DOMAIN = TLV_META_TYPE_STRING | 1046
143
TLV_TYPE_LOGGED_ON_USER_COUNT = TLV_META_TYPE_UINT | 1047
144
TLV_TYPE_LOCAL_DATETIME = TLV_META_TYPE_STRING | 1048
145
TLV_TYPE_BUILD_TUPLE = TLV_META_TYPE_STRING | 1049
146
147
# Environment
148
TLV_TYPE_ENV_VARIABLE = TLV_META_TYPE_STRING | 1100
149
TLV_TYPE_ENV_VALUE = TLV_META_TYPE_STRING | 1101
150
TLV_TYPE_ENV_GROUP = TLV_META_TYPE_GROUP | 1102
151
152
DELETE_KEY_FLAG_RECURSIVE = (1 << 0)
153
154
# Process
155
TLV_TYPE_BASE_ADDRESS = TLV_META_TYPE_QWORD | 2000
156
TLV_TYPE_ALLOCATION_TYPE = TLV_META_TYPE_UINT | 2001
157
TLV_TYPE_PROTECTION = TLV_META_TYPE_UINT | 2002
158
TLV_TYPE_PROCESS_PERMS = TLV_META_TYPE_UINT | 2003
159
TLV_TYPE_PROCESS_MEMORY = TLV_META_TYPE_RAW | 2004
160
TLV_TYPE_ALLOC_BASE_ADDRESS = TLV_META_TYPE_QWORD | 2005
161
TLV_TYPE_MEMORY_STATE = TLV_META_TYPE_UINT | 2006
162
TLV_TYPE_MEMORY_TYPE = TLV_META_TYPE_UINT | 2007
163
TLV_TYPE_ALLOC_PROTECTION = TLV_META_TYPE_UINT | 2008
164
TLV_TYPE_PID = TLV_META_TYPE_UINT | 2300
165
TLV_TYPE_PROCESS_NAME = TLV_META_TYPE_STRING | 2301
166
TLV_TYPE_PROCESS_PATH = TLV_META_TYPE_STRING | 2302
167
TLV_TYPE_PROCESS_GROUP = TLV_META_TYPE_GROUP | 2303
168
TLV_TYPE_PROCESS_FLAGS = TLV_META_TYPE_UINT | 2304
169
TLV_TYPE_PROCESS_ARGUMENTS = TLV_META_TYPE_STRING | 2305
170
TLV_TYPE_PROCESS_ARCH = TLV_META_TYPE_UINT | 2306
171
TLV_TYPE_PARENT_PID = TLV_META_TYPE_UINT | 2307
172
TLV_TYPE_PROCESS_SESSION = TLV_META_TYPE_UINT | 2308
173
TLV_TYPE_PROCESS_ARCH_NAME = TLV_META_TYPE_STRING | 2309
174
TLV_TYPE_PROCESS_ARGUMENT = TLV_META_TYPE_STRING | 2310
175
TLV_TYPE_PROCESS_UNESCAPED_PATH = TLV_META_TYPE_STRING | 2311
176
177
TLV_TYPE_DRIVER_ENTRY = TLV_META_TYPE_GROUP | 2320
178
TLV_TYPE_DRIVER_BASENAME = TLV_META_TYPE_STRING | 2321
179
TLV_TYPE_DRIVER_FILENAME = TLV_META_TYPE_STRING | 2322
180
181
TLV_TYPE_IMAGE_FILE = TLV_META_TYPE_STRING | 2400
182
TLV_TYPE_IMAGE_FILE_PATH = TLV_META_TYPE_STRING | 2401
183
TLV_TYPE_PROCEDURE_NAME = TLV_META_TYPE_STRING | 2402
184
TLV_TYPE_PROCEDURE_ADDRESS = TLV_META_TYPE_QWORD | 2403
185
TLV_TYPE_IMAGE_BASE = TLV_META_TYPE_QWORD | 2404
186
TLV_TYPE_IMAGE_GROUP = TLV_META_TYPE_GROUP | 2405
187
TLV_TYPE_IMAGE_NAME = TLV_META_TYPE_STRING | 2406
188
189
TLV_TYPE_THREAD_ID = TLV_META_TYPE_UINT | 2500
190
TLV_TYPE_THREAD_PERMS = TLV_META_TYPE_UINT | 2502
191
TLV_TYPE_EXIT_CODE = TLV_META_TYPE_UINT | 2510
192
TLV_TYPE_ENTRY_POINT = TLV_META_TYPE_QWORD | 2511
193
TLV_TYPE_ENTRY_PARAMETER = TLV_META_TYPE_QWORD | 2512
194
TLV_TYPE_CREATION_FLAGS = TLV_META_TYPE_UINT | 2513
195
196
TLV_TYPE_REGISTER_NAME = TLV_META_TYPE_STRING | 2540
197
TLV_TYPE_REGISTER_SIZE = TLV_META_TYPE_UINT | 2541
198
TLV_TYPE_REGISTER_VALUE_32 = TLV_META_TYPE_UINT | 2542
199
TLV_TYPE_REGISTER = TLV_META_TYPE_GROUP | 2550
200
201
TLV_TYPE_TERMINAL_ROWS = TLV_META_TYPE_UINT | 2600
202
TLV_TYPE_TERMINAL_COLUMNS = TLV_META_TYPE_UINT | 2601
203
204
##
205
#
206
# Memory
207
#
208
##
209
210
TLV_TYPE_MEMORY_SEARCH_NEEDLE = TLV_META_TYPE_STRING | 2650
211
TLV_TYPE_MEMORY_SEARCH_RESULTS = TLV_META_TYPE_GROUP | 2651
212
TLV_TYPE_MEMORY_SEARCH_MATCH_LEN = TLV_META_TYPE_UINT | 2652
213
TLV_TYPE_MEMORY_SEARCH_START_ADDR = TLV_META_TYPE_QWORD | 2653
214
TLV_TYPE_MEMORY_SEARCH_SECT_LEN = TLV_META_TYPE_QWORD | 2654
215
TLV_TYPE_MEMORY_SEARCH_MATCH_ADDR = TLV_META_TYPE_QWORD | 2655
216
TLV_TYPE_MEMORY_SEARCH_MATCH_STR = TLV_META_TYPE_STRING | 2656
217
218
##
219
#
220
# Ui
221
#
222
##
223
224
TLV_TYPE_IDLE_TIME = TLV_META_TYPE_UINT | 3000
225
TLV_TYPE_KEYS_DUMP = TLV_META_TYPE_STRING | 3001
226
TLV_TYPE_DESKTOP_SCREENSHOT = TLV_META_TYPE_RAW | 3002
227
TLV_TYPE_DESKTOP_SWITCH = TLV_META_TYPE_BOOL | 3003
228
TLV_TYPE_DESKTOP = TLV_META_TYPE_GROUP | 3004
229
TLV_TYPE_DESKTOP_SESSION = TLV_META_TYPE_UINT | 3005
230
TLV_TYPE_DESKTOP_STATION = TLV_META_TYPE_STRING | 3006
231
TLV_TYPE_DESKTOP_NAME = TLV_META_TYPE_STRING | 3007
232
TLV_TYPE_DESKTOP_SCREENSHOT_QUALITY = TLV_META_TYPE_UINT | 3008
233
TLV_TYPE_DESKTOP_SCREENSHOT_PE32DLL_BUFFER = TLV_META_TYPE_RAW | 3010
234
TLV_TYPE_DESKTOP_SCREENSHOT_PE64DLL_BUFFER = TLV_META_TYPE_RAW | 3012
235
TLV_TYPE_KEYSCAN_TRACK_ACTIVE_WINDOW = TLV_META_TYPE_BOOL | 3013
236
TLV_TYPE_KEYS_SEND = TLV_META_TYPE_STRING | 3014
237
TLV_TYPE_MOUSE_ACTION = TLV_META_TYPE_UINT | 3015
238
TLV_TYPE_MOUSE_X = TLV_META_TYPE_UINT | 3016
239
TLV_TYPE_MOUSE_Y = TLV_META_TYPE_UINT | 3017
240
TLV_TYPE_KEYEVENT_SEND = TLV_META_TYPE_RAW | 3018
241
242
##
243
#
244
# Event Log
245
#
246
##
247
248
TLV_TYPE_EVENT_SOURCENAME = TLV_META_TYPE_STRING | 4000
249
TLV_TYPE_EVENT_HANDLE = TLV_META_TYPE_QWORD | 4001
250
TLV_TYPE_EVENT_NUMRECORDS = TLV_META_TYPE_UINT | 4002
251
252
TLV_TYPE_EVENT_READFLAGS = TLV_META_TYPE_UINT | 4003
253
TLV_TYPE_EVENT_RECORDOFFSET = TLV_META_TYPE_UINT | 4004
254
255
TLV_TYPE_EVENT_RECORDNUMBER = TLV_META_TYPE_UINT | 4006
256
TLV_TYPE_EVENT_TIMEGENERATED= TLV_META_TYPE_UINT | 4007
257
TLV_TYPE_EVENT_TIMEWRITTEN = TLV_META_TYPE_UINT | 4008
258
TLV_TYPE_EVENT_ID = TLV_META_TYPE_UINT | 4009
259
TLV_TYPE_EVENT_TYPE = TLV_META_TYPE_UINT | 4010
260
TLV_TYPE_EVENT_CATEGORY = TLV_META_TYPE_UINT | 4011
261
TLV_TYPE_EVENT_STRING = TLV_META_TYPE_STRING | 4012
262
TLV_TYPE_EVENT_DATA = TLV_META_TYPE_RAW | 4013
263
264
##
265
#
266
# Power
267
#
268
##
269
270
TLV_TYPE_POWER_FLAGS = TLV_META_TYPE_UINT | 4100
271
TLV_TYPE_POWER_REASON = TLV_META_TYPE_UINT | 4101
272
273
##
274
#
275
# Webcam
276
#
277
##
278
279
TLV_TYPE_WEBCAM_IMAGE = TLV_META_TYPE_RAW | (TLV_EXTENSIONS + 1)
280
TLV_TYPE_WEBCAM_INTERFACE_ID= TLV_META_TYPE_UINT | (TLV_EXTENSIONS + 2)
281
TLV_TYPE_WEBCAM_QUALITY = TLV_META_TYPE_UINT | (TLV_EXTENSIONS + 3)
282
TLV_TYPE_WEBCAM_NAME = TLV_META_TYPE_STRING | (TLV_EXTENSIONS + 4)
283
284
##
285
#
286
# Audio
287
#
288
##
289
290
TLV_TYPE_AUDIO_DURATION = TLV_META_TYPE_UINT | (TLV_EXTENSIONS + 10)
291
TLV_TYPE_AUDIO_DATA = TLV_META_TYPE_RAW | (TLV_EXTENSIONS + 11)
292
TLV_TYPE_AUDIO_INTERFACE_ID = TLV_META_TYPE_UINT | (TLV_EXTENSIONS + 12)
293
TLV_TYPE_AUDIO_INTERFACE_NAME = TLV_META_TYPE_STRING | (TLV_EXTENSIONS + 13)
294
295
end; end; end; end; end
296
297
298