Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update http_analyzer.py #260

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions modules/http_analyzer/http_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,24 @@ def check_multiple_UAs(
timestamp, category, source_target_tag=source_target_tag, profileid=profileid,
twid=twid, uid=uid)
return True
## added
def check_large_response_body(self, uid, response_body_len, timestamp, profileid, twid):
"""
Check if the response body length is larger than the defined threshold
"""
if response_body_len > self.pastebin_downloads_threshold:
evidence_type = 'LargeResponseBody'
attacker_direction = 'srcip'
attacker = profileid.split('_')[0]
threat_level = 'medium'
category = 'Anomaly.DataTransfer'
confidence = 1
description = f'response body is larger than the threshold ({self.pastebin_downloads_threshold})'
__database__.setEvidence(evidence_type, attacker_direction, attacker, threat_level, confidence,
description, timestamp, category, profileid=profileid, twid=twid, uid=uid)
return True
return False


def check_pastebin_downloads(
self,
Expand Down