Changeset 5713
- Timestamp:
- 07/06/10 02:33:39 (3 years ago)
- Location:
- zion/trunk/umit
- Files:
-
- 2 modified
-
scan/zion/gui/ZionScanNotebookPage.py (modified) (5 diffs)
-
zion/core/zion.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
zion/trunk/umit/scan/zion/gui/ZionScanNotebookPage.py
r5705 r5713 162 162 text=1) 163 163 164 self.__hosts_store.append([PIXBUF_FIREWALL,164 """self.__hosts_store.append([PIXBUF_FIREWALL, 165 165 'firewall.example.com\n192.0.2.1']) 166 166 self.__hosts_store.append([PIXBUF_SYNPROXY, 167 167 'synproxy.example.com\n192.0.2.2']) 168 168 self.__hosts_store.append([PIXBUF_HONEYD, 169 'honeyd.example.com\n192.0.2.3']) 169 'honeyd.example.com\n192.0.2.3'])""" 170 170 171 171 self.__column_type.set_reorderable(True) … … 189 189 """ 190 190 path = widget.get_cursor()[0] 191 iter = self.__hosts_store.get_iter(path) 192 self.__hosts_store.get_value(iter, 0) 191 if len(self.__hosts_store)>0: 192 iter = self.__hosts_store.get_iter(path) 193 self.__hosts_store.get_value(iter, 0) 193 194 194 195 def __sort_type(self, treemodel, iter1, iter2): … … 201 202 """ 202 203 return 0 204 205 def clear_hosts(self): 206 """ 207 """ 208 self.__hosts_store = gtk.ListStore(gtk.gdk.Pixbuf, 209 gobject.TYPE_STRING) 210 211 def add_host(self, name, host_type=None): 212 """ 213 """ 214 self.__hosts_store.append([host_type,name]) 203 215 204 216 class ZionResultsPage(gtk.HPaned): … … 254 266 """ 255 267 return self.__view 268 269 def get_hosts_list(self): 270 """ 271 """ 272 return self.__list 256 273 257 274 class ZionProfile(HIGVBox): … … 288 305 """ 289 306 ZionProfile.__init__(self, target) 307 308 def start(self): 309 """ 310 """ 311 z = zion.Zion(options.Options(), []) 312 313 self.result.get_hosts_list().clear_hosts() 314 targets = [] 315 316 if address.recognize(self.target) == address.Unknown: 317 l = probe.get_addr_from_name(self.target) 318 for i in l: 319 try: 320 targets.append(host.Host(i, self.target)) 321 host_str = '%s\n%s' % (i, self.target) 322 self.result.get_hosts_list().add_host(host_str, PIXBUF_FIREWALL) 323 except: 324 print "Unimplemented support to address: %s." % i 325 else: 326 targets.append(host.Host(self.target)) 327 self.result.get_hosts_list().add_host(i, PIXBUF_FIREWALL) 328 329 z.get_option_object().add("-c","wlan0") 330 z.get_option_object().add("--forge-addr","192.168.1.2") 331 332 """for target in targets: 333 if z.honeyd_detection(target): 334 print 'target is honeyd' 335 else: 336 print 'target isnt honeyd'""" 290 337 291 338 -
zion/trunk/umit/zion/core/zion.py
r5709 r5713 25 25 from math import sqrt 26 26 27 from umit.clann import som 27 from umit.clann import som, matrix 28 28 from umit.zion.core import options, host 29 29 from umit.zion.scan import sniff, portscan, forge … … 32 32 AMOUNT_OS_DETECTION = 2000 33 33 AMOUNT_HONEYD_DETECTION = 25 34 SEND_INTERVAL = 0. 0234 SEND_INTERVAL = 0.1 35 35 36 36 class Zion(object): … … 203 203 204 204 print 'Creating attractors' 205 self.__som = som.new(10,(30,30))206 205 self.__classification(Rt) 207 206 … … 291 290 self.__attractors = [] 292 291 292 # normalize results 293 max_val = max(Rt) 294 min_val = min(Rt) 295 ratio = 2/(max_val-min_val) 296 297 self.__som = som.new(10,(30,30)) 298 self.__matrix = matrix.new(len(Rt)-1,2) 299 293 300 for i in range(len(Rt)-1): 294 self.__attractors.append((Rt[i+1],Rt[i])) 295 301 x = (Rt[i+1]-min_val)*ratio-1 302 y = (Rt[i]-min_val)*ratio-1 303 self.__attractors.append((x, y)) 304 matrix.set(self.__matrix, i, 0, x) 305 matrix.set(self.__matrix, i, 1, y) 306 296 307 # TODO: confirm how train works 297 #som.train(self.__som,matrix, 1800)308 som.train(self.__som, self.__matrix, 1800) 298 309 299 310
