[or-cvs] r14582: Added the base for the soat.py scanner, external libraries u (in torflow/branches/gsoc2008: . TorCtl)

aleksei at seul.org aleksei at seul.org
Sun May 11 10:22:20 UTC 2008


Author: aleksei
Date: 2008-05-11 06:22:19 -0400 (Sun, 11 May 2008)
New Revision: 14582

Modified:
   torflow/branches/gsoc2008/TorCtl/TorCtl.py
   torflow/branches/gsoc2008/TorCtl/TorUtil.py
   torflow/branches/gsoc2008/metatroller.py
   torflow/branches/gsoc2008/statsplitter.py
Log:
Added the base for the soat.py scanner, external libraries used and a small script to get all exits for a given port

Modified: torflow/branches/gsoc2008/TorCtl/TorCtl.py
===================================================================
--- torflow/branches/gsoc2008/TorCtl/TorCtl.py	2008-05-11 03:49:14 UTC (rev 14581)
+++ torflow/branches/gsoc2008/TorCtl/TorCtl.py	2008-05-11 10:22:19 UTC (rev 14582)
@@ -248,6 +248,10 @@
     self.list_rank = 0 # position in a sorted list of routers.
     self.uptime = uptime
 
+  def __str__(self):
+    s = self.idhex, self.nickname
+    return s.__str__()
+
   def build_from_desc(desc, ns):
     """
     Static method of Router that parses a descriptor string into this class.

Modified: torflow/branches/gsoc2008/TorCtl/TorUtil.py
===================================================================
--- torflow/branches/gsoc2008/TorCtl/TorUtil.py	2008-05-11 03:49:14 UTC (rev 14581)
+++ torflow/branches/gsoc2008/TorCtl/TorUtil.py	2008-05-11 10:22:19 UTC (rev 14582)
@@ -14,6 +14,7 @@
 import binascii
 import sha
 import math
+import time
 
 __all__ = ["Enum", "Enum2", "Callable", "sort_list", "quote", "escape_dots", "unescape_dots",
       "BufSock", "secret_to_key", "urandom_rng", "s2k_gen", "s2k_check", "plog", 
@@ -199,7 +200,8 @@
 
 def plog(level, msg): # XXX: Timestamps
   if(loglevels[level] >= loglevels[loglevel]):
-    print level + ": " + msg
+    t = time.strftime("%a %b %d %H:%M:%S %Y")
+    print level, '[', t, ']:', msg
     sys.stdout.flush()
 
 # Stolen from

Modified: torflow/branches/gsoc2008/metatroller.py
===================================================================
--- torflow/branches/gsoc2008/metatroller.py	2008-05-11 03:49:14 UTC (rev 14581)
+++ torflow/branches/gsoc2008/metatroller.py	2008-05-11 10:22:19 UTC (rev 14582)
@@ -32,7 +32,7 @@
 
 # TODO: Move these to config file
 control_host = "127.0.0.1"
-control_port = 9061
+control_port = 9051
 meta_host = "127.0.0.1"
 meta_port = 9052
 max_detach = 3

Modified: torflow/branches/gsoc2008/statsplitter.py
===================================================================
--- torflow/branches/gsoc2008/statsplitter.py	2008-05-11 03:49:14 UTC (rev 14581)
+++ torflow/branches/gsoc2008/statsplitter.py	2008-05-11 10:22:19 UTC (rev 14582)
@@ -10,7 +10,7 @@
 TorUtil.loglevel = "NOTICE"
 
 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-s.connect(("127.0.0.1",9061))
+s.connect(("127.0.0.1",9051))
 c = Connection(s)
 c.debug(file("control.log", "w"))
 c.authenticate()



More information about the tor-commits mailing list