[or-cvs] r11564: Add a torrc and a tsocks.conf to more easily allow scanning (in torflow/trunk: . TorCtl)

mikeperry at seul.org mikeperry at seul.org
Fri Sep 21 20:20:02 UTC 2007


Author: mikeperry
Date: 2007-09-21 16:20:02 -0400 (Fri, 21 Sep 2007)
New Revision: 11564

Added:
   torflow/trunk/torrc
   torflow/trunk/tsocks.conf
Modified:
   torflow/trunk/TorCtl/TorCtl.py
   torflow/trunk/speedracer.pl
   torflow/trunk/statsplitter.py
Log:

Add a torrc and a tsocks.conf to more easily allow scanning
from a second tor instance. Workaround control port
compatibility breakage introduced by Tor 0.1.2.17's extraneous
and useless "650 OK" pseudo-event. Make statssplitter not
depend on GeoIP.



Modified: torflow/trunk/TorCtl/TorCtl.py
===================================================================
--- torflow/trunk/TorCtl/TorCtl.py	2007-09-21 20:19:38 UTC (rev 11563)
+++ torflow/trunk/TorCtl/TorCtl.py	2007-09-21 20:20:02 UTC (rev 11564)
@@ -336,11 +336,16 @@
     """DOCDOC"""
     while 1:
       (timestamp, reply) = self._eventQueue.get()
+      if reply[0][0] == "650" and reply[0][1] == "OK":
+        plog("DEBUG", "Ignoring incompatible syntactic sugar: 650 OK")
+        continue
       if reply == "CLOSE":
         return
       try:
         self._handleFn(timestamp, reply)
       except:
+        for code, msg, data in reply:
+            plog("WARN", "No event for: "+str(code)+" "+str(msg))
         self._err(sys.exc_info(), 1)
         return
 

Modified: torflow/trunk/speedracer.pl
===================================================================
--- torflow/trunk/speedracer.pl	2007-09-21 20:19:38 UTC (rev 11563)
+++ torflow/trunk/speedracer.pl	2007-09-21 20:20:02 UTC (rev 11564)
@@ -19,8 +19,8 @@
 my $URL = "http://bitter.stalin.se/torfile1"; 
 my $COUNT = 200;
 my $START_PCT = 0;
-my $STOP_PCT = 8;
-my $PCT_STEP = 4;
+my $STOP_PCT = 80;
+my $PCT_STEP = 5;
 my $DOUBLE_FETCH = 0;
 
 my $LOG_LEVEL = "DEBUG";
@@ -217,6 +217,7 @@
     delete $ENV{"HTTP_PROXY"};
     delete $ENV{"proxy"};
     delete $ENV{"PROXY"};
+    $ENV{"TSOCKS_CONF_FILE"} = "./tsocks.conf";
 
     print $mcp "GUARDNODES 0\r\n";
     $line = <$mcp>;

Modified: torflow/trunk/statsplitter.py
===================================================================
--- torflow/trunk/statsplitter.py	2007-09-21 20:19:38 UTC (rev 11563)
+++ torflow/trunk/statsplitter.py	2007-09-21 20:20:02 UTC (rev 11564)
@@ -2,13 +2,15 @@
 import sys
 import socket
 import math
-from TorCtl import *
+#from TorCtl import *
+from TorCtl import TorUtil, PathSupport, TorCtl
+from TorCtl.TorUtil import *
 from TorCtl.PathSupport import *
 
 TorUtil.loglevel = "NOTICE"
 
 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-s.connect(("127.0.0.1",9051))
+s.connect(("127.0.0.1",9061))
 c = Connection(s)
 c.debug(file("control.log", "w"))
 c.authenticate()

Added: torflow/trunk/torrc
===================================================================
--- torflow/trunk/torrc	                        (rev 0)
+++ torflow/trunk/torrc	2007-09-21 20:20:02 UTC (rev 11564)
@@ -0,0 +1,5 @@
+## Configuration file for metatroller on alternate prot
+SocksPort 9060 # what port to advertise for application connections
+ControlPort 9061
+SafeLogging 0
+Log notice stderr

Added: torflow/trunk/tsocks.conf
===================================================================
--- torflow/trunk/tsocks.conf	                        (rev 0)
+++ torflow/trunk/tsocks.conf	2007-09-21 20:20:02 UTC (rev 11564)
@@ -0,0 +1,18 @@
+# This is the configuration for libtsocks (transparent socks)
+# Lines beginning with # and blank lines are ignored
+#
+# This sample configuration shows the simplest (and most common) use of
+# tsocks. This is a basic LAN, this machine can access anything on the 
+# local ethernet (192.168.0.*) but anything else has to use the SOCKS version
+# 4 server on the firewall. Further details can be found in the man pages,
+# tsocks(8) and tsocks.conf(5) and a more complex example is presented in 
+# tsocks.conf.complex.example
+
+# We can access 192.168.0.* directly
+local = 192.168.0.0/255.255.255.0
+
+# Otherwise we use the server
+server = 127.0.0.1
+server_port = 9060
+
+



More information about the tor-commits mailing list