mirror of
https://github.com/0x5t4l1n/Keylogger.git
synced 2026-05-26 11:35:50 +00:00
refactor: address validation review feedback
Agent-Logs-Url: https://github.com/Stalin-143/Keylogger/sessions/cef34b0e-605b-4ab9-8da6-2559d1dd4529 Co-authored-by: Stalin-143 <161853795+Stalin-143@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
e450630b7d
commit
d61ff1364e
+6
-2
@@ -227,8 +227,12 @@ def main():
|
|||||||
print("Please set server_url in config/config.json or use --server-url argument.")
|
print("Please set server_url in config/config.json or use --server-url argument.")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
if not api_key or len(api_key) < 24:
|
if not api_key:
|
||||||
print("Error: LOG_INGEST_API_KEY environment variable is required and must be at least 24 characters.")
|
print("Error: LOG_INGEST_API_KEY environment variable is required.")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
if len(api_key) < 24:
|
||||||
|
print("Error: LOG_INGEST_API_KEY must be at least 24 characters.")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
if args.no_verify_ssl:
|
if args.no_verify_ssl:
|
||||||
|
|||||||
@@ -230,9 +230,6 @@ def receive_log():
|
|||||||
if not has_valid_api_key():
|
if not has_valid_api_key():
|
||||||
return "Unauthorized", 401
|
return "Unauthorized", 401
|
||||||
|
|
||||||
if request.content_length and request.content_length > MAX_LOG_PAYLOAD_BYTES:
|
|
||||||
return "Log payload too large", 413
|
|
||||||
|
|
||||||
log_data = request.form.get('log', '')
|
log_data = request.form.get('log', '')
|
||||||
if log_data:
|
if log_data:
|
||||||
if len(log_data.encode('utf-8')) > MAX_LOG_PAYLOAD_BYTES:
|
if len(log_data.encode('utf-8')) > MAX_LOG_PAYLOAD_BYTES:
|
||||||
|
|||||||
Reference in New Issue
Block a user