[tor-bugs] #34129 [Circumvention/Snowflake]: Use STUN to determine NAT behaviour of peers

Tor Bug Tracker & Wiki blackhole at torproject.org
Thu May 21 16:06:20 UTC 2020


#34129: Use STUN to determine NAT behaviour of peers
-------------------------------------+---------------------------
 Reporter:  cohosh                   |          Owner:  cohosh
     Type:  enhancement              |         Status:  assigned
 Priority:  Medium                   |      Milestone:
Component:  Circumvention/Snowflake  |        Version:
 Severity:  Normal                   |     Resolution:
 Keywords:                           |  Actual Points:
Parent ID:                           |         Points:
 Reviewer:                           |        Sponsor:  Sponsor28
-------------------------------------+---------------------------

Comment (by dcf):

 I did `apt install coturn` to use the
 [https://github.com/coturn/coturn/wiki/turnutils_stunclient
 turnutils_stunclient] program. I ran it and got the following output. I
 changed my actual IP address to `192.0.2.3`.

 {{{
 $ turnutils_stunclient -f 174.138.112.125

 ========================================
 RFC 5780 response 1
 0: IPv4. Response origin: : 10.20.0.7:3478
 0: IPv4. Other addr: : 68.183.200.83:3479
 0: IPv4. UDP reflexive addr: 192.0.2.3:32960
 }}}

 turnutils_stunclient then hangs until I ctrl-C it.

 Looking at a packet capture, there are 2 outgoing packets and 1 incoming
 packet.

 {{{
 Internet Protocol Version 4, Src: 192.168.0.2, Dst: 174.138.112.125
 User Datagram Protocol, Src Port: 32960 (32960), Dst Port: stun (3478)
 Session Traversal Utilities for NAT
     Message Type: 0x0001 (Binding Request)
         .... ...0 ...0 .... = Message Class: 0x00 Request (0)
         ..00 000. 000. 0001 = Message Method: 0x0001 Binding (0x001)
         ..0. .... .... .... = Message Method Assignment: IETF Review (0x0)
     Message Length: 0
     Message Cookie: 2112a442
     Message Transaction ID: c7766860ae3304ad85de6440

 Internet Protocol Version 4, Src: 174.138.112.125, Dst: 192.168.0.2
 User Datagram Protocol, Src Port: stun (3478), Dst Port: 32960 (32960)
 Session Traversal Utilities for NAT
     [Request In: 1]
     [Time: 0.123115000 seconds]
     Message Type: 0x0101 (Binding Success Response)
         .... ...1 ...0 .... = Message Class: 0x10 Success Response (2)
         ..00 000. 000. 0001 = Message Method: 0x0001 Binding (0x001)
         ..0. .... .... .... = Message Method Assignment: IETF Review (0x0)
     Message Length: 56
     Message Cookie: 2112a442
     Message Transaction ID: c7766860ae3304ad85de6440
     Attributes
         XOR-MAPPED-ADDRESS: 192.0.2.3:32960
             Attribute Type: XOR-MAPPED-ADDRESS (0x0020)
                 0... .... .... .... = Attribute Type Comprehension:
 Required (0x0)
                 .0.. .... .... .... = Attribute Type Assignment: IETF
 Review (0x0)
             Attribute Length: 8
             Reserved: 00
             Protocol Family: IPv4 (0x01)
             Port (XOR-d): a1d2
             [Port: 32960]
             IP (XOR-d): e112a641
             [IP: 192.0.2.3]
         MAPPED-ADDRESS: 192.0.2.3:32960
             Attribute Type: MAPPED-ADDRESS (0x0001)
                 0... .... .... .... = Attribute Type Comprehension:
 Required (0x0)
                 .0.. .... .... .... = Attribute Type Assignment: IETF
 Review (0x0)
             Attribute Length: 8
             Reserved: 00
             Protocol Family: IPv4 (0x01)
             Port: 32960
             IP: 192.0.2.3
         RESPONSE-ORIGIN: 10.20.0.7:3478
             Attribute Type: RESPONSE-ORIGIN (0x802b)
                 1... .... .... .... = Attribute Type Comprehension:
 Optional (0x1)
                 .0.. .... .... .... = Attribute Type Assignment: IETF
 Review (0x0)
             Attribute Length: 8
             Reserved: 00
             Protocol Family: IPv4 (0x01)
             Port: 3478
             IP: 10.20.0.7
         OTHER-ADDRESS: 68.183.200.83:3479
             Attribute Type: OTHER-ADDRESS (0x802c)
                 1... .... .... .... = Attribute Type Comprehension:
 Optional (0x1)
                 .0.. .... .... .... = Attribute Type Assignment: IETF
 Review (0x0)
             Attribute Length: 8
             Reserved: 00
             Protocol Family: IPv4 (0x01)
             Port: 3479
             IP: 68.183.200.83
         SOFTWARE
             Attribute Type: SOFTWARE (0x8022)
                 1... .... .... .... = Attribute Type Comprehension:
 Optional (0x1)
                 .0.. .... .... .... = Attribute Type Assignment: IETF
 Review (0x0)
             Attribute Length: 4
             Software: None

 Internet Protocol Version 4, Src: 192.168.0.2, Dst: 174.138.112.125
 User Datagram Protocol, Src Port: 32960 (32960), Dst Port: stun (3478)
 Session Traversal Utilities for NAT
     Message Type: 0x0001 (Binding Request)
         .... ...0 ...0 .... = Message Class: 0x00 Request (0)
         ..00 000. 000. 0001 = Message Method: 0x0001 Binding (0x001)
         ..0. .... .... .... = Message Method Assignment: IETF Review (0x0)
     Message Length: 16
     Message Cookie: 2112a442
     Message Transaction ID: 71532acd2efaf39f4cabcb5b
     Attributes
         XOR-RESPONSE-TARGET
             Attribute Type: XOR-RESPONSE-TARGET (0x0027)
                 0... .... .... .... = Attribute Type Comprehension:
 Required (0x0)
                 .0.. .... .... .... = Attribute Type Assignment: IETF
 Review (0x0)
             Attribute Length: 4
             Reserved: 80
             Protocol Family: Unknown (0xc1)
             Port (XOR-d): 0000
             [Port: 8466]
         CHANGE_REQUEST
             Attribute Type: CHANGE_REQUEST (0x0003)
                 0... .... .... .... = Attribute Type Comprehension:
 Required (0x0)
                 .0.. .... .... .... = Attribute Type Assignment: IETF
 Review (0x0)
             Attribute Length: 4
             .... .... .... .1.. = Change IP: Set
             .... .... .... ..1. = Change Port: Set
 }}}

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/34129#comment:7>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list