Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Oct 21, 2024. It is now read-only.
This repository was archived by the owner on Oct 21, 2024. It is now read-only.

remcom doesn't use buffered output #27

@rustyscottweber

Description

@rustyscottweber

on windows, because python
always assumes that you are using a bufferd command window, it will not start
in interactive mode and rely on the cmd window to flush the output to the
user.. when you are running from a windowless application that spawns a
process with the CREATE_NO_WINDOW, there is no cmd window to flush the
output for you. In python you can start the interpreter in interactive
mode by using the -i parameter.
example....
impacket-0.9.10\examples>C:\Python27\python.exe psexec.py
myhost/Administrator:mypassword@myhost C:\Windows\System32\cmd.exe /c
python -i
will flush it's output the way it is suppose to.
<<RemComSvc.cpp >>
if ( CreateProcess(
NULL,
szCommand,
NULL,
NULL,
TRUE,
pMsg->dwPriority | CREATE_NO_WINDOW,
NULL,
pMsg->szWorkingDir[0] != _T('\0') ? pMsg->szWorkingDir : NULL,
&si,
&pi ) )
I wonder if there is a fix that we can implement in remcom that would
tell the pipes to continuously flush themselves at regular intervals like a
normal command window will do.
consider the following...

psi->hStdInput = CreateNamedPipe(
szStdInPipe,
PIPE_ACCESS_INBOUND,
PIPE_TYPE_MESSAGE | PIPE_WAIT,
PIPE_UNLIMITED_INSTANCES,
0,
0,
(DWORD)-1,
&SecAttrib);
http://msdn.microsoft.com/en-us/library/windows/desktop/aa365150%28v=vs.85%29.aspx
What if remcom used _PIPE_READMODE_BYTE or _PIPE_READMODE_MESSAGE?
Can some one ratify and confirm the issue for me?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions