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
47030e84
Commit
47030e84
authored
Nov 07, 2017
by
vieira
Committed by
Brian May
Nov 08, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove trailing whitespaces
parent
416636fa
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
11 deletions
+11
-11
ipfw.py
sshuttle/methods/ipfw.py
+7
-7
sdnotify.py
sshuttle/sdnotify.py
+1
-1
test_firewall.py
sshuttle/tests/client/test_firewall.py
+1
-1
test_methods_pf.py
sshuttle/tests/client/test_methods_pf.py
+1
-1
test_methods_tproxy.py
sshuttle/tests/client/test_methods_tproxy.py
+1
-1
No files found.
sshuttle/methods/ipfw.py
View file @
47030e84
...
...
@@ -150,17 +150,17 @@ def ipfw_noexit(*args):
ssubprocess
.
call
(
argv
)
class
Method
(
BaseMethod
):
def
get_supported_features
(
self
):
result
=
super
(
Method
,
self
)
.
get_supported_features
()
result
.
ipv6
=
False
result
.
udp
=
False
#NOTE: Almost there, kernel patch needed
result
.
dns
=
True
return
result
def
get_tcp_dstip
(
self
,
sock
):
return
sock
.
getsockname
()
def
recv_udp
(
self
,
udp_listener
,
bufsize
):
srcip
,
dstip
,
data
=
recv_udp
(
udp_listener
,
bufsize
)
if
not
dstip
:
...
...
@@ -199,7 +199,7 @@ class Method(BaseMethod):
raise
Exception
(
'Address family "
%
s" unsupported by ipfw method_name'
%
family_to_string
(
family
))
#XXX: Any risk from this?
ipfw_noexit
(
'delete'
,
'1'
)
...
...
@@ -207,13 +207,13 @@ class Method(BaseMethod):
name
=
_changedctls
.
pop
()
oldval
=
_oldctls
[
name
]
_sysctl_set
(
name
,
oldval
)
if
subnets
or
dnsport
:
sysctl_set
(
'net.inet.ip.fw.enable'
,
1
)
ipfw
(
'add'
,
'1'
,
'check-state'
,
'ip'
,
'from'
,
'any'
,
'to'
,
'any'
)
ipfw
(
'add'
,
'1'
,
'skipto'
,
'2'
,
'tcp'
,
'from'
,
'any'
,
'to'
,
'table(125)'
)
...
...
sshuttle/sdnotify.py
View file @
47030e84
...
...
@@ -9,7 +9,7 @@ def _notify(message):
return
False
addr
=
'
\0
'
+
addr
[
1
:]
if
addr
[
0
]
==
'@'
else
addr
try
:
sock
=
socket
.
socket
(
socket
.
AF_UNIX
,
socket
.
SOCK_DGRAM
)
except
(
OSError
,
IOError
)
as
e
:
...
...
sshuttle/tests/client/test_firewall.py
View file @
47030e84
...
...
@@ -84,7 +84,7 @@ def test_subnet_weight():
(
socket
.
AF_INET
,
16
,
0
,
'192.168.0.0'
,
0
,
0
),
(
socket
.
AF_INET
,
0
,
1
,
'0.0.0.0'
,
0
,
0
)
]
assert
subnets_sorted
==
\
sorted
(
subnets
,
key
=
sshuttle
.
firewall
.
subnet_weight
,
reverse
=
True
)
...
...
sshuttle/tests/client/test_methods_pf.py
View file @
47030e84
...
...
@@ -424,7 +424,7 @@ def test_setup_firewall_openbsd(mock_pf_get_dev, mock_ioctl, mock_pfctl):
mock_pf_get_dev
.
reset_mock
()
mock_ioctl
.
reset_mock
()
mock_pfctl
.
reset_mock
()
with
pytest
.
raises
(
Exception
)
as
excinfo
:
method
.
setup_firewall
(
1025
,
1027
,
...
...
sshuttle/tests/client/test_methods_tproxy.py
View file @
47030e84
...
...
@@ -241,7 +241,7 @@ def test_setup_firewall(mock_ipt_chain_exists, mock_ipt_ttl, mock_ipt):
'--tproxy-mark'
,
'0x1/0x1'
,
'--dest'
,
u'1.2.3.33/32'
,
'-m'
,
'udp'
,
'-p'
,
'udp'
,
'--dport'
,
'53'
,
'--on-port'
,
'1027'
),
call
(
2
,
'mangle'
,
'-A'
,
'sshuttle-m-1025'
,
'-j'
,
'RETURN'
,
'--dest'
,
u'1.2.3.66/32'
,
'-m'
,
'tcp'
,
'-p'
,
'tcp'
,
'--dest'
,
u'1.2.3.66/32'
,
'-m'
,
'tcp'
,
'-p'
,
'tcp'
,
'--dport'
,
'80:80'
),
call
(
2
,
'mangle'
,
'-A'
,
'sshuttle-t-1025'
,
'-j'
,
'RETURN'
,
'--dest'
,
u'1.2.3.66/32'
,
'-m'
,
'tcp'
,
'-p'
,
'tcp'
,
...
...
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