mirror of
https://github.com/sshuttle/sshuttle.git
synced 2025-04-21 17:58:39 +02:00
Prevent loopbacks caused by telnetting to the transproxy port directly.
This commit is contained in:
parent
dc643ccdc4
commit
651b945299
@ -135,7 +135,11 @@ def main(remotename, subnets):
|
|||||||
def onaccept():
|
def onaccept():
|
||||||
sock,srcip = listener.accept()
|
sock,srcip = listener.accept()
|
||||||
dstip = original_dst(sock)
|
dstip = original_dst(sock)
|
||||||
print 'Incoming connection from %r to %r.' % (srcip,dstip)
|
log('Incoming connection from %r to %r.\n' % (srcip,dstip))
|
||||||
|
if dstip == sock.getsockname():
|
||||||
|
log("-- ignored: that's my address!\n")
|
||||||
|
sock.close()
|
||||||
|
return
|
||||||
outsock = socket()
|
outsock = socket()
|
||||||
outsock.setsockopt(SOL_IP, IP_TTL, 42)
|
outsock.setsockopt(SOL_IP, IP_TTL, 42)
|
||||||
outsock.connect(dstip)
|
outsock.connect(dstip)
|
||||||
|
Loading…
Reference in New Issue
Block a user