Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sshuttle
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pub
sshuttle
Commits
5b57de24
Commit
5b57de24
authored
May 03, 2011
by
Avery Pennarun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MacOS precompiled app package for sshuttle-0.53
parent
cde95218
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
75 additions
and
17 deletions
+75
-17
Sshuttle
Sshuttle VPN.app/Contents/MacOS/Sshuttle
+0
-0
MainMenu.nib
...tle VPN.app/Contents/Resources/English.lproj/MainMenu.nib
+0
-0
askpass.pyc
Sshuttle VPN.app/Contents/Resources/askpass.pyc
+0
-0
models.pyc
Sshuttle VPN.app/Contents/Resources/models.pyc
+0
-0
my.pyc
Sshuttle VPN.app/Contents/Resources/my.pyc
+0
-0
client.py
Sshuttle VPN.app/Contents/Resources/sshuttle/client.py
+7
-0
server.py
Sshuttle VPN.app/Contents/Resources/sshuttle/server.py
+36
-8
ssh.py
Sshuttle VPN.app/Contents/Resources/sshuttle/ssh.py
+1
-1
sshuttle
Sshuttle VPN.app/Contents/Resources/sshuttle/sshuttle
+6
-1
ssnet.py
Sshuttle VPN.app/Contents/Resources/sshuttle/ssnet.py
+25
-7
No files found.
Sshuttle VPN.app/Contents/MacOS/Sshuttle
View file @
5b57de24
No preview for this file type
Sshuttle VPN.app/Contents/Resources/English.lproj/MainMenu.nib
View file @
5b57de24
No preview for this file type
Sshuttle VPN.app/Contents/Resources/askpass.pyc
0 → 100644
View file @
5b57de24
File added
Sshuttle VPN.app/Contents/Resources/models.pyc
0 → 100644
View file @
5b57de24
File added
Sshuttle VPN.app/Contents/Resources/my.pyc
0 → 100644
View file @
5b57de24
File added
Sshuttle VPN.app/Contents/Resources/sshuttle/client.py
View file @
5b57de24
...
@@ -198,7 +198,14 @@ def _main(listener, fw, ssh_cmd, remotename, python, latency_control,
...
@@ -198,7 +198,14 @@ def _main(listener, fw, ssh_cmd, remotename, python, latency_control,
handlers
.
append
(
mux
)
handlers
.
append
(
mux
)
expected
=
'SSHUTTLE0001'
expected
=
'SSHUTTLE0001'
try
:
try
:
v
=
'x'
while
v
and
v
!=
'
\0
'
:
v
=
serversock
.
recv
(
1
)
v
=
'x'
while
v
and
v
!=
'
\0
'
:
v
=
serversock
.
recv
(
1
)
initstring
=
serversock
.
recv
(
len
(
expected
))
initstring
=
serversock
.
recv
(
len
(
expected
))
except
socket
.
error
,
e
:
except
socket
.
error
,
e
:
if
e
.
args
[
0
]
==
errno
.
ECONNRESET
:
if
e
.
args
[
0
]
==
errno
.
ECONNRESET
:
...
...
Sshuttle VPN.app/Contents/Resources/sshuttle/server.py
View file @
5b57de24
...
@@ -110,23 +110,51 @@ class DnsProxy(Handler):
...
@@ -110,23 +110,51 @@ class DnsProxy(Handler):
def
__init__
(
self
,
mux
,
chan
,
request
):
def
__init__
(
self
,
mux
,
chan
,
request
):
sock
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_DGRAM
)
sock
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_DGRAM
)
Handler
.
__init__
(
self
,
[
sock
])
Handler
.
__init__
(
self
,
[
sock
])
self
.
sock
=
sock
self
.
timeout
=
time
.
time
()
+
30
self
.
timeout
=
time
.
time
()
+
30
self
.
mux
=
mux
self
.
mux
=
mux
self
.
chan
=
chan
self
.
chan
=
chan
self
.
tries
=
0
self
.
peer
=
None
self
.
request
=
request
self
.
sock
=
sock
self
.
sock
.
setsockopt
(
socket
.
SOL_IP
,
socket
.
IP_TTL
,
42
)
self
.
sock
.
setsockopt
(
socket
.
SOL_IP
,
socket
.
IP_TTL
,
42
)
self
.
sock
.
connect
((
resolvconf_random_nameserver
(),
53
))
self
.
try_send
()
self
.
sock
.
send
(
request
)
def
try_send
(
self
):
if
self
.
tries
>=
3
:
return
self
.
tries
+=
1
self
.
peer
=
resolvconf_random_nameserver
()
self
.
sock
.
connect
((
self
.
peer
,
53
))
debug2
(
'DNS: sending to
%
r
\n
'
%
self
.
peer
)
try
:
self
.
sock
.
send
(
self
.
request
)
except
socket
.
error
,
e
:
if
e
.
args
[
0
]
in
ssnet
.
NET_ERRS
:
# might have been spurious; try again.
# Note: these errors sometimes are reported by recv(),
# and sometimes by send(). We have to catch both.
debug2
(
'DNS send to
%
r:
%
s
\n
'
%
(
self
.
peer
,
e
))
self
.
try_send
()
return
else
:
log
(
'DNS send to
%
r:
%
s
\n
'
%
(
self
.
peer
,
e
))
return
def
callback
(
self
):
def
callback
(
self
):
try
:
try
:
data
=
self
.
sock
.
recv
(
4096
)
data
=
self
.
sock
.
recv
(
4096
)
except
socket
.
error
,
e
:
except
socket
.
error
,
e
:
if
e
.
args
[
0
]
==
errno
.
ECONNREFUSED
:
if
e
.
args
[
0
]
in
ssnet
.
NET_ERRS
:
debug2
(
'DNS response: ignoring ECONNREFUSED.
\n
'
)
# might have been spurious; try again.
return
# might have been spurious; wait for a real answer
# Note: these errors sometimes are reported by recv(),
# and sometimes by send(). We have to catch both.
debug2
(
'DNS recv from
%
r:
%
s
\n
'
%
(
self
.
peer
,
e
))
self
.
try_send
()
return
else
:
else
:
raise
log
(
'DNS recv from
%
r:
%
s
\n
'
%
(
self
.
peer
,
e
))
return
debug2
(
'DNS response:
%
d bytes
\n
'
%
len
(
data
))
debug2
(
'DNS response:
%
d bytes
\n
'
%
len
(
data
))
self
.
mux
.
send
(
self
.
chan
,
ssnet
.
CMD_DNS_RESPONSE
,
data
)
self
.
mux
.
send
(
self
.
chan
,
ssnet
.
CMD_DNS_RESPONSE
,
data
)
self
.
ok
=
False
self
.
ok
=
False
...
@@ -145,7 +173,7 @@ def main():
...
@@ -145,7 +173,7 @@ def main():
debug1
(
'
%
s/
%
d
\n
'
%
r
)
debug1
(
'
%
s/
%
d
\n
'
%
r
)
# synchronization header
# synchronization header
sys
.
stdout
.
write
(
'SSHUTTLE0001'
)
sys
.
stdout
.
write
(
'
\0\0
SSHUTTLE0001'
)
sys
.
stdout
.
flush
()
sys
.
stdout
.
flush
()
handlers
=
[]
handlers
=
[]
...
...
Sshuttle VPN.app/Contents/Resources/sshuttle/ssh.py
View file @
5b57de24
...
@@ -85,7 +85,7 @@ def connect(ssh_cmd, rhostport, python, stderr, options):
...
@@ -85,7 +85,7 @@ def connect(ssh_cmd, rhostport, python, stderr, options):
pycmd
=
"'
%
s' -c '
%
s'"
%
(
python
,
pyscript
)
pycmd
=
"'
%
s' -c '
%
s'"
%
(
python
,
pyscript
)
else
:
else
:
pycmd
=
(
"P=python2; $P -V 2>/dev/null || P=python; "
pycmd
=
(
"P=python2; $P -V 2>/dev/null || P=python; "
"
\"
$P
\"
-c '
%
s'"
)
%
pyscript
"
exec
\"
$P
\"
-c '
%
s'"
)
%
pyscript
argv
=
(
sshl
+
argv
=
(
sshl
+
portl
+
portl
+
ipv6flag
+
ipv6flag
+
...
...
Sshuttle VPN.app/Contents/Resources/sshuttle/sshuttle
View file @
5b57de24
#!/bin/sh
#!/bin/sh
DIR
=
$(
dirname
"
$0
"
)
EXE
=
$0
for
i
in
1 2 3 4 5 6 7 8 9 10
;
do
[
-L
"
$EXE
"
]
||
break
EXE
=
$(
readlink
"
$EXE
"
)
done
DIR
=
$(
dirname
"
$EXE
"
)
if
python2
-V
2>/dev/null
;
then
if
python2
-V
2>/dev/null
;
then
exec
python2
"
$DIR
/main.py"
python2
"
$@
"
exec
python2
"
$DIR
/main.py"
python2
"
$@
"
else
else
...
...
Sshuttle VPN.app/Contents/Resources/sshuttle/ssnet.py
View file @
5b57de24
...
@@ -40,7 +40,11 @@ cmd_to_name = {
...
@@ -40,7 +40,11 @@ cmd_to_name = {
CMD_DNS_REQ
:
'DNS_REQ'
,
CMD_DNS_REQ
:
'DNS_REQ'
,
CMD_DNS_RESPONSE
:
'DNS_RESPONSE'
,
CMD_DNS_RESPONSE
:
'DNS_RESPONSE'
,
}
}
NET_ERRS
=
[
errno
.
ECONNREFUSED
,
errno
.
ETIMEDOUT
,
errno
.
EHOSTUNREACH
,
errno
.
ENETUNREACH
,
errno
.
EHOSTDOWN
,
errno
.
ENETDOWN
]
def
_add
(
l
,
elem
):
def
_add
(
l
,
elem
):
...
@@ -86,7 +90,7 @@ class SockWrapper:
...
@@ -86,7 +90,7 @@ class SockWrapper:
def
__init__
(
self
,
rsock
,
wsock
,
connect_to
=
None
,
peername
=
None
):
def
__init__
(
self
,
rsock
,
wsock
,
connect_to
=
None
,
peername
=
None
):
global
_swcount
global
_swcount
_swcount
+=
1
_swcount
+=
1
debug3
(
'creating new SockWrapper (
%
d now exist
\n
)
'
%
_swcount
)
debug3
(
'creating new SockWrapper (
%
d now exist
)
\n
'
%
_swcount
)
self
.
exc
=
None
self
.
exc
=
None
self
.
rsock
=
rsock
self
.
rsock
=
rsock
self
.
wsock
=
wsock
self
.
wsock
=
wsock
...
@@ -101,7 +105,7 @@ class SockWrapper:
...
@@ -101,7 +105,7 @@ class SockWrapper:
_swcount
-=
1
_swcount
-=
1
debug1
(
'
%
r: deleting (
%
d remain)
\n
'
%
(
self
,
_swcount
))
debug1
(
'
%
r: deleting (
%
d remain)
\n
'
%
(
self
,
_swcount
))
if
self
.
exc
:
if
self
.
exc
:
debug1
(
'
%
r: error was:
%
r
\n
'
%
(
self
,
self
.
exc
))
debug1
(
'
%
r: error was:
%
s
\n
'
%
(
self
,
self
.
exc
))
def
__repr__
(
self
):
def
__repr__
(
self
):
if
self
.
rsock
==
self
.
wsock
:
if
self
.
rsock
==
self
.
wsock
:
...
@@ -124,20 +128,34 @@ class SockWrapper:
...
@@ -124,20 +128,34 @@ class SockWrapper:
return
# already connected
return
# already connected
self
.
rsock
.
setblocking
(
False
)
self
.
rsock
.
setblocking
(
False
)
debug3
(
'
%
r: trying connect to
%
r
\n
'
%
(
self
,
self
.
connect_to
))
debug3
(
'
%
r: trying connect to
%
r
\n
'
%
(
self
,
self
.
connect_to
))
if
socket
.
inet_aton
(
self
.
connect_to
[
0
])[
0
]
==
'
\0
'
:
self
.
seterr
(
Exception
(
"Can't connect to
%
r: "
"IP address starts with zero
\n
"
%
(
self
.
connect_to
,)))
self
.
connect_to
=
None
return
try
:
try
:
self
.
rsock
.
connect
(
self
.
connect_to
)
self
.
rsock
.
connect
(
self
.
connect_to
)
# connected successfully (Linux)
# connected successfully (Linux)
self
.
connect_to
=
None
self
.
connect_to
=
None
except
socket
.
error
,
e
:
except
socket
.
error
,
e
:
debug3
(
'
%
r: connect result:
%
r
\n
'
%
(
self
,
e
))
debug3
(
'
%
r: connect result:
%
s
\n
'
%
(
self
,
e
))
if
e
.
args
[
0
]
==
errno
.
EINVAL
:
# this is what happens when you call connect() on a socket
# that is now connected but returned EINPROGRESS last time,
# on BSD, on python pre-2.5.1. We need to use getsockopt()
# to get the "real" error. Later pythons do this
# automatically, so this code won't run.
realerr
=
self
.
rsock
.
getsockopt
(
socket
.
SOL_SOCKET
,
socket
.
SO_ERROR
)
e
=
socket
.
error
(
realerr
,
os
.
strerror
(
realerr
))
debug3
(
'
%
r: fixed connect result:
%
s
\n
'
%
(
self
,
e
))
if
e
.
args
[
0
]
in
[
errno
.
EINPROGRESS
,
errno
.
EALREADY
]:
if
e
.
args
[
0
]
in
[
errno
.
EINPROGRESS
,
errno
.
EALREADY
]:
pass
# not connected yet
pass
# not connected yet
elif
e
.
args
[
0
]
==
errno
.
EISCONN
:
elif
e
.
args
[
0
]
==
errno
.
EISCONN
:
# connected successfully (BSD)
# connected successfully (BSD)
self
.
connect_to
=
None
self
.
connect_to
=
None
elif
e
.
args
[
0
]
in
[
errno
.
ECONNREFUSED
,
errno
.
ETIMEDOUT
,
elif
e
.
args
[
0
]
in
NET_ERRS
+
[
errno
.
EACCES
,
errno
.
EPERM
]:
errno
.
EHOSTUNREACH
,
errno
.
ENETUNREACH
,
errno
.
EACCES
,
errno
.
EPERM
]:
# a "normal" kind of error
# a "normal" kind of error
self
.
connect_to
=
None
self
.
connect_to
=
None
self
.
seterr
(
e
)
self
.
seterr
(
e
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment