Skip to content
Snippets Groups Projects
Commit cc23cb8e authored by Daniel Studený's avatar Daniel Studený
Browse files

Merge branch '1-dionaea-exeptions' into 'master'

Resolve "Dionaea exeptions"

Closes #1

See merge request !7
parents d5faeaf6 d28c107f
No related branches found
No related tags found
1 merge request!7Resolve "Dionaea exeptions"
......@@ -298,13 +298,13 @@ class LogWardenfilerHandler(ihandler):
elif af == "IP4" and self.resolve_nat:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((self.nat_host, self.nat_port))
s.sendall((','.join((src_ip, str(con.local.port))).encode("utf-8")))
s.sendall((','.join((src_ip, str(con.remote.port))).encode("utf-8")))
dst = s.recv(50).decode("utf-8")
s.close()
if dst != "NE":
dst_ip = dst
else:
logger.warn("no translation for %s:%s" % (src_ip, con.local.port))
logger.warn("no translation for %s:%s" % (src_ip, con.remote.port))
return()
elif af == "IP6" and self.reported_ipv6:
dst_ip = self.reported_ipv6
......@@ -438,7 +438,7 @@ class LogWardenfilerHandler(ihandler):
if con in self.sessions:
s = self.sessions[con]
if len(s["cmds"]):
if s.get("cmds"):
event = self._make_idea(con)
self._save_event(event)
logger.info("sending connection event from %s:%i to %s:%i" % (con.remote.host, con.remote.port, con.local.host, con.local.port))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment