[or-cvs] r18529: {torflow} Educate soat about requesting an exit that doesn't want to s (torflow/trunk/NetworkScanners)

mikeperry at seul.org mikeperry at seul.org
Fri Feb 13 12:00:10 UTC 2009


Author: mikeperry
Date: 2009-02-13 07:00:09 -0500 (Fri, 13 Feb 2009)
New Revision: 18529

Modified:
   torflow/trunk/NetworkScanners/README.ExitScanning
   torflow/trunk/NetworkScanners/libsoat.py
   torflow/trunk/NetworkScanners/soat.py
Log:

Educate soat about requesting an exit that doesn't want to
service a particular IP.



Modified: torflow/trunk/NetworkScanners/README.ExitScanning
===================================================================
--- torflow/trunk/NetworkScanners/README.ExitScanning	2009-02-13 11:57:23 UTC (rev 18528)
+++ torflow/trunk/NetworkScanners/README.ExitScanning	2009-02-13 12:00:09 UTC (rev 18529)
@@ -167,9 +167,9 @@
 
 Keeping the same options during a --resume is a Really Good Idea.
 
-Soat actually saves a snapshot to a unique name each time you run it, so
-you can go back in time and resume arbitrary runs by specifying their
-number:
+Soat actually saves a snapshot to a unique name each time you run it
+without --resume, so you can suspend and resume arbitrary runs by
+specifying their number:
 
 # ls ./data/soat/
 # ./soat.py --resume 2 --ssl --html --http --dnsrebind >& soat.log &

Modified: torflow/trunk/NetworkScanners/libsoat.py
===================================================================
--- torflow/trunk/NetworkScanners/libsoat.py	2009-02-13 11:57:23 UTC (rev 18528)
+++ torflow/trunk/NetworkScanners/libsoat.py	2009-02-13 12:00:09 UTC (rev 18529)
@@ -44,6 +44,7 @@
 INCONCLUSIVE_NOLOCALCONTENT = "InconclusiveNoLocalContent"
 INCONCLUSIVE_DYNAMICSSL = "InconclusiveDynamicSSL"
 INCONCLUSIVE_TORBREAKAGE = "InconclusiveTorBreakage"
+INCONCLUSIVE_NOEXIT = "InconclusiveNoExit"
 
 # Failed reasons
 FAILURE_EXITONLY = "FailureExitOnly"

Modified: torflow/trunk/NetworkScanners/soat.py
===================================================================
--- torflow/trunk/NetworkScanners/soat.py	2009-02-13 11:57:23 UTC (rev 18528)
+++ torflow/trunk/NetworkScanners/soat.py	2009-02-13 12:00:09 UTC (rev 18529)
@@ -660,11 +660,17 @@
 
     exit_node = metacon.get_exit_node()
     if exit_node == 0 or exit_node == '0' or not exit_node:
-      plog('WARN', 'We had no exit node to test, skipping to the next test.')
+      plog('NOTICE', 'We had no exit node to test, skipping to the next test.')
+      result = HttpTestResult(exit_node, address, TEST_INCONCLUSIVE,
+                              INCONCLUSIVE_NOEXIT)
+      if self.rescan_nodes: result.from_rescan = True
+      self.results.append(result)
+      datahandler.saveResult(result)
+
       # Restore cookie jars
       self.cookie_jar = orig_cookie_jar
       self.tor_cookie_jar = orig_tor_cookie_jar
-      return TEST_SUCCESS
+      return TEST_INCONCLUSIVE
 
     if pcode - (pcode % 100) != 200:
       plog("NOTICE", exit_node+" had error "+str(pcode)+" fetching content for "+address)
@@ -860,6 +866,7 @@
     self.proto = "HTML"
     self.recurse_filetypes = recurse_filetypes
     self.fetch_queue = []
+
  
   def run_test(self):
     # A single test should have a single cookie jar
@@ -901,6 +908,11 @@
     self.cookie_jar = None
     return ret_result
 
+  # FIXME: This is pretty lame.. We should change how
+  # the HTTPTest stores URLs so we don't have to do this.
+  def refill_targets(self):
+    Test.refill_targets(self)
+
   def get_targets(self):
     return self.get_search_urls('http', self.fetch_targets) 
 
@@ -1326,7 +1338,13 @@
 
     exit_node = metacon.get_exit_node()
     if not exit_node or exit_node == '0':
-      plog('WARN', 'We had no exit node to test, skipping to the next test.')
+      plog('NOTICE', 'We had no exit node to test, skipping to the next test.')
+      result = SSLTestResult(exit_node, address, ssl_file_name, 
+                              TEST_INCONCLUSIVE,
+                              INCONCLUSIVE_NOEXIT)
+      if self.rescan_nodes: result.from_rescan = True
+      self.results.append(result)
+      datahandler.saveResult(result)
       return TEST_INCONCLUSIVE
 
     if cert == -1:
@@ -1515,7 +1533,7 @@
     exit_node = metacon.get_exit_node()
     if exit_node == 0 or exit_node == '0':
       plog('INFO', 'We had no exit node to test, skipping to the next test.')
-      return TEST_SUCCESS
+      return TEST_INCONCLUSIVE
 
     # do the same for the direct connection
 
@@ -1655,7 +1673,7 @@
     exit_node = metacon.get_exit_node()
     if exit_node == 0 or exit_node == '0':
       plog('INFO', 'We had no exit node to test, skipping to the next test.')
-      return TEST_SUCCESS
+      return TEST_INCONCLUSIVE
 
     # now directly
 
@@ -1789,8 +1807,8 @@
     # check whether the test was valid at all
     exit_node = metacon.get_exit_node()
     if exit_node == 0 or exit_node == '0':
-      plog('INFO', 'We had no exit node to test, skipping to the next test.')
-      return TEST_SUCCESS
+      plog('NOTICE', 'We had no exit node to test, skipping to the next test.')
+      return TEST_INCONCLUSIVE
 
     # do the same for the direct connection
     capabilities_ok_d = None



More information about the tor-commits mailing list