[tor-bugs] #25919 [Core Tor/Stem]: Tor not generating ADDRMAP Events for Externally Resolved HTTP(S) Requests

Tor Bug Tracker & Wiki blackhole at torproject.org
Wed Apr 25 21:53:24 UTC 2018


#25919: Tor not generating ADDRMAP Events for Externally Resolved HTTP(S) Requests
--------------------------------+-----------------------------------------
     Reporter:  jparkerdiamond  |      Owner:  atagar
         Type:  defect          |     Status:  new
     Priority:  Medium          |  Milestone:
    Component:  Core Tor/Stem   |    Version:  Tor: 0.3.2.10
     Severity:  Normal          |   Keywords:  addrmap, stem, tor, tor-dns
Actual Points:                  |  Parent ID:
       Points:                  |   Reviewer:
      Sponsor:                  |
--------------------------------+-----------------------------------------
 Tor Version 0.3.2.10
 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.authenticate()
     self.controller.set_caching(False)
     #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))
     self.resources.add(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.

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


More information about the tor-bugs mailing list