Giter VIP home page Giter VIP logo

sshclient's Introduction

SSHClient

A small SSH client written in C#.

Usage

You can grab a copy of SSHClient from the releases page. Alternatively, feel free to compile the solution yourself. Fody/Costura has been used to embed the SSH.NET reference.

Mandatory Arguments

The mandatory arguments consist of an authentication type (either key or password), connection parameters and a module.

  • -a - Authentication Type
    • -a Password - Use password authentication.
    • -a Key - Use key based authentication.

If the authentication type is Password, then you will need to supply the following parameters.

  • -u USERNAME - SSH username
  • -k PASSWORD - Password of SSH user
  • -s SERVER - SSH server to connect to
  • -p PORT - Port on the SSH server to connect to

If the authentication type is Key, then you will need to supply the following parameters.

  • -u USERNAME - SSH username
  • -k KEY - Path to the SSH key
  • -s SERVER - SSH server to connect to
  • -p PORT - Port on the SSH server to connect to

Standard Modules

Use the following modules to interact with a server via SSH.

  • connect - Test to see if the credentials work
  • command -c COMMAND - Execute an arbitrary command
  • download -f REMOTEFILE -d LOCALPATH - Download a file to a local path
  • upload -f LOCALFILE -d REMOTEPATH Upload a file to a remote path

Examples

Test connection

SSHClient.exe -a Key -s 18.191.138.12 -p 22 -u ubuntu -k c:\users\skawa\aws.key -m connect
[+] Success! ubuntu can log in to 18.191.138.12:22

Execute commands

SSHClient.exe -a Key -s 18.191.138.12 -p 22 -u ubuntu -k c:\users\skawa\aws.key -m command -c "ps -eaf"

[+] Executing: ps -eaf
UID          PID    PPID  C STIME TTY          TIME CMD
root           1       0  0 Nov10 ?        00:00:12 /sbin/init
root           2       0  0 Nov10 ?        00:00:00 [kthreadd]
root           3       2  0 Nov10 ?        00:00:00 [rcu_gp]
root           4       2  0 Nov10 ?        00:00:00 [rcu_par_gp]
root           5       2  0 Nov10 ?        00:00:48 [kworker/0:0-events]
root           6       2  0 Nov10 ?        00:00:00 [kworker/0:0H-events_highpri]
root           9       2  0 Nov10 ?        00:00:00 [mm_percpu_wq]
root          10       2  0 Nov10 ?        00:00:00 [rcu_tasks_rude_]
<snipped>

Download a file

SSHClient.exe -a Key -s 18.191.138.12 -p 22 -u ubuntu -k c:\users\skawa\aws.key -m download -f /etc/passwd -d C:\users\skawa\downloads\

[+] Downloading '/etc/passwd' to 'C:\users\skawa\downloads\'

[+] File downloaded to 'C:\users\skawa\downloads\passwd'

Upload a file

SSHClient.exe -a Key -s 18.191.138.12 -p 22 -u ubuntu -k c:\users\skawa\aws.key -m upload -f C:\Users\skawa\Desktop\test.py -d /home/ubuntu 

[+] Uploading 'C:\Users\skawa\Desktop\test.py' to '/home/ubuntu'

[+] File uploaded to '/home/ubuntu/test.py'

sshclient's People

Contributors

skahwah 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

Watchers

 avatar  avatar  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.