GithubHelp home page GithubHelp logo

invoke-pipeshell's Introduction

Invoke-PipeShell

This script demonstrates a remote command shell running over an SMB Named Pipe The shell is interactive PowerShell or single PowerShell commands

Parameters

.PARAMETER Mode
    Client or Server
.PARAMETER Server
    Hostname of Server
.PARAMETER AESKey
    16 character key used for encryption
.PARAMETER Pipe
    Name of server's named pipe
.PARAMETER Timeout
    Time in milliseconds a client will consider a server unreachable
.PARAMETER CommandTimeout
    Time in seconds a command will run until is it considered dead.  The server will return any output it has
.PARAMETER i
    Use interactive shell.  If false, a single command will be issued from the -c parameter
.PARAMETER c
    command to run in non-interactive mode   

Examples

Server

Host the Named Pipe shell. Commands are executed here.

> powershell -ep bypass
PS Import-Module .\Invoke-PipeShell.ps1
PS Invoke-PipeShell -mode server -aeskey aaaabbbbccccdddd -pipe eventlog_svc -commandtimeout 30

Client

Connects to the server. Issues commands to server and displays results.

Interactive Client

PS Import-Module .\Invoke-PipeShell.ps1 
PS Invoke-PipeShell -mode client -server localhost -aeskey aaaabbbbccccdddd -pipe eventlog_svc -i -timeout 1000

SHELL: ls

Directory: C:\Users\user\Documents

Mode                LastWriteTime     Length Name
----                -------------     ------ ----
d----         3/21/2016   3:28 PM            files

SHELL: pwd

Path
----
C:\Users\user\Documents

Non-interactive client

> powershell -ep bypass

PS Import-Module .\Invoke-PipeShell.ps1 
PS Invoke-PipeShell -mode client -server localhost -aeskey aaaabbbbccccdddd -pipe eventlog_svc -timeout 1000 -c ls

Directory: C:\Users\user\Documents
  
Mode                LastWriteTime     Length Name
----                -------------     ------ ----
d----         3/21/2016   3:28 PM            files

Extra commands

----------------
leave - exits client, leaves server running
kill - kill server and client

invoke-pipeshell's People

Contributors

vestjoe avatar

Watchers

James Cloos avatar

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.