iwla/plugins/post_analysis/reverse_dns.py
2014-11-21 16:57:37 +01:00

28 lines
517 B
Python

import socket
from iwla import IWLA
PLUGIN_CLASS = 'HTTP'
API_VERSION = 1
def get_plugins_infos():
infos = {
'class' : PLUGIN_CLASS,
'min_version' : API_VERSION,
'max_version' : -1
}
return infos
def load():
socket.setdefaulttimeout(0.5)
return True
def hook(iwla):
hits = iwla.getValidVisitors()
for (k, hit) in hits.items():
try:
name, _, _ = socket.gethostbyaddr(k)
hit['remote_addr'] = name
except:
pass