From 7d89b2d89f73a3a2ba531fcfc5c240eadee47070 Mon Sep 17 00:00:00 2001 From: Scott Kuhl Date: Mon, 26 Oct 2020 15:46:01 -0400 Subject: [PATCH 1/2] Fix "DNS request from ... to None" messages. Some methods are unable to determine the destination address of DNS packets that we capture. When this happens, change the message so it just shows where the DNS requests are from. --- sshuttle/client.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sshuttle/client.py b/sshuttle/client.py index da23b7d..7f6e582 100644 --- a/sshuttle/client.py +++ b/sshuttle/client.py @@ -419,7 +419,12 @@ def ondns(listener, method, mux, handlers): if t is None: return srcip, dstip, data = t - debug1('DNS request from %r to %r: %d bytes\n' % (srcip, dstip, len(data))) + # dstip is None if we are using a method where we can't determine + # the destination IP of the DNS request that we captured from the client. + if dstip is None: + debug1('DNS request from %r: %d bytes\n' % (srcip, len(data))) + else: + debug1('DNS request from %r to %r: %d bytes\n' % (srcip, dstip, len(data))) chan = mux.next_channel() dnsreqs[chan] = now + 30 mux.send(chan, ssnet.CMD_DNS_REQ, data) From 227412e2187b5f75a1042eac31f39a84c1042bf8 Mon Sep 17 00:00:00 2001 From: Scott Kuhl Date: Wed, 4 Nov 2020 11:40:07 -0500 Subject: [PATCH 2/2] Fix long line in previous commit --- sshuttle/client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sshuttle/client.py b/sshuttle/client.py index 7f6e582..a85c126 100644 --- a/sshuttle/client.py +++ b/sshuttle/client.py @@ -424,7 +424,8 @@ def ondns(listener, method, mux, handlers): if dstip is None: debug1('DNS request from %r: %d bytes\n' % (srcip, len(data))) else: - debug1('DNS request from %r to %r: %d bytes\n' % (srcip, dstip, len(data))) + debug1('DNS request from %r to %r: %d bytes\n' % + (srcip, dstip, len(data))) chan = mux.next_channel() dnsreqs[chan] = now + 30 mux.send(chan, ssnet.CMD_DNS_REQ, data)