Opened 4 months ago

Closed 4 months ago

#25919 closed defect (duplicate)

Tor not generating ADDRMAP Events for Externally Resolved HTTP(S) Requests

Reported by: jparkerdiamond Owned by: atagar
Priority: Medium Milestone: Tor: 0.3.2.x-final
Component: Core Tor/Tor Version: Tor:
Severity: Normal Keywords: addrmap, stem, tor, tor-dns
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


Tor Version
Stem Version 1.6.0

Previous use of Stem with Tor used to to generate ADDRMAP events that would provide which hostnames were resolved to which IP addresses. Not sure what component changed along the way, but it does not appear to generate ADDRMAP events anymore. The change was noticed a month or two ago, but I didn't run this check at every upgrade, so I don't know exactly what changed/when.

I use the following to create a Tor process and to add event listeners for ADDRMAP and STREAM events with Stem. Relevant Code:

config = {"ControlPort": "9050",
          "DataDirectory": "/some_directory",
          "MaxCircuitDirtiness": "3600",
          "SocksPort": "7000",
          "StrictNodes": "1"}

def start(self):
    self.process = stem.process.launch_tor_with_config(self.config, timeout=180, take_ownership=True)
    self.controller = stem.control.Controller.from_port(port=int(self.config['ControlPort']))
    #self.controller.add_event_listener(self.exitCheck, stem.control.EventType.STREAM)
    self.controller.add_event_listener(self.addrMap, stem.control.EventType.ADDRMAP)
    return (self.process, self.controller)

def addrMap(self,resolution):
    print("Added resolution of {0} to {1}".format(resolution.hostname,resolution.destination))

The commented line registers another listener that listens for STREAM events -- those work and are printed out. cURL and a Selenium driven browser are successfully passed through Tor (ipecho shows the expected exit IP address), but they do not generate a ADDRMAP event. Additionally, subsequent requests (via HTML events or JS, etc) from a page make it through Tor, but they receive a general server failure, which might be a separate issue.

Child Tickets

Attachments (2)

tor_curl_output.txt (905 bytes) - added by jparkerdiamond 4 months ago.
Output of cURL working through Tor
ipecho_body.txt (1.9 KB) - added by jparkerdiamond 4 months ago.
HTML Body showing IP Address of Tor Exit

Download all attachments as: .zip

Change History (4)

Changed 4 months ago by jparkerdiamond

Attachment: tor_curl_output.txt added

Output of cURL working through Tor

Changed 4 months ago by jparkerdiamond

Attachment: ipecho_body.txt added

HTML Body showing IP Address of Tor Exit

comment:1 Changed 4 months ago by atagar

Status: newneeds_information

Hi jparkerdiamond, sorry for the delay. Not spotting an obvious issue in the stem usage above. I suspect this should be directed to the tor component, but first please try reproing this via telnet. That will give the network team a better repro to work off of...

comment:2 Changed 4 months ago by teor

Component: Core Tor/StemCore Tor/Tor
Milestone: Tor: 0.3.2.x-final
Resolution: duplicate
Status: needs_informationclosed
Version: Tor:

This is a duplicate of #25617, which was broken in and is fixed in 0.3.3 and later.

Note: See TracTickets for help on using tickets.