Compare commits

...

33 Commits

Author SHA1 Message Date
3cf5002b62 Merge pull request #19 from naclander/patch-1
Remove no-latency-control assertion
2015-09-16 13:08:23 +10:00
f71704f54d Remove no-latency-control assertion
Remove an assertion that would fail when --no-latency-control is set.
2015-09-15 19:30:34 -07:00
ad83059da8 Merge pull request #17 from elasticdog/master
Update ui-macos sources.list with new icon names
2015-09-08 12:00:50 +10:00
d211fc28ee Update ui-macos sources.list with new icon names
I looks like building the app UI for OS X has been broken since
9eced8d049
due to the sources.list.do file still referencing the old .png images.

Without this fix the build will stop at:

    do            chicken-tiny.png
    do: Users/elasticdog/sshuttle/src/ui-macos/chicken-tiny.png: no .do file
    do:         Sshuttle VPN.app: got exit code 1
    do:       Sshuttle VPN.app.zip: got exit code 1
    do:     dist: got exit code 1
    do:   ui-macos/all: got exit code 1
    do: all: got exit code 1
2015-09-07 18:22:30 -07:00
f4dac68dc0 Merge pull request #16 from prutschman/localhost_fix
Don't redirect excluded subsets of included subnets
2015-09-04 17:30:26 +10:00
3a73520310 Don't redirect excluded subsets of included subnets 2015-09-03 21:25:23 -07:00
e127aab776 Merge pull request #14 from reactormonk/patch-1
Switched the ./sshuttle to src/sshuttle
2015-07-26 11:15:56 +10:00
5f90ee1f04 Switched the ./sshuttle to src/sshuttle 2015-07-25 17:38:42 +02:00
d70b5f2b89 Merge pull request #13 from shaiay/master
Fixed issue #12
2015-07-23 08:08:09 +10:00
3f2de26f67 Fixed issue #12
family should be an integer. fixed parsing routes
2015-07-22 22:52:25 +03:00
53d5260f8f Merge pull request #11 from douglas/master
Fix the excludes rule for OS X Yosemite and OS X El Captain
2015-06-19 17:34:14 +10:00
f870ceba00 Fix the excludes rule for OS X Yosemite and OS X El Captain
Without this fix, the rdr rule is executed sending the packages that
should be excluded to the ssh tunnel.

What I did was make sure that the packages that are going to the
excluded subnets are processed first and only after that, the remaining
packages will be sent to the ssh tunnel.

Thanks Warr1024 on #openssh channel in freenode for telling me about
the quick keyword and the rest of guys in the channel who tried to help.
2015-06-18 18:09:18 -03:00
a38963301e Merge pull request #10 from jbd/patch-1
Check for fileno attribute in _tty_width function
2015-05-13 11:01:05 +10:00
jbd
bbd54e150d Check for fileno attribute in _tty_width function
When using Options parser within a unittest.TextTestRunner with buffering enabled (buffer=True), it fails with: 
AttributeError: StringIO instance has no attribute 'fileno'

This change will prevent this kind of error.
2015-05-12 16:43:38 +02:00
00f20657e3 Merge pull request #9 from scommab/patch-1
Make firewall.py use the right params for islocal
2015-05-03 14:42:23 +10:00
84b30be904 Make firewall.py use the right params for islocal 2015-05-01 23:36:08 -07:00
5825dddb02 Merge pull request #8 from nanoant/patch/osx-improvements
Patch/osx improvements
2015-04-21 09:49:18 +10:00
9eced8d049 OSX: New Retina compatible menu & app icon
This icons are using scale independent PDF template images which make menu item
icon look great on both Yosemite light & dark theme. Also adding new flatter
and higher resolution app icon.
2015-04-20 20:32:02 +02:00
fecb53413d OSX: Remove status item on application quit
This ensures application is not leaving empty status item.
2015-04-20 20:23:20 +02:00
1b1ed4d495 OSX: Improve app startup time
Importing everything (*) from AppKit takes a while, since we got 3 scripts
doing that, startup could take up to few seconds. This change makes script
import only what they need, improving startup time to fraction of second.
2015-04-20 18:53:06 +02:00
b19272a67a Merge pull request #7 from xtaran/master
Fix the most blatant issues of the generated .deb
2015-04-20 10:39:55 +10:00
bc2a0b7fbc Fix path to main.py in .deb 2015-04-18 14:46:55 +02:00
6a96ace497 autossh is not required but nice to have 2015-04-18 14:40:00 +02:00
163aab2ca1 Fix typo in long description of .deb 2015-04-18 14:31:30 +02:00
964977220e Change .deb section from utils to net 2015-04-18 14:30:35 +02:00
db67834164 Add missing dependency on iptables in the .deb 2015-04-18 14:30:30 +02:00
1bc2f84d16 Use a less confusing version for .deb packages built from git 2015-04-18 14:30:30 +02:00
a229fc020c Properly separate short and long description in .deb 2015-04-18 14:30:30 +02:00
d6e7a9b6ad Update homepage header of .deb 2015-04-18 14:30:30 +02:00
e6ca7148fa Fix formatting of versioned dependency in the .deb 2015-04-18 14:30:21 +02:00
95529a5137 Don't include MacOS X stuff in .deb 2015-04-18 14:30:21 +02:00
93c4af6fc8 There's no need to have hard dependency on a init system in the .deb
Otherwise the package is only installable on current Ubuntu releases
and neither on future Ubuntu releases (which will use systemd) nor on
Debian and other Debian derivatives (where the administrator can
decided which init system is used).
2015-04-18 14:30:16 +02:00
2ca9aaa450 The .deb is and needs to be architecture-independent 2015-04-18 14:14:33 +02:00
18 changed files with 69 additions and 35 deletions

View File

@ -13,10 +13,16 @@ Required Software
- You need PyXAPI, available here:
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
Additional Suggested Software
-----------------------------
- You may want to need autossh, available in various package management
systems
sshuttle: where transparent proxy meets VPN meets ssh
=====================================================
@ -87,15 +93,15 @@ Usage on (Ubuntu) Linux
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
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
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
local network attacks such as Firesheep and friends.

View File

@ -1,14 +1,16 @@
Package: sshuttle
Version: 0.2
Architecture: i386
Version: 0+git
Architecture: all
Maintainer: Jim Wyllie <jwyllie83@gmail.com>
Depends: autossh, upstart, python (>=2.6)
Section: utils
Depends: iptables, python (>= 2.6)
Suggests: autossh
Section: net
Priority: optional
Homepage: http://github.com/jwyllie83/sshuttle.udp
Description: "Full-featured" VPN over an SSH tunnel, allowing full remote
access somewhere where all you have is an SSH connection. It works well if
you generally find yourself in the following situation:
Homepage: http://github.com/sshuttle/sshuttle
Description: "Full-featured" VPN over an SSH tunnel
It allows full remote access somewhere where all you have is an SSH
connection. It works well if you generally find yourself in the
following situation:
.
- Your client machine (or router) is Linux, FreeBSD, or MacOS.
- 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
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.

View File

@ -24,6 +24,11 @@ cp ../src/sshuttle ${B}/usr/bin
cp -r sshuttle.conf ${B}/etc/init
cp prefixes.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
cp control ${B}/DEBIAN

View File

@ -554,7 +554,7 @@ def _main(tcp_listener, udp_listener, fw, ssh_cmd, remotename,
if auto_nets:
for line in routestr.strip().split('\n'):
(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
# up intercepting the ssh connection!

View File

@ -337,7 +337,7 @@ def _handle_diversion(divertsock, dnsport):
_real_dns_server[0] = dst
dst = ('127.0.0.1', dnsport)
elif src[1] == dnsport:
if islocal(src[0]):
if islocal(src[0], divertsock.family):
debug3('...packet is a DNS response.\n')
src = _real_dns_server[0]
else:
@ -490,16 +490,16 @@ def do_pf(port, dnsport, family, subnets, udp):
filtering_rules = []
if subnets:
include_subnets = filter(lambda s:not s[2], sorted(subnets, reverse=True))
if include_subnets:
tables.append('table <include_subnets> {%s}' % ','.join(["%s/%s" % (n[3], n[1]) for n in include_subnets]))
translating_rules.append('rdr pass on lo0 proto tcp to <include_subnets> -> 127.0.0.1 port %r' % port)
filtering_rules.append('pass out route-to lo0 inet proto tcp to <include_subnets> keep state')
includes=[]
# If a given subnet is both included and excluded, list the exclusion
# first; the table will ignore the second, opposite definition
for f, swidth, sexclude, snet \
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))
if exclude_subnets:
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 <exclude_subnets> keep state')
tables.append('table <forward_subnets> {%s}' % ','.join(includes))
translating_rules.append('rdr pass on lo0 proto tcp to <forward_subnets> -> 127.0.0.1 port %r' % port)
filtering_rules.append('pass out route-to lo0 inet proto tcp to <forward_subnets> keep state')
if dnsport:
nslist = resolvconf_nameservers()

View File

@ -61,6 +61,8 @@ def _remove_negative_k(k):
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)
try:
import fcntl

View File

@ -215,7 +215,6 @@ def main():
helpers.logprefix = ' s: '
else:
helpers.logprefix = 'server: '
assert latency_control is not None
debug1('latency control setting = %r\n' % latency_control)
routes = list(list_routes())

Binary file not shown.

Binary file not shown.

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

View File

@ -1,7 +1,21 @@
import sys
import os
import pty
from AppKit import *
from AppKit import (
objc,
NSApp,
NSApplicationMain,
NSAttributedString,
NSFileHandle,
NSFileHandleDataAvailableNotification,
NSImage,
NSMenu,
NSMenuItem,
NSNotificationCenter,
NSObject,
NSStatusBar,
NSVariableStatusItemLength,
)
import my
import models
import askpass
@ -217,6 +231,7 @@ class SshuttleController(NSObject):
@objc.IBAction
def cmd_quit(self, sender):
NSStatusBar.systemStatusBar().removeStatusItem_(self.statusitem)
NSApp.performSelector_withObject_afterDelay_(NSApp.terminate_,
None, 0.0)
@ -365,11 +380,10 @@ class SshuttleController(NSObject):
bar = NSStatusBar.systemStatusBar()
statusitem = bar.statusItemWithLength_(NSVariableStatusItemLength)
self.statusitem = statusitem
self.img_idle = my.Image('chicken-tiny-bw', 'png')
self.img_running = my.Image('chicken-tiny', 'png')
self.img_err = my.Image('chicken-tiny-err', 'png')
self.img_idle = NSImage.imageNamed_('ChickenIdleTemplate')
self.img_running = NSImage.imageNamed_('ChickenRunningTemplate')
self.img_err = NSImage.imageNamed_('ChickenErrorTemplate')
statusitem.setImage_(self.img_idle)
statusitem.setHighlightMode_(True)
statusitem.setMenu_(self.menu)
self.fill_menu()

View File

@ -1,4 +1,4 @@
from AppKit import *
from AppKit import (objc, NSObject)
import my

View File

@ -1,5 +1,11 @@
import os
from AppKit import *
from AppKit import (
NSBundle,
NSData,
NSDictionary,
NSImage,
NSUserDefaults,
)
import PyObjCTools.AppHelper

View File

@ -4,9 +4,9 @@ cat <<-EOF
app.icns
MainMenu.nib English.lproj/MainMenu.nib
UserDefaults.plist
chicken-tiny.png
chicken-tiny-bw.png
chicken-tiny-err.png
ChickenIdleTemplate.pdf
ChickenRunningTemplate.pdf
ChickenErrorTemplate.pdf
EOF
for d in *.py sshuttle/*.py sshuttle/sshuttle sshuttle/compat/*.py; do
echo $d