Giter Site home page Giter Site logo

wsshuttle's Introduction

Description

It runs sshuttle from WSL2, and sets up the routing table of Windows. Since it modifies the routing table of Windows, the admin privilege of Windows is required. (Open WSL2 terminal with "Run as Administrator".)

Requirements

  • ipcalc
  • bash >= 4.0
  • sshuttle == 1.0.5

Installation

sudo apt install -y ipcalc
pip3 install sshuttle==1.0.5 # Other version may cause "doas" error.
curl https://raw.githubusercontent.com/yabeenico/wsshuttle/main/wsshuttle | sudo install /dev/stdin /usr/local/bin/wsshuttle

Usage

wsshuttle --help
wsshuttle [--delete] [--dry] [--upgrade] [--version] <sshuttle_args...>

Examples

Caution!: Admin privilege of Windows is required.

Route all (0/0) packets through ssh-server except destination is 157.0.0.0/8.
And it excludes 'IP address of ssh-server' too by specifying -x 'IP address of ssh-server' automatically.

wsshuttle -r ssh-server -x 157.0.0.0/8 0/0

Disables the feature of auto specifying -x 'IP address of ssh-server'.

Deletes routing table.
Routing table is reset when wsshuttle exits, if you have any problem, do it.

wsshuttle -r ssh-server -x 157.0.0.0/8 0/0 --delete

Dry-run, just prints commands.
Doesn't make any changes.

wsshuttle -r ssh-server -x 157.0.0.0/8 0/0 --dry
route.exe delete 157.0.0.0 mask 255.0.0.0
route.exe delete 3.3.3.3   mask 255.255.255.255
route.exe delete 0.0.0.0   mask 128.0.0.0
route.exe delete 128.0.0.0 mask 128.0.0.0
route.exe add    157.0.0.0 mask 255.0.0.0       192.168.3.1    metric 1 if 7
route.exe add    3.3.3.3   mask 255.255.255.255 192.168.3.1    metric 1 if 7
route.exe add    0.0.0.0   mask 128.0.0.0       172.18.187.223 metric 1 if 46
route.exe add    128.0.0.0 mask 128.0.0.0       172.18.187.223 metric 1 if 46
sshuttle -l 0.0.0.0:0 -x 3.3.3.3 -r ssh-server -x 157.0.0.0/8 0/0
route.exe delete 157.0.0.0 mask 255.0.0.0
route.exe delete 3.3.3.3   mask 255.255.255.255
route.exe delete 0.0.0.0   mask 128.0.0.0
route.exe delete 128.0.0.0 mask 128.0.0.0

Recommended Settings

Invoke 'wsshuttle' when hit 'sshuttle'.
When not admin, do privilege elevation automatically. ~~ Installing 'sudo' on PowerShell is required (scoop install sudo)

sshuttle(){
    if net.exe session &>/dev/null; then # if admin
        $SHELL -ic "wsshuttle $*"
    else
        powershell.exe sudo wsl $SHELL -ic \"wsshuttle $*\"
    fi
}

wsshuttle's People

Contributors

yabeenico avatar buty4649 avatar

Watchers

 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.