mirror of
https://github.com/0x5t4l1n/Keylogger.git
synced 2026-05-26 11:35:50 +00:00
fix: remove remaining sensitive output and align api key constants
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
b3e4456f55
commit
1f99612918
+4
-2
@@ -28,6 +28,8 @@ BANNER = r"""
|
|||||||
GitHub: https://github.com/Stalin-143
|
GitHub: https://github.com/Stalin-143
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
MIN_API_KEY_LENGTH = 24
|
||||||
|
|
||||||
|
|
||||||
class KeyLogger:
|
class KeyLogger:
|
||||||
"""Keylogger class to handle keyboard input capture and logging."""
|
"""Keylogger class to handle keyboard input capture and logging."""
|
||||||
@@ -231,8 +233,8 @@ def main():
|
|||||||
print("ERROR: LOG_INGEST_API_KEY environment variable is required.")
|
print("ERROR: LOG_INGEST_API_KEY environment variable is required.")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
if len(api_key) < 24:
|
if len(api_key) < MIN_API_KEY_LENGTH:
|
||||||
print("ERROR: LOG_INGEST_API_KEY must be at least 24 characters.")
|
print(f"ERROR: LOG_INGEST_API_KEY must be at least {MIN_API_KEY_LENGTH} characters.")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
if args.no_verify_ssl:
|
if args.no_verify_ssl:
|
||||||
|
|||||||
+5
-16
@@ -134,8 +134,6 @@ def has_sufficient_key_entropy(value):
|
|||||||
return False
|
return False
|
||||||
if len(set(value)) < MIN_API_KEY_UNIQUE_CHARS:
|
if len(set(value)) < MIN_API_KEY_UNIQUE_CHARS:
|
||||||
return False
|
return False
|
||||||
if value.count(value[0]) == len(value):
|
|
||||||
return False
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
@@ -374,28 +372,19 @@ def main():
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
if CONFIG['password'] == 'admin':
|
if CONFIG['password'] == 'admin':
|
||||||
print("ERROR: Default password 'admin' is not allowed.")
|
sys.exit("ERROR: Authentication secret uses a disallowed default value.")
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
if len(CONFIG['password']) < MIN_PASSWORD_LENGTH or not is_strong_password(CONFIG['password']):
|
if len(CONFIG['password']) < MIN_PASSWORD_LENGTH or not is_strong_password(CONFIG['password']):
|
||||||
print("ERROR: Weak password detected.")
|
sys.exit("ERROR: Authentication secret does not meet complexity policy.")
|
||||||
print(
|
|
||||||
f"Please use at least {MIN_PASSWORD_LENGTH} characters with uppercase, lowercase, "
|
|
||||||
"number, and special character."
|
|
||||||
)
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
if not CONFIG['api_key']:
|
if not CONFIG['api_key']:
|
||||||
print("ERROR: LOG_INGEST_API_KEY is required.")
|
sys.exit("ERROR: Ingestion API secret is required.")
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
if len(CONFIG['api_key']) < MIN_API_KEY_LENGTH:
|
if len(CONFIG['api_key']) < MIN_API_KEY_LENGTH:
|
||||||
print(f"ERROR: LOG_INGEST_API_KEY must be at least {MIN_API_KEY_LENGTH} characters.")
|
sys.exit("ERROR: Ingestion API secret does not meet length policy.")
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
if not has_sufficient_key_entropy(CONFIG['api_key']):
|
if not has_sufficient_key_entropy(CONFIG['api_key']):
|
||||||
print(f"ERROR: Ingestion API key must include at least {MIN_API_KEY_UNIQUE_CHARS} unique characters.")
|
sys.exit("ERROR: Ingestion API secret does not meet entropy policy.")
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
# Get server settings
|
# Get server settings
|
||||||
host = args.host or server_config.get('host', '0.0.0.0')
|
host = args.host or server_config.get('host', '0.0.0.0')
|
||||||
|
|||||||
Reference in New Issue
Block a user