Skip to content

Commit

Permalink
Update for an Issue #13
Browse files Browse the repository at this point in the history
  • Loading branch information
stamparm committed Jan 12, 2016
1 parent 17d8877 commit ebc480d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
trails = TrailsDict()

NAME = "Maltrail"
VERSION = "0.9.24"
VERSION = "0.9.25"
SERVER_HEADER = "%s/%s" % (NAME, VERSION)
DATE_FORMAT = "%Y-%m-%d"
ROTATING_CHARS = ('\\', '|', '|', '/', '-')
Expand Down
4 changes: 2 additions & 2 deletions sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,8 @@ def _process_ip(ip_data, sec, usec):
host = tcp_data[index:tcp_data.find("\r\n", index)]
host = host.strip()
host = re.sub(r":80\Z", "", host)
if dst_ip in trails and not (host[-1].isdigit() and ':' not in host):
log_event((sec, usec, src_ip, src_port, dst_ip, dst_port, PROTO.TCP, TRAIL.IP, dst_ip, trails[dst_ip][0], trails[dst_ip][1]))
if not host.split(':')[0][-1].isdigit() and dst_ip in trails:
log_event((sec, usec, src_ip, src_port, dst_ip, dst_port, PROTO.TCP, TRAIL.IP, "%s (%s)" % (dst_ip, host.split(':')[0]), trails[dst_ip][0], trails[dst_ip][1]))
elif config.USE_HEURISTICS and config.CHECK_MISSING_HOST:
log_event((sec, usec, src_ip, src_port, dst_ip, dst_port, PROTO.TCP, TRAIL.HTTP, "%s%s" % (host, path), "suspicious http request (missing host header)", "(heuristic)"))

Expand Down

0 comments on commit ebc480d

Please sign in to comment.