mirror of
https://github.com/sshuttle/sshuttle.git
synced 2025-07-04 16:50:34 +02:00
Compare commits
33 Commits
sshuttle-0
...
sshuttle-0
Author | SHA1 | Date | |
---|---|---|---|
3cf5002b62 | |||
f71704f54d | |||
ad83059da8 | |||
d211fc28ee | |||
f4dac68dc0 | |||
3a73520310 | |||
e127aab776 | |||
5f90ee1f04 | |||
d70b5f2b89 | |||
3f2de26f67 | |||
53d5260f8f | |||
f870ceba00 | |||
a38963301e | |||
bbd54e150d | |||
00f20657e3 | |||
84b30be904 | |||
5825dddb02 | |||
9eced8d049 | |||
fecb53413d | |||
1b1ed4d495 | |||
b19272a67a | |||
bc2a0b7fbc | |||
6a96ace497 | |||
163aab2ca1 | |||
964977220e | |||
db67834164 | |||
1bc2f84d16 | |||
a229fc020c | |||
d6e7a9b6ad | |||
e6ca7148fa | |||
95529a5137 | |||
93c4af6fc8 | |||
2ca9aaa450 |
14
README.md
14
README.md
@ -13,10 +13,16 @@ Required Software
|
|||||||
|
|
||||||
- You need PyXAPI, available here:
|
- You need PyXAPI, available here:
|
||||||
http://www.pps.univ-paris-diderot.fr/~ylg/PyXAPI/
|
http://www.pps.univ-paris-diderot.fr/~ylg/PyXAPI/
|
||||||
- You also need autossh, available in various package management systems
|
|
||||||
- Python 2.x, both locally and the remote system
|
- Python 2.x, both locally and the remote system
|
||||||
|
|
||||||
|
|
||||||
|
Additional Suggested Software
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
|
- You may want to need autossh, available in various package management
|
||||||
|
systems
|
||||||
|
|
||||||
|
|
||||||
sshuttle: where transparent proxy meets VPN meets ssh
|
sshuttle: where transparent proxy meets VPN meets ssh
|
||||||
=====================================================
|
=====================================================
|
||||||
|
|
||||||
@ -87,15 +93,15 @@ Usage on (Ubuntu) Linux
|
|||||||
Usage on other Linuxes and OSes
|
Usage on other Linuxes and OSes
|
||||||
-------------------------------
|
-------------------------------
|
||||||
|
|
||||||
<tt>./sshuttle -r username@sshserver 0.0.0.0/0 -vv</tt>
|
<tt>src/sshuttle -r username@sshserver 0.0.0.0/0 -vv</tt>
|
||||||
|
|
||||||
- There is a shortcut for 0.0.0.0/0 for those that value
|
- There is a shortcut for 0.0.0.0/0 for those that value
|
||||||
their wrists
|
their wrists
|
||||||
<tt>./sshuttle -r username@sshserver 0/0 -vv</tt>
|
<tt>src/sshuttle -r username@sshserver 0/0 -vv</tt>
|
||||||
|
|
||||||
- If you would also like your DNS queries to be proxied
|
- If you would also like your DNS queries to be proxied
|
||||||
through the DNS server of the server you are connect to:
|
through the DNS server of the server you are connect to:
|
||||||
<tt>./sshuttle --dns -vvr username@sshserver 0/0</tt>
|
<tt>src/sshuttle --dns -vvr username@sshserver 0/0</tt>
|
||||||
|
|
||||||
The above is probably what you want to use to prevent
|
The above is probably what you want to use to prevent
|
||||||
local network attacks such as Firesheep and friends.
|
local network attacks such as Firesheep and friends.
|
||||||
|
@ -1,14 +1,16 @@
|
|||||||
Package: sshuttle
|
Package: sshuttle
|
||||||
Version: 0.2
|
Version: 0+git
|
||||||
Architecture: i386
|
Architecture: all
|
||||||
Maintainer: Jim Wyllie <jwyllie83@gmail.com>
|
Maintainer: Jim Wyllie <jwyllie83@gmail.com>
|
||||||
Depends: autossh, upstart, python (>=2.6)
|
Depends: iptables, python (>= 2.6)
|
||||||
Section: utils
|
Suggests: autossh
|
||||||
|
Section: net
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Homepage: http://github.com/jwyllie83/sshuttle.udp
|
Homepage: http://github.com/sshuttle/sshuttle
|
||||||
Description: "Full-featured" VPN over an SSH tunnel, allowing full remote
|
Description: "Full-featured" VPN over an SSH tunnel
|
||||||
access somewhere where all you have is an SSH connection. It works well if
|
It allows full remote access somewhere where all you have is an SSH
|
||||||
you generally find yourself in the following situation:
|
connection. It works well if you generally find yourself in the
|
||||||
|
following situation:
|
||||||
.
|
.
|
||||||
- Your client machine (or router) is Linux, FreeBSD, or MacOS.
|
- Your client machine (or router) is Linux, FreeBSD, or MacOS.
|
||||||
- You have access to a remote network via ssh.
|
- You have access to a remote network via ssh.
|
||||||
@ -22,5 +24,5 @@ Description: "Full-featured" VPN over an SSH tunnel, allowing full remote
|
|||||||
it's disabled by default on openssh servers; plus it does
|
it's disabled by default on openssh servers; plus it does
|
||||||
TCP-over-TCP, which has suboptimal performance
|
TCP-over-TCP, which has suboptimal performance
|
||||||
.
|
.
|
||||||
It also has hooks for more complicated setups (VPN-in-a-SSH-VPN, etc) to allow
|
It also has hooks for more complicated setups (VPN-in-a-SSH-VPN, etc.) to allow
|
||||||
you to set it up as you like.
|
you to set it up as you like.
|
||||||
|
@ -24,6 +24,11 @@ cp ../src/sshuttle ${B}/usr/bin
|
|||||||
cp -r sshuttle.conf ${B}/etc/init
|
cp -r sshuttle.conf ${B}/etc/init
|
||||||
cp prefixes.conf ${B}/etc/sshuttle
|
cp prefixes.conf ${B}/etc/sshuttle
|
||||||
cp tunnel.conf ${B}/etc/sshuttle
|
cp tunnel.conf ${B}/etc/sshuttle
|
||||||
|
# Remove MacOS X stuff from .deb
|
||||||
|
rm -r ${B}/usr/share/sshuttle/ui-macos
|
||||||
|
|
||||||
|
# Fix path to main.py
|
||||||
|
sed -e 's:^DIR=.*$:DIR=/usr/share/sshuttle/:' -i ${B}/usr/bin/sshuttle
|
||||||
|
|
||||||
# Copy the control file over, as well
|
# Copy the control file over, as well
|
||||||
cp control ${B}/DEBIAN
|
cp control ${B}/DEBIAN
|
||||||
|
@ -554,7 +554,7 @@ def _main(tcp_listener, udp_listener, fw, ssh_cmd, remotename,
|
|||||||
if auto_nets:
|
if auto_nets:
|
||||||
for line in routestr.strip().split('\n'):
|
for line in routestr.strip().split('\n'):
|
||||||
(family, ip, width) = line.split(',', 2)
|
(family, ip, width) = line.split(',', 2)
|
||||||
fw.auto_nets.append((family, ip, int(width)))
|
fw.auto_nets.append((int(family), ip, int(width)))
|
||||||
|
|
||||||
# we definitely want to do this *after* starting ssh, or we might end
|
# we definitely want to do this *after* starting ssh, or we might end
|
||||||
# up intercepting the ssh connection!
|
# up intercepting the ssh connection!
|
||||||
|
@ -337,7 +337,7 @@ def _handle_diversion(divertsock, dnsport):
|
|||||||
_real_dns_server[0] = dst
|
_real_dns_server[0] = dst
|
||||||
dst = ('127.0.0.1', dnsport)
|
dst = ('127.0.0.1', dnsport)
|
||||||
elif src[1] == dnsport:
|
elif src[1] == dnsport:
|
||||||
if islocal(src[0]):
|
if islocal(src[0], divertsock.family):
|
||||||
debug3('...packet is a DNS response.\n')
|
debug3('...packet is a DNS response.\n')
|
||||||
src = _real_dns_server[0]
|
src = _real_dns_server[0]
|
||||||
else:
|
else:
|
||||||
@ -490,16 +490,16 @@ def do_pf(port, dnsport, family, subnets, udp):
|
|||||||
filtering_rules = []
|
filtering_rules = []
|
||||||
|
|
||||||
if subnets:
|
if subnets:
|
||||||
include_subnets = filter(lambda s:not s[2], sorted(subnets, reverse=True))
|
includes=[]
|
||||||
if include_subnets:
|
# If a given subnet is both included and excluded, list the exclusion
|
||||||
tables.append('table <include_subnets> {%s}' % ','.join(["%s/%s" % (n[3], n[1]) for n in include_subnets]))
|
# first; the table will ignore the second, opposite definition
|
||||||
translating_rules.append('rdr pass on lo0 proto tcp to <include_subnets> -> 127.0.0.1 port %r' % port)
|
for f, swidth, sexclude, snet \
|
||||||
filtering_rules.append('pass out route-to lo0 inet proto tcp to <include_subnets> keep state')
|
in sorted(subnets, key=lambda s: (s[1], s[2]), reverse=True):
|
||||||
|
includes.append("%s%s/%s" % ("!" if sexclude else "", snet, swidth))
|
||||||
|
|
||||||
exclude_subnets = filter(lambda s:s[2], sorted(subnets, reverse=True))
|
tables.append('table <forward_subnets> {%s}' % ','.join(includes))
|
||||||
if exclude_subnets:
|
translating_rules.append('rdr pass on lo0 proto tcp to <forward_subnets> -> 127.0.0.1 port %r' % port)
|
||||||
tables.append('table <exclude_subnets> {%s}' % ','.join(["%s/%s" % (n[3], n[1]) for n in exclude_subnets]))
|
filtering_rules.append('pass out route-to lo0 inet proto tcp to <forward_subnets> keep state')
|
||||||
filtering_rules.append('pass out route-to lo0 inet proto tcp to <exclude_subnets> keep state')
|
|
||||||
|
|
||||||
if dnsport:
|
if dnsport:
|
||||||
nslist = resolvconf_nameservers()
|
nslist = resolvconf_nameservers()
|
||||||
|
@ -61,6 +61,8 @@ def _remove_negative_k(k):
|
|||||||
|
|
||||||
|
|
||||||
def _tty_width():
|
def _tty_width():
|
||||||
|
if not hasattr(sys.stderr, "fileno"):
|
||||||
|
return _atoi(os.environ.get('WIDTH')) or 70
|
||||||
s = struct.pack("HHHH", 0, 0, 0, 0)
|
s = struct.pack("HHHH", 0, 0, 0, 0)
|
||||||
try:
|
try:
|
||||||
import fcntl
|
import fcntl
|
||||||
|
@ -215,7 +215,6 @@ def main():
|
|||||||
helpers.logprefix = ' s: '
|
helpers.logprefix = ' s: '
|
||||||
else:
|
else:
|
||||||
helpers.logprefix = 'server: '
|
helpers.logprefix = 'server: '
|
||||||
assert latency_control is not None
|
|
||||||
debug1('latency control setting = %r\n' % latency_control)
|
debug1('latency control setting = %r\n' % latency_control)
|
||||||
|
|
||||||
routes = list(list_routes())
|
routes = list(list_routes())
|
||||||
|
BIN
src/ui-macos/ChickenErrorTemplate.pdf
Normal file
BIN
src/ui-macos/ChickenErrorTemplate.pdf
Normal file
Binary file not shown.
BIN
src/ui-macos/ChickenIdleTemplate.pdf
Normal file
BIN
src/ui-macos/ChickenIdleTemplate.pdf
Normal file
Binary file not shown.
BIN
src/ui-macos/ChickenRunningTemplate.pdf
Normal file
BIN
src/ui-macos/ChickenRunningTemplate.pdf
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 821 B |
Binary file not shown.
Before Width: | Height: | Size: 789 B |
Binary file not shown.
Before Width: | Height: | Size: 810 B |
@ -1,7 +1,21 @@
|
|||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import pty
|
import pty
|
||||||
from AppKit import *
|
from AppKit import (
|
||||||
|
objc,
|
||||||
|
NSApp,
|
||||||
|
NSApplicationMain,
|
||||||
|
NSAttributedString,
|
||||||
|
NSFileHandle,
|
||||||
|
NSFileHandleDataAvailableNotification,
|
||||||
|
NSImage,
|
||||||
|
NSMenu,
|
||||||
|
NSMenuItem,
|
||||||
|
NSNotificationCenter,
|
||||||
|
NSObject,
|
||||||
|
NSStatusBar,
|
||||||
|
NSVariableStatusItemLength,
|
||||||
|
)
|
||||||
import my
|
import my
|
||||||
import models
|
import models
|
||||||
import askpass
|
import askpass
|
||||||
@ -217,6 +231,7 @@ class SshuttleController(NSObject):
|
|||||||
|
|
||||||
@objc.IBAction
|
@objc.IBAction
|
||||||
def cmd_quit(self, sender):
|
def cmd_quit(self, sender):
|
||||||
|
NSStatusBar.systemStatusBar().removeStatusItem_(self.statusitem)
|
||||||
NSApp.performSelector_withObject_afterDelay_(NSApp.terminate_,
|
NSApp.performSelector_withObject_afterDelay_(NSApp.terminate_,
|
||||||
None, 0.0)
|
None, 0.0)
|
||||||
|
|
||||||
@ -365,11 +380,10 @@ class SshuttleController(NSObject):
|
|||||||
bar = NSStatusBar.systemStatusBar()
|
bar = NSStatusBar.systemStatusBar()
|
||||||
statusitem = bar.statusItemWithLength_(NSVariableStatusItemLength)
|
statusitem = bar.statusItemWithLength_(NSVariableStatusItemLength)
|
||||||
self.statusitem = statusitem
|
self.statusitem = statusitem
|
||||||
self.img_idle = my.Image('chicken-tiny-bw', 'png')
|
self.img_idle = NSImage.imageNamed_('ChickenIdleTemplate')
|
||||||
self.img_running = my.Image('chicken-tiny', 'png')
|
self.img_running = NSImage.imageNamed_('ChickenRunningTemplate')
|
||||||
self.img_err = my.Image('chicken-tiny-err', 'png')
|
self.img_err = NSImage.imageNamed_('ChickenErrorTemplate')
|
||||||
statusitem.setImage_(self.img_idle)
|
statusitem.setImage_(self.img_idle)
|
||||||
statusitem.setHighlightMode_(True)
|
|
||||||
statusitem.setMenu_(self.menu)
|
statusitem.setMenu_(self.menu)
|
||||||
self.fill_menu()
|
self.fill_menu()
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from AppKit import *
|
from AppKit import (objc, NSObject)
|
||||||
import my
|
import my
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
import os
|
import os
|
||||||
from AppKit import *
|
from AppKit import (
|
||||||
|
NSBundle,
|
||||||
|
NSData,
|
||||||
|
NSDictionary,
|
||||||
|
NSImage,
|
||||||
|
NSUserDefaults,
|
||||||
|
)
|
||||||
import PyObjCTools.AppHelper
|
import PyObjCTools.AppHelper
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,9 +4,9 @@ cat <<-EOF
|
|||||||
app.icns
|
app.icns
|
||||||
MainMenu.nib English.lproj/MainMenu.nib
|
MainMenu.nib English.lproj/MainMenu.nib
|
||||||
UserDefaults.plist
|
UserDefaults.plist
|
||||||
chicken-tiny.png
|
ChickenIdleTemplate.pdf
|
||||||
chicken-tiny-bw.png
|
ChickenRunningTemplate.pdf
|
||||||
chicken-tiny-err.png
|
ChickenErrorTemplate.pdf
|
||||||
EOF
|
EOF
|
||||||
for d in *.py sshuttle/*.py sshuttle/sshuttle sshuttle/compat/*.py; do
|
for d in *.py sshuttle/*.py sshuttle/sshuttle sshuttle/compat/*.py; do
|
||||||
echo $d
|
echo $d
|
||||||
|
Reference in New Issue
Block a user