GithubHelp home page GithubHelp logo

namedpipecapture's Introduction

NamedPipeCapture

A Windows tool that can be used to stream data from named pipe between two other process to Wireshark through a named pipe

Installation

Download the latest version from the releases page.
Make sure NamedPipeLauncher.exe and NamedPipeCapturex64.dll is in the same directory

Usage

There are 3 mandatory parameters, 2 optional parameters and 2 commands that can be used.

Mandatory Parameters

  • --input (shorthand -i): Specify the named pipe that will be captured (Ex: \myinputpipe)
  • --output (shorthand -o): Specify the named pipe that the data will be sent to (Ex: \\.\pipe\myoutputpipe)
  • --processid (shorthand -p): Specify the process whose functions will be overwritten

Optional Parameters

  • --clientport (shorthand -c): Specify the client-side port. If the process writes something to the pipe, this port will represent the source of the data transfer. If the process reads something from the pipe, this port will be recorded as the destination.
  • --serverport (shorthand -s): Specify the port that will represent any external process reading/writing to the target named pipe.

Commands

  • --load (shorthand -l): Load the DLL into the targeted process and open the output named pipe
  • --unload (shorthand -u): Unload the DLL from the application and close the output named pipe

Example

> NamedPipeCapture.exe --input \mynamedpipe --output \\.\pipe\myoutputpipe -processid 21457 -c 50 -s 51 --load

This will target the process with the id 21457, and the named pipe in the process with the name mynamedpipe. The data will be streamed to the named pipe myoutputpipe with the client port 50 and the server port 51

To stop the capture, run the unload command with the same process id

> NamedPipeCapture.exe -processid 21457 --unload

Streaming Data (using Wireshark)

Once the --load command has been executed on a process, the data can be seen in real time through Wireshark. Note that data will only begin to be captured once Wireshark has connected to the named pipe specified by the --output parameter.

  1. Open up Wireshark and go to Capture -> Interfaces Tutorial
  2. Click on Options on the bottom of the Interfaces window Tutorial
  3. Click on Manage Interfaces near the top right of the Capture Options window Tutorial
  4. Click on New on the left under the pipe tab and put the name of the output named pipe that was specified earlier Tutorial
  5. Click Save and Close the window. (The error "The link type of interface [your pipe] was not specified" may pop up which is fine. Just close it.)
  6. The newly added named pipe should be listed along with other interfaces in the Capture Options window. Make sure the capture tick box is ticked and then click on start in the bottom right hand corner. Tutorial

Data should now be streaming into Wireshark in real time! Tutorial

#Make sure Wireshark has stopped capturing data before the DLL is unloaded from the process.

namedpipecapture's People

Contributors

mscottmueller avatar vatyx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

namedpipecapture's Issues

InitializeProcess returned -1

In my case, InitializeProcess API call returns -1. Sadly I can't find more detailed information about this error.

The DLL gets attached to the target (verified with Process Explorer), the input pipe is there in the system, the output pipe does not get created - verified with PowerShell [System.IO.Directory]::GetFiles("\\.\\pipe\\")

Process ID refers to a normal user process, started by the same user trying the hook.

This is Microsoft Windows [Version 10.0.19045.3570]

C:\Programs\myhome>.\NamedPipeLauncher.exe --input \\.\pipe\Input_Pipe --output \\.\pipe\traffic --processid 14484  --load
orig fcn ptr = 00007FF6C9B01440
fcnptr = 0000000000000000
InitializeProcess returned 4294967295
Warning: Make certain the DLL is unloaded when the test is done.
If it is not unloaded, the DLL will remain within the process for the life
of the process.
Input pipe: \\.\pipe\Input_Pipe
Output pipe: \\.\pipe\traffic
Process ID: 14484
Client port: 0
Server port: 0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.