iwla

iwla Commit Details

Date:2016-01-02 11:50:31 (5 years 7 months ago)
Author:Grégory Soutadé
Branch:dev, master
Commit:73e4b0d8a615ada0cf854200700217322ec03939
Parents: 0bc832f87caf3654f4102a7e737a9a9964ab2df8
Message:Dont count 'uri' and 'uri/' as differents uri

Changes:
MChangeLog (2 diffs)
Miwla.py (4 diffs)

File differences

ChangeLog
1
1
22
33
44
......
2121
2222
2323
24
2425
2526
2627
v0.3 (13/07/2015)
v0.3 (20/12/2015)
** User **
Add referers_diff display plugin
Add year statistics in month details
Sort documentation output
Add debug traces in robots plugin
Update awstats data
Dont count 'uri' and 'uri/' as differents uri
** Bugs **
Forgot <body> tag
iwla.py
148148
149149
150150
151
151152
152153
153154
......
334335
335336
336337
338
339
340
341
342
343
344
345
346
347
337348
338349
339350
......
344355
345356
346357
347
358
348359
349
360
361
362
350363
351364
352365
......
354367
355368
356369
357
370
358371
359372
360373
self.log_re = re.compile(self.log_format_extracted)
self.uri_re = re.compile(r'(?P<extract_uri>[^\?#]+)(\?(?P<extract_parameters>[^#]+))?(#.*)?')
self.domain_name_re = re.compile(r'.*%s' % conf.domain_name)
self.normalize_uri_final_slashes = re.compile(r'/+$')
self.plugins = [(conf.PRE_HOOK_DIRECTORY , conf.pre_analysis_hooks),
(conf.POST_HOOK_DIRECTORY , conf.post_analysis_hooks),
(conf.DISPLAY_HOOK_DIRECTORY , conf.display_hooks)]
super_hit['robot'] = False
super_hit['hit_only'] = 0
def _normalizeURI(self, uri):
if uri == '/': return uri
uri = self.normalize_uri_final_slashes.sub('', uri)
return uri
def _normalizeParameters(self, parameters):
# No parameters
if parameters == '?': return None
return parameters
def _decodeHTTPRequest(self, hit):
if not 'request' in hit.keys(): return False
uri_groups = self.uri_re.match(hit['extract_request']['http_uri'])
if uri_groups:
d = uri_groups.groupdict()
hit['extract_request']['extract_uri'] = d['extract_uri']
hit['extract_request']['extract_uri'] = self._normalizeURI(d['extract_uri'])
if 'extract_parameters' in d.keys():
hit['extract_request']['extract_parameters'] = d['extract_parameters']
parameters = self._normalizeParameters(d['extract_parameters'])
if parameters:
hit['extract_request']['extract_parameters'] = parameters
else:
self.logger.warning("Bad request extraction %s" % (hit['request']))
return False
if hit['http_referer']:
referer_groups = self.uri_re.match(hit['http_referer'])
if referer_groups:
hit['extract_referer'] = referer_groups.groupdict()
hit['extract_referer'] = self._normalizeURI(referer_groups.groupdict())
return True
def _decodeTime(self, hit):

Archive Download the corresponding diff file

Branches

Tags