Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows 8 named pipe creation

How I can create named pipe in the Windows 8 with AppContainer integrity level?

like image 411
bajlepa Avatar asked Oct 09 '11 21:10

bajlepa


People also ask

How do you make a named pipe in Windows?

To create an instance of a named pipe by using CreateNamedPipe, the user must have FILE_CREATE_PIPE_INSTANCE access to the named pipe object. If a new named pipe is being created, the access control list (ACL) from the security attributes parameter defines the discretionary access control for the named pipe.

Where are named pipes on Windows?

Every pipe is placed in the root directory of the named pipe filesystem (NPFS), mounted under the special path \\. \pipe\ (that is, a pipe named "foo" would have a full path name of \\. \pipe\foo ).

What is a Windows named pipe?

A named pipe is a named, one-way or duplex pipe for communication between the pipe server and one or more pipe clients. All instances of a named pipe share the same pipe name, but each instance has its own buffers and handles, and provides a separate conduit for client/server communication.

What is a named pipe in SMB?

A named pipe is a logical connection, similar to a TCP session, between a client and server that are involved in a Common Internet File System (CIFS)/SMB/SMB Version 2 and Version 3 connection.


2 Answers

As Pavel Minaev mentioned in one of comments to some answer, there are no named pipes in WinRT (for Metro applications, for desktop applications pipes are the same as in Windows 7):

Named pipes aren't there, for example, nor are memory mapped files. There are sockets (including server sockets), but when connecting to localhost, you can only connect to the same app.

You may be interested in the WinRT API, including sockets.

like image 103
Roman Boiko Avatar answered Sep 19 '22 04:09

Roman Boiko


Talking about WinRT - you really can't create named pipe.

Talking about Windows 8 desktop application running under AppContainer integrity level - you can create named pipe by regular WinAPI functions. The problem is by default only applications with same AppContainer ID could access it (in other words - only instances of your own application). But in fact if you have process under High or Medium integrity level - from this process you can create pipe and decrease its integrity level, so applications from AppContainer can use it.

Take a look at sample here: http://msdn.microsoft.com/en-us/library/windows/desktop/hh448493(v=vs.85).aspx

Even more - from desktop application with High integrity level you can use dll injection to inject you dll to WinRT application and again - use WinAPI to create pipes. So pipes are denied in WinRT not by OS design, but only by lack of interfaces in WinRT.

like image 39
Ezh Avatar answered Sep 21 '22 04:09

Ezh