User Tools

Site Tools


wardriving-py

This is an old revision of the document!



Warning: Declaration of syntax_plugin_wrap_div::handle($match, $state, $pos, Doku_Handler &$handler) should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in /var/www/kucjica/emperors-wiki/lib/plugins/wrap/syntax/div.php on line 43

Warning: Declaration of syntax_plugin_wrap_div::render($mode, Doku_Renderer &$renderer, $indata) should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in /var/www/kucjica/emperors-wiki/lib/plugins/wrap/syntax/div.php on line 81

Warning: Declaration of syntax_plugin_wrap_closesection::handle($match, $state, $pos, Doku_Handler &$handler) should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in /var/www/kucjica/emperors-wiki/lib/plugins/wrap/syntax/closesection.php on line 23

Warning: Declaration of syntax_plugin_wrap_closesection::render($mode, Doku_Renderer &$renderer, $indata) should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in /var/www/kucjica/emperors-wiki/lib/plugins/wrap/syntax/closesection.php on line 29

Warning: Declaration of syntax_plugin_wrap_span::handle($match, $state, $pos, Doku_Handler &$handler) should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in /var/www/kucjica/emperors-wiki/lib/plugins/wrap/syntax/span.php on line 43

Warning: Declaration of syntax_plugin_wrap_span::render($mode, Doku_Renderer &$renderer, $indata) should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in /var/www/kucjica/emperors-wiki/lib/plugins/wrap/syntax/span.php on line 63

Warning: Declaration of syntax_plugin_gallery::handle($match, $state, $pos, &$handler) should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in /var/www/kucjica/emperors-wiki/lib/plugins/gallery/syntax.php on line 51

Warning: Declaration of syntax_plugin_gallery::render($mode, &$R, $data) should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in /var/www/kucjica/emperors-wiki/lib/plugins/gallery/syntax.php on line 147

Warning: Declaration of syntax_plugin_vshare::handle($match, $state, $pos, &$handler) should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in /var/www/kucjica/emperors-wiki/lib/plugins/vshare/syntax.php on line 47

Warning: Declaration of syntax_plugin_vshare::render($mode, &$R, $data) should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in /var/www/kucjica/emperors-wiki/lib/plugins/vshare/syntax.php on line 107

Warning: preg_match(): Compilation failed: invalid range in character class at offset 3444 in /var/www/kucjica/emperors-wiki/inc/parser/lexer.php on line 118
A PCRE internal error occured. This might be caused by a faulty plugin

====== wardriving.py ====== commented out 'Quality' because it kept returning an error <code python> #!/usr/bin/env python import subprocess import re class line_matcher: def __init__(self, regexp, handler): self.regexp = re.compile(regexp) self.handler = handler def handle_new_network(line, result, networks): # group(1) is the mac address networks.append({}) networks[-1]['Address'] = result.group(1) def handle_essid(line, result, networks): # group(1) is the essid name networks[-1]['ESSID'] = result.group(1) #def handle_quality(line, result, networks): # # group(1) is the quality value # # group(2) is probably always 100 # networks[-1]['Quality'] = result.group(1) + '/' + result.group(2) def handle_unknown(line, result, networks): # group(1) is the key, group(2) is the rest of the line networks[-1][result.group(1)] = result.group(2) if __name__ == '__main__': proc = subprocess.Popen(['/sbin/iwlist', 'wlan0', 'scan'], stdout=subprocess.PIPE) stdout, stderr = proc.communicate() lines = stdout.split('\n') networks = [] matchers = [] # catch the line 'Cell ## - Address: XX:YY:ZZ:AA:BB:CC' matchers.append(line_matcher(r'\s+Cell \d+ - Address: (\S+)', handle_new_network)) # catch the line 'ESSID:"network name" matchers.append(line_matcher(r'\s+ESSID:"([^"]+)"', handle_essid)) # catch the line 'Quality:X/Y Signal level:X dBm Noise level:Y dBm' #matchers.append(line_matcher(r'\s+Quality:(\d+)/(\d+)', </code>

wardriving-py.1344010020.txt.gz · Last modified: 2012/08/03 16:07 by 94.245.224.234